Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require a partner for the partner dashboard #4063

Merged
merged 7 commits into from
Aug 23, 2024
Merged

Require a partner for the partner dashboard #4063

merged 7 commits into from
Aug 23, 2024

Conversation

awwaiid
Copy link
Collaborator

@awwaiid awwaiid commented Jan 28, 2024

No description provided.

@awwaiid awwaiid requested a review from dorner January 28, 2024 15:44
@awwaiid awwaiid marked this pull request as draft January 28, 2024 15:48
@@ -93,6 +93,15 @@ def authorize_admin
current_user.has_role?(Role::ORG_ADMIN, current_organization)
end

def require_partner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in ApplicationController if it's only used in the partner DashboardController?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future proofing to make it look like the others -- authorize_user, current_role, etc. It looked like those so I put it with those -- wamme to move it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think Partner::BaseController is a fine place to put it. It's still fairly centralized and makes it more obvious that it's only relevant to pages in that namespace.

@@ -4,6 +4,8 @@ class DashboardsController < BaseController

protect_from_forgery with: :exception

before_action :require_partner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in the partner base controller? I feel like every page under there needs a current partner, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I didn't realize BaseController is Partners::BaseController. I'll move it!

@@ -93,6 +93,15 @@ def authorize_admin
current_user.has_role?(Role::ORG_ADMIN, current_organization)
end

def require_partner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think Partner::BaseController is a fine place to put it. It's still fairly centralized and makes it more obvious that it's only relevant to pages in that namespace.

@dorner
Copy link
Collaborator

dorner commented May 24, 2024

@awwaiid is this PR still relevant?

@awwaiid
Copy link
Collaborator Author

awwaiid commented Jun 9, 2024

I'll brush it off and see what we should do

@awwaiid awwaiid marked this pull request as ready for review August 4, 2024 20:08
@awwaiid awwaiid requested a review from dorner August 4, 2024 20:08
@dorner
Copy link
Collaborator

dorner commented Aug 5, 2024

lol... the changes looked fine but a lot of tests are failing. 😁

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix tests plz

@awwaiid awwaiid requested a review from dorner August 23, 2024 02:26
@dorner
Copy link
Collaborator

dorner commented Aug 23, 2024

Hot dang!

@dorner dorner merged commit b44acbb into main Aug 23, 2024
38 checks passed
@dorner dorner deleted the not-partner-error branch August 23, 2024 19:46
Copy link
Contributor

@awwaiid: Your PR Require a partner for the partner dashboard is part of today's Human Essentials production release: 2024.08.25.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants