-
Notifications
You must be signed in to change notification settings - Fork 453
feat(clerk-js,localizations,msw,shared,ui): Add display for member limits #7920
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
517ab55
feat(clerk-js,localizations,msw,shared,ui): Add display for member li…
dstaley 55ddfb5
feat(): Change to membershipSeatUsageLabel
dstaley cc8bbba
fix(localizations): Update text
dstaley 3e31113
fix(ui): Use org maxAllowedMemberships, not env
dstaley c008231
Merge branch 'feat/seat-based-billing' into ds.feat/sbb-member-limits
dstaley 424f675
Merge branch 'feat/seat-based-billing' into ds.feat/sbb-member-limits
dstaley 82fe5cf
fix(ui): Only render seat usage when limited
dstaley 4504aa0
fix(ui): remove cruft
dstaley da46b83
lint(ui): sort imports
dstaley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export { UserButtonSignedIn } from './user-button-signed-in'; | ||
| export { CheckoutAccountCredit } from './checkout-account-credit'; | ||
| export { OrgProfileSeatLimit } from './org-profile-seat-limit'; |
74 changes: 74 additions & 0 deletions
74
packages/clerk-js/sandbox/scenarios/org-profile-seat-limit.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import { | ||
| BillingService, | ||
| clerkHandlers, | ||
| EnvironmentService, | ||
| SessionService, | ||
| setClerkState, | ||
| type MockScenario, | ||
| UserService, | ||
| OrganizationService, | ||
| } from '@clerk/msw'; | ||
|
|
||
| export function OrgProfileSeatLimit(): MockScenario { | ||
| const organization = OrganizationService.create({ maxAllowedMemberships: 10 }); | ||
| const user = UserService.create(); | ||
| user.organizationMemberships = [ | ||
| { | ||
| object: 'organization_membership', | ||
| id: 'orgmem_3004mVaZrB4yD63C9KuwTMWNKbj', | ||
| public_metadata: {}, | ||
| role: 'org:owner', | ||
| role_name: 'Owner', | ||
| permissions: [ | ||
| 'org:applications:create', | ||
| 'org:applications:manage', | ||
| 'org:applications:delete', | ||
| 'org:billing:read', | ||
| 'org:billing:manage', | ||
| 'org:config:read', | ||
| 'org:config:manage', | ||
| 'org:global:read', | ||
| 'org:global:manage', | ||
| 'org:instances:create', | ||
| 'org:instances:manage', | ||
| 'org:instances:delete', | ||
| 'org:restrictions:read', | ||
| 'org:restrictions:manage', | ||
| 'org:secrets:manage', | ||
| 'org:users:imp', | ||
| 'org:sys_profile:manage', | ||
| 'org:sys_profile:delete', | ||
| 'org:sys_billing:read', | ||
| 'org:sys_billing:manage', | ||
| 'org:sys_domains:read', | ||
| 'org:sys_domains:manage', | ||
| 'org:sys_memberships:read', | ||
| 'org:sys_memberships:manage', | ||
| ], | ||
| created_at: 1752751315275, | ||
| updated_at: 1752751315275, | ||
| organization, | ||
| }, | ||
| ]; | ||
| const session = SessionService.create(user); | ||
| const plans = BillingService.createDefaultPlans(); | ||
| const subscription = BillingService.createSubscription(plans[1]); | ||
|
|
||
| setClerkState({ | ||
| environment: EnvironmentService.MULTI_SESSION, | ||
| session, | ||
| user, | ||
| organization, | ||
| billing: { | ||
| plans, | ||
| subscription, | ||
| }, | ||
| }); | ||
|
|
||
| return { | ||
| description: 'OrganizationProfile with a seat limit', | ||
| handlers: clerkHandlers, | ||
| initialState: { session, user, organization }, | ||
| name: 'org-profile-seat-limit', | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.