-
Notifications
You must be signed in to change notification settings - Fork 253
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(clerk-js,types): Supports default role on OrganizationProfile
invitations
#4210
feat(clerk-js,types): Supports default role on OrganizationProfile
invitations
#4210
Conversation
🦋 Changeset detectedLatest commit: 8212581 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eafc4b5
to
bfe9d11
Compare
OrganizationProfile
OrganizationProfile
invitations
OrganizationProfile
invitations OrganizationProfile
invitations
a231b1e
to
df5ceb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments. If you feel they are not significant feel free to merge.
|
||
let defaultRole = organizationSettings.domains.defaultRole; | ||
|
||
if (!defaultRole && options?.length === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be >1 ?
"If default role doesn't exist and fetched roles exist, use the first fetched role"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're checking if there's only one role returned from FAPI here, instead of selecting the first one. This avoids making an assumption on behalf of the user, as there could be cases where they wouldn't want that one the first one as default.
packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx
Show resolved
Hide resolved
9ebf02b
to
598a2f6
Compare
e18df9c
to
99ec73b
Compare
key: 'admin', | ||
name: 'Admin', | ||
description: '', | ||
permissions: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests were mocking with a single role, therefore initiating the field with that one instead and the assertion for "Select role" started to fail.
packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx
Show resolved
Hide resolved
99ec73b
to
d7b4569
Compare
d7b4569
to
8212581
Compare
Description
Resolves ORGS-211
Prepares
OrganizationProfile
for the upcomingdefault_role
changes. When inviting a member, thedefault_role
will be automatically selected, otherwise it falls back to the only available role.Currently behind a feature flag in the Dashboard, we're now allowing updating
default_role
regardless of whether verified domains are enabled.CleanShot.2024-09-24.at.07.57.19.mp4
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change