added none option to attribute group (#4191)
* added none option fixes: #4085 * small refactor
This commit is contained in:
parent
5ba147b384
commit
4d44265ed0
2 changed files with 22 additions and 21 deletions
|
@ -63,19 +63,15 @@ const LoginFlow = ({
|
||||||
aria-label={t(label)}
|
aria-label={t(label)}
|
||||||
isOpen={open}
|
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 === ""
|
||||||
<>
|
? [
|
||||||
{defaultValue === "" && (
|
<SelectOption key="empty" value="">
|
||||||
<SelectOption key="empty" value={defaultValue}>
|
{t("common:none")}
|
||||||
{t("common:none")}
|
</SelectOption>,
|
||||||
</SelectOption>
|
]
|
||||||
)}
|
: []),
|
||||||
</>
|
...(flows?.map((option) => (
|
||||||
{/* 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) => (
|
|
||||||
<SelectOption
|
<SelectOption
|
||||||
selected={option.alias === field.value}
|
selected={option.alias === field.value}
|
||||||
key={option.id}
|
key={option.id}
|
||||||
|
@ -83,8 +79,8 @@ const LoginFlow = ({
|
||||||
>
|
>
|
||||||
{option.alias}
|
{option.alias}
|
||||||
</SelectOption>
|
</SelectOption>
|
||||||
))}
|
)) || []),
|
||||||
</>
|
]}
|
||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -145,14 +145,19 @@ export const AttributeGeneralSettings = () => {
|
||||||
onChange(value.toString());
|
onChange(value.toString());
|
||||||
setIsAttributeGroupDropdownOpen(false);
|
setIsAttributeGroupDropdownOpen(false);
|
||||||
}}
|
}}
|
||||||
selections={[value || t("common:choose")]}
|
selections={[value || t("common:none")]}
|
||||||
variant={SelectVariant.single}
|
variant={SelectVariant.single}
|
||||||
>
|
>
|
||||||
{config?.groups?.map((group) => (
|
{[
|
||||||
<SelectOption key={group.name} value={group.name}>
|
<SelectOption key="empty" value="">
|
||||||
{group.name}
|
{t("common:none")}
|
||||||
</SelectOption>
|
</SelectOption>,
|
||||||
))}
|
...(config?.groups?.map((group) => (
|
||||||
|
<SelectOption key={group.name} value={group.name}>
|
||||||
|
{group.name}
|
||||||
|
</SelectOption>
|
||||||
|
)) || []),
|
||||||
|
]}
|
||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
></Controller>
|
></Controller>
|
||||||
|
|
Loading…
Reference in a new issue