Skip to content

feat(ui): Disable invite button when over maxAllowedMemberships#8089

Merged
dstaley merged 3 commits intofeat/seat-based-billingfrom
ds.feat/sbb-disable-invite-button
Mar 17, 2026
Merged

feat(ui): Disable invite button when over maxAllowedMemberships#8089
dstaley merged 3 commits intofeat/seat-based-billingfrom
ds.feat/sbb-disable-invite-button

Conversation

@dstaley
Copy link
Member

@dstaley dstaley commented Mar 16, 2026

Description

This PR updates the rendering logic for the Invite button in OrganizationProfile to respond to organization memberships and the maxAllowedMemberships field. 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's maxAllowedMemberships. 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.

CleanShot 2026-03-16 at 11 38 00@2x

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Mar 17, 2026 3:13pm

Request Review

@dstaley dstaley requested a review from a team March 16, 2026 16:54
@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: c1b6e46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.',

Choose a reason for hiding this comment

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

maybe we should use organization here instead of organisation for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

we absolutely should! I didn't even realize British English had a different spelling. Good catch!

return false;
}

if (organization.maxAllowedMemberships === 0) {

Choose a reason for hiding this comment

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

maybe add a comment here explaining that 0 means unlimited. for future readers of the code.

Copy link
Member Author

Choose a reason for hiding this comment

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

🫡

@dstaley dstaley merged commit 403efb1 into feat/seat-based-billing Mar 17, 2026
7 checks passed
@dstaley dstaley deleted the ds.feat/sbb-disable-invite-button branch March 17, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants