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

fix(member-invite): use hook to get default org roles #85994

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

ameliahsu
Copy link
Member

We determine the role options for the member invite modal using the inviter's member details. However, if a superuser is using the invite modal, then the inviter is not a member and the organization member details endpoint will 404. In this case, we use a default list of org roles to populate the role dropdown in the modal.

We should use a hook to get the default list of org roles so that we can include a Billing role, and only show the Admin role when the org is not on a business or enterprise plan.

@ameliahsu ameliahsu requested a review from a team February 26, 2025 22:19
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 26, 2025
/**
* Get list of organization roles
*/
'member-invite-modal:organization-roles': getOrgRoles,
Copy link
Contributor

@Christinarlong Christinarlong Feb 28, 2025

Choose a reason for hiding this comment

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

uh general js Q, why is one hook do () => function vs just function obj ? Is there a difference they would both be functions ❓

Copy link
Member Author

Choose a reason for hiding this comment

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

There are differences but I don't think we really care about them in this case? I am not sure
https://www.freecodecamp.org/news/the-difference-between-arrow-functions-and-normal-functions/

Copy link
Contributor

@Christinarlong Christinarlong left a comment

Choose a reason for hiding this comment

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

kewll

@ameliahsu ameliahsu merged commit 3b89659 into master Feb 28, 2025
42 checks passed
@ameliahsu ameliahsu deleted the mia/member-invite/org-roles branch February 28, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants