add stringify
for custom idp (#22699)
This commit is contained in:
parent
71fa95721d
commit
6830735ed9
3 changed files with 16 additions and 4 deletions
|
@ -44,12 +44,18 @@ export const MultiLineInput = ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const fields = useMemo<string[]>(() => {
|
const fields = useMemo<string[]>(() => {
|
||||||
let values = stringify ? stringToMultiline(value as string) : value;
|
let values = stringify
|
||||||
|
? stringToMultiline(
|
||||||
|
Array.isArray(value) && value.length === 1 ? value[0] : value,
|
||||||
|
)
|
||||||
|
: value;
|
||||||
|
|
||||||
values =
|
values =
|
||||||
Array.isArray(values) && values.length !== 0
|
Array.isArray(values) && values.length !== 0
|
||||||
? values
|
? values
|
||||||
: defaultValue || [""];
|
: (stringify
|
||||||
|
? stringToMultiline(defaultValue as string)
|
||||||
|
: defaultValue) || [""];
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}, [value]);
|
}, [value]);
|
||||||
|
|
|
@ -92,7 +92,10 @@ export default function AddIdentityProvider() {
|
||||||
<FormProvider {...form}>
|
<FormProvider {...form}>
|
||||||
<GeneralSettings id={providerId} />
|
<GeneralSettings id={providerId} />
|
||||||
{providerInfo && (
|
{providerInfo && (
|
||||||
<DynamicComponents properties={providerInfo.properties} />
|
<DynamicComponents
|
||||||
|
stringify
|
||||||
|
properties={providerInfo.properties}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
<ActionGroup>
|
<ActionGroup>
|
||||||
|
|
|
@ -340,7 +340,10 @@ export default function DetailSettings() {
|
||||||
<>
|
<>
|
||||||
<GeneralSettings create={false} id={alias} />
|
<GeneralSettings create={false} id={alias} />
|
||||||
{providerInfo && (
|
{providerInfo && (
|
||||||
<DynamicComponents properties={providerInfo.properties} />
|
<DynamicComponents
|
||||||
|
stringify
|
||||||
|
properties={providerInfo.properties}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue