add stringify for custom idp (#22699)

This commit is contained in:
Erik Jan de Wit 2023-09-05 13:42:30 +02:00 committed by GitHub
parent 71fa95721d
commit 6830735ed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -44,12 +44,18 @@ export const MultiLineInput = ({
});
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 =
Array.isArray(values) && values.length !== 0
? values
: defaultValue || [""];
: (stringify
? stringToMultiline(defaultValue as string)
: defaultValue) || [""];
return values;
}, [value]);

View file

@ -92,7 +92,10 @@ export default function AddIdentityProvider() {
<FormProvider {...form}>
<GeneralSettings id={providerId} />
{providerInfo && (
<DynamicComponents properties={providerInfo.properties} />
<DynamicComponents
stringify
properties={providerInfo.properties}
/>
)}
</FormProvider>
<ActionGroup>

View file

@ -340,7 +340,10 @@ export default function DetailSettings() {
<>
<GeneralSettings create={false} id={alias} />
{providerInfo && (
<DynamicComponents properties={providerInfo.properties} />
<DynamicComponents
stringify
properties={providerInfo.properties}
/>
)}
</>
)}