From 4d44265ed0ff91a90c07f703b3fac48d3151ac20 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 16 Jan 2023 08:17:00 +0100 Subject: [PATCH] added none option to attribute group (#4191) * added none option fixes: #4085 * small refactor --- .../add/AdvancedSettings.tsx | 26 ++++++++----------- .../attribute/AttributeGeneralSettings.tsx | 17 +++++++----- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/apps/admin-ui/src/identity-providers/add/AdvancedSettings.tsx b/apps/admin-ui/src/identity-providers/add/AdvancedSettings.tsx index 28845587ae..7c0155424f 100644 --- a/apps/admin-ui/src/identity-providers/add/AdvancedSettings.tsx +++ b/apps/admin-ui/src/identity-providers/add/AdvancedSettings.tsx @@ -63,19 +63,15 @@ const LoginFlow = ({ aria-label={t(label)} isOpen={open} > - {/* The type for the children of Select are incorrect, so we need a fragment here. */} - {/* eslint-disable-next-line react/jsx-no-useless-fragment */} - <> - {defaultValue === "" && ( - - {t("common:none")} - - )} - - {/* The type for the children of Select are incorrect, so we need a fragment here. */} - {/* eslint-disable-next-line react/jsx-no-useless-fragment */} - <> - {flows?.map((option) => ( + {[ + ...(defaultValue === "" + ? [ + + {t("common:none")} + , + ] + : []), + ...(flows?.map((option) => ( {option.alias} - ))} - + )) || []), + ]} )} /> diff --git a/apps/admin-ui/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx b/apps/admin-ui/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx index b713808e28..280902e9bc 100644 --- a/apps/admin-ui/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx +++ b/apps/admin-ui/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx @@ -145,14 +145,19 @@ export const AttributeGeneralSettings = () => { onChange(value.toString()); setIsAttributeGroupDropdownOpen(false); }} - selections={[value || t("common:choose")]} + selections={[value || t("common:none")]} variant={SelectVariant.single} > - {config?.groups?.map((group) => ( - - {group.name} - - ))} + {[ + + {t("common:none")} + , + ...(config?.groups?.map((group) => ( + + {group.name} + + )) || []), + ]} )} >