mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
chore(console): attribute mapping 'id' field should not be editable (#5002)
This commit is contained in:
parent
3b9e078d04
commit
6c5213cb65
1 changed files with 19 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
import { socialUserInfoGuard } from '@logto/connector-kit';
|
||||
import { type SsoConnectorWithProviderConfig } from '@logto/schemas';
|
||||
import { conditional } from '@silverhand/essentials';
|
||||
import { conditional, conditionalString } from '@silverhand/essentials';
|
||||
import { useFormContext } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
@ -55,12 +55,24 @@ function SamlAttributeMapping({ providerConfig }: Props) {
|
|||
<CopyToClipboard className={styles.copyToClipboard} variant="border" value={key} />
|
||||
</td>
|
||||
<td>
|
||||
{/* Show default value of `id` field to show that Logto has handled the default value. */}
|
||||
{/* Per SAML protocol, this field is not eligible to change in most cases. */}
|
||||
{key === 'id' ? (
|
||||
<CopyToClipboard
|
||||
className={styles.copyToClipboard}
|
||||
variant="border"
|
||||
value={conditionalString(
|
||||
result.success && result.data.defaultAttributeMapping[key]
|
||||
)}
|
||||
/>
|
||||
) : (
|
||||
<TextInput
|
||||
{...register(`${primaryKey}.${key}`)}
|
||||
placeholder={conditional(
|
||||
result.success && result.data.defaultAttributeMapping[key]
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue