feat(ui): Disable invite button when over maxAllowedMemberships#8089
feat(ui): Disable invite button when over maxAllowedMemberships#8089dstaley merged 3 commits intofeat/seat-based-billingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
packages/localizations/src/en-US.ts
Outdated
| organization_domain_exists_for_enterprise_connection: undefined, | ||
| organization_membership_quota_exceeded: undefined, | ||
| organization_membership_quota_exceeded: | ||
| 'You have reached your limit of organisation memberships, including outstanding invitations.', |
There was a problem hiding this comment.
maybe we should use organization here instead of organisation for consistency.
There was a problem hiding this comment.
we absolutely should! I didn't even realize British English had a different spelling. Good catch!
| return false; | ||
| } | ||
|
|
||
| if (organization.maxAllowedMemberships === 0) { |
There was a problem hiding this comment.
maybe add a comment here explaining that 0 means unlimited. for future readers of the code.
Description
This PR updates the rendering logic for the
Invitebutton in OrganizationProfile to respond to organization memberships and themaxAllowedMembershipsfield. Now, the invite button will be disabled (with a tooltip) if the sum of the organization's members and pending invitations is equal to or above the organization'smaxAllowedMemberships. This PR also introduces a localizable value for the error code that is returned from the API when a user attempts to invite members that would exceed their limit. This error message is also used for the tooltip when the invite button is disabled.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change