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

feat(onboarding): frontend for disableMemberInvite flag #76085

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

ameliahsu
Copy link
Member

@ameliahsu ameliahsu commented Aug 13, 2024

add toggle for org admin to allow/disallow members from inviting teammates to their org

Admin view:
admin_view

Toggle is disabled for non-admin members and organizations that are not on a business plan:
member_view

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 13, 2024
Copy link

codecov bot commented Aug 13, 2024

Bundle Report

Changes will increase total bundle size by 7.0kB ⬆️

Bundle name Size Change
app-webpack-bundle-array-push 30.24MB 7.0kB ⬆️

@ameliahsu ameliahsu requested a review from a team August 13, 2024 20:07
@ameliahsu ameliahsu marked this pull request as ready for review August 13, 2024 20:07
ameliahsu added a commit that referenced this pull request Aug 14, 2024
…76116)

add `disable_member_invite` flag for org admin to allow/disallow members
from inviting teammates to their org

frontend: #76085
@@ -91,6 +91,16 @@ const formGroups: JsonFormObject[] = [
label: t('Open Membership'),
Copy link
Member

Choose a reason for hiding this comment

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

Now that you're here, can you change this to Open Team Membership? The title is confusing and makes it look like open org membership.

Comment on lines 41 to 44
can_invite:
organization.access?.includes('member:write') ||
(organization.features.includes('members-invite-teammates') &&
organization.allowMemberInvite),
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this logic to a function so then you can share code with line 53?

@sentaur-athena
Copy link
Member

Can you please add a screenshot for what others will see who are not org admins?

function canInvite(organization: Organization) {
return (
organization.access?.includes('member:write') ||
(organization.features.includes('members-invite-teammates') &&
Copy link
Member

Choose a reason for hiding this comment

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

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

@sentaur-athena
Copy link
Member

I'm not sure if you like to add this change to this PR or the next one, but commented any ways. Looks good otherwise.

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...tic/app/data/forms/organizationGeneralSettings.tsx 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #76085      +/-   ##
==========================================
- Coverage   78.15%   78.15%   -0.01%     
==========================================
  Files        6903     6905       +2     
  Lines      307221   307228       +7     
  Branches    52875    52866       -9     
==========================================
+ Hits       240104   240107       +3     
- Misses      60705    60776      +71     
+ Partials     6412     6345      -67     

@ameliahsu ameliahsu merged commit 5169234 into master Aug 28, 2024
44 checks passed
@ameliahsu ameliahsu deleted the mia/invite-members/fe branch August 28, 2024 18:12
ArthurKnaus pushed a commit that referenced this pull request Aug 29, 2024
add toggle for org admin to allow/disallow members from inviting
teammates to their org

Admin view:
<img width="1214" alt="admin_view"
src="https://github.com/user-attachments/assets/610f4f67-56a4-43c2-a83c-483709057866">

Non-admin view (toggle is disabled):
<img width="1216" alt="member_view"
src="https://github.com/user-attachments/assets/12a990bf-6a2b-4fe3-b89d-4cb97e82df1e">
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 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.

2 participants