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(invite-members): enable member role in dropdown #77871

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

ameliahsu
Copy link
Member

fix for the "Member" role being disabled for members sending invites

Screenshot 2024-09-20 at 1 43 16 PM

chose to fix this on the frontend rather than modifying the GET request for this specific page so that the backend continues to returns the same result for all pages

@ameliahsu ameliahsu requested a review from a team September 20, 2024 20:49
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
static/app/components/roleSelectControl.tsx 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #77871       +/-   ##
===========================================
- Coverage   88.40%   78.12%   -10.28%     
===========================================
  Files        3000     6994     +3994     
  Lines      186662   310204   +123542     
  Branches    30663    50752    +20089     
===========================================
+ Hits       165012   242343    +77331     
- Misses      15621    56136    +40515     
- Partials     6029    11725     +5696     

@@ -31,7 +38,10 @@ function RoleSelectControl({roles, disableUnallowed, ...props}: Props) {
({
value: r.id,
label: r.name,
disabled: disableUnallowed && !r.isAllowed,
disabled:
disableUnallowed &&
Copy link
Member

Choose a reason for hiding this comment

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

Should these be && or || 🤔

Copy link
Member

Choose a reason for hiding this comment

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

i believe && is fine, we want to disable if its not allowed and if its not a member invite or the inviting roll is member. demorgan's law makes the && valid i think.

Copy link
Member

@iamrajjoshi iamrajjoshi left a comment

Choose a reason for hiding this comment

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

1 main question about the component being reused couple places

organization.features.includes('members-invite-teammates') &&
organization.allowMemberInvite &&
organization.access?.includes('member:invite');

return (
<SelectControl
Copy link
Member

Choose a reason for hiding this comment

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

fwiw this component is used in a couple places in our code, we are ok with this logic to change in all of the places right?

@@ -31,7 +38,10 @@ function RoleSelectControl({roles, disableUnallowed, ...props}: Props) {
({
value: r.id,
label: r.name,
disabled: disableUnallowed && !r.isAllowed,
disabled:
disableUnallowed &&
Copy link
Member

Choose a reason for hiding this comment

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

i believe && is fine, we want to disable if its not allowed and if its not a member invite or the inviting roll is member. demorgan's law makes the && valid i think.

@iamrajjoshi iamrajjoshi self-requested a review September 23, 2024 19:19
Copy link
Member

@iamrajjoshi iamrajjoshi left a comment

Choose a reason for hiding this comment

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

the other places the component is being used should also have support for member invite

@ameliahsu ameliahsu merged commit 57891d8 into master Sep 23, 2024
43 of 44 checks passed
@ameliahsu ameliahsu deleted the mia/invite-members/disabled-role branch September 23, 2024 19:30
harshithadurai pushed a commit that referenced this pull request Sep 24, 2024
fix for the "Member" role being disabled for members sending invites

<img width="886" alt="Screenshot 2024-09-20 at 1 43 16 PM"
src="https://github.com/user-attachments/assets/c6735fd4-9e06-4c1d-9321-e4ae1b041f80">

chose to fix this on the frontend rather than modifying the GET request
for this specific page so that the backend continues to returns the same
result for all pages
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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