-
Notifications
You must be signed in to change notification settings - Fork 7
feat(core, react): unify invitation connection picker across providers and user directories #430
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
Changes from all commits
921aa6e
933815a
ad64ebc
98b88d4
dc09ecc
1970275
29b7f55
c1d459a
dc5cd8e
03504d3
58e136f
9d6a976
0290599
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ function getStatusBadgeVariant(status: InvitationStatus): 'warning' | 'destructi | |
| * @param props.isResending - Whether a resend action is in progress. | ||
| * @param props.customMessages - Custom translation messages. | ||
| * @param props.availableRoles - Available roles for display. | ||
| * @param props.availableProviders - Available providers for display. | ||
| * @param props.availableConnections - Merged identity providers + user stores for resolving the connection name. | ||
| * @param props.readOnly - Whether in read-only mode. | ||
| * @param props.onClose - Callback when modal is closed. | ||
| * @param props.onCopyUrl - Callback when copy URL is clicked. | ||
|
|
@@ -62,7 +62,7 @@ export function OrganizationInvitationDetailsModal({ | |
| isResending = false, | ||
| customMessages = {}, | ||
| availableRoles = [], | ||
| availableProviders = [], | ||
| availableConnections = [], | ||
| readOnly = false, | ||
| onClose, | ||
| onCopyUrl, | ||
|
|
@@ -87,11 +87,12 @@ export function OrganizationInvitationDetailsModal({ | |
| .filter(Boolean); | ||
| }, [invitation?.roles, availableRoles]); | ||
|
|
||
| const providerName = React.useMemo(() => { | ||
| if (!invitation?.identity_provider_id) return null; | ||
| const provider = availableProviders.find((p) => p.id === invitation.identity_provider_id); | ||
| return provider?.name ?? invitation.identity_provider_id; | ||
| }, [invitation?.identity_provider_id, availableProviders]); | ||
| const connectionName = React.useMemo(() => { | ||
| const connectionId = invitation?.identity_provider_id ?? invitation?.user_store_id; | ||
| if (!connectionId) return null; | ||
| const connection = availableConnections.find((c) => c.id === connectionId); | ||
| return connection?.name ?? connectionId; | ||
| }, [invitation?.identity_provider_id, invitation?.user_store_id, availableConnections]); | ||
|
|
||
| const [copied, setCopied] = React.useState(false); | ||
| const copyTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null); | ||
|
|
@@ -255,13 +256,13 @@ export function OrganizationInvitationDetailsModal({ | |
| <TextField value={invitation?.inviter?.name ?? '-'} readOnly /> | ||
| </div> | ||
|
|
||
| {/* Identity Provider */} | ||
| {providerName && ( | ||
| {/* Connection (identity provider or user directory) */} | ||
| {connectionName && ( | ||
| <div className="space-y-2"> | ||
| <Label className="text-sm font-medium text-muted-foreground"> | ||
| {t('invitation.details.provider_label')} | ||
| {t('invitation.details.connection_label')} | ||
| </Label> | ||
| <TextField value={providerName} readOnly /> | ||
| <TextField value={connectionName} readOnly /> | ||
|
Comment on lines
+259
to
+265
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Use a connection-neutral label for both connection types. This block now displays identity providers and user stores, but still renders 🤖 Prompt for AI Agents |
||
| </div> | ||
| )} | ||
| </div> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.