feat(clerk-js): Use org:sys_domains:read for improved fine grain control of the UI#1896
Conversation
🦋 Changeset detectedLatest commit: 9a375d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
org:sys_domains:read for improved fine grain control of the UI
| }, | ||
| ]} | ||
| /> | ||
| showDotMenu ? ( |
There was a problem hiding this comment.
🙃 showDotMeny && <JSX/>
There was a problem hiding this comment.
Already tried that, seems like trailingComponent does not accept null, I didn't want to mess with the signature of the component.
There was a problem hiding this comment.
Why don't we update its types?
There was a problem hiding this comment.
The following has type of false | EmotionJSX.Element | null
showDotMenu && (
<DomainListDotMenu
redirectSubPath={redirectSubPath}
domainId={d.id}
/>
)
So i would have to do
(showDotMenu || null ) && (
<DomainListDotMenu
redirectSubPath={redirectSubPath}
domainId={d.id}
/>
)Which i'm not convinced it is better
There was a problem hiding this comment.
I am not sure I understand what you are talking about. Is this the type?
| setData(null); | ||
| }); | ||
| }, []); | ||
| }, [JSON.stringify(params)]); |
There was a problem hiding this comment.
❓ Can you elaborate on this change? Is it necessary to be part of this PR?
There was a problem hiding this comment.
Previously useFetch would only fire once, "on mount", there was a bug where the Gate component would not hide the content while not having the necessary permission because the "fetch" wouldn't fire when the parameters changed.
For context we are using useFetch to handle the async logic of isAuthorized.
There was a problem hiding this comment.
Do we need to make a FAPI call every time the isAuthorized is invoked?
There was a problem hiding this comment.
This would only invoke a call if params change, not on every render.
| * @returns {string} Returns the string without leading slashes | ||
| * @param path | ||
| */ | ||
| export const trimLeadingSlash = (path: string): string => { |
There was a problem hiding this comment.
Can we add a couple of tests for this util?
There was a problem hiding this comment.
Yeap, thanks for the reminder
a591162 to
d19c8a0
Compare
| }, | ||
| ]} | ||
| /> | ||
| showDotMenu ? ( |
There was a problem hiding this comment.
Why don't we update its types?
| setData(null); | ||
| }); | ||
| }, []); | ||
| }, [JSON.stringify(params)]); |
There was a problem hiding this comment.
Do we need to make a FAPI call every time the isAuthorized is invoked?
| }, | ||
| ]} | ||
| /> | ||
| showDotMenu ? ( |
There was a problem hiding this comment.
I am not sure I understand what you are talking about. Is this the type?
…ntrol of the UI Backport of #1896

Description
This PR makes usage of
org:sys_domains:reada permission that allows users to see a list of domains. Previously we were wrapping the whole functionality under themanagepermission.Checklist
npm testruns as expected.npm run buildruns as expected.Type of change
Packages affected
@clerk/clerk-js@clerk/clerk-react@clerk/nextjs@clerk/remix@clerk/types@clerk/themes@clerk/localizations@clerk/clerk-expo@clerk/backend@clerk/clerk-sdk-node@clerk/shared@clerk/fastify@clerk/chrome-extensiongatsby-plugin-clerkbuild/tooling/chore