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[]>(() => { 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]);

View file

@ -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>

View file

@ -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}
/>
)} )}
</> </>
)} )}