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)}
|
||||
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 === "" && (
|
||||
<SelectOption key="empty" value={defaultValue}>
|
||||
{t("common:none")}
|
||||
</SelectOption>
|
||||
)}
|
||||
</>
|
||||
{/* 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 === ""
|
||||
? [
|
||||
<SelectOption key="empty" value="">
|
||||
{t("common:none")}
|
||||
</SelectOption>,
|
||||
]
|
||||
: []),
|
||||
...(flows?.map((option) => (
|
||||
<SelectOption
|
||||
selected={option.alias === field.value}
|
||||
key={option.id}
|
||||
|
@ -83,8 +79,8 @@ const LoginFlow = ({
|
|||
>
|
||||
{option.alias}
|
||||
</SelectOption>
|
||||
))}
|
||||
</>
|
||||
)) || []),
|
||||
]}
|
||||
</Select>
|
||||
)}
|
||||
/>
|
||||
|
|
|
@ -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) => (
|
||||
<SelectOption key={group.name} value={group.name}>
|
||||
{group.name}
|
||||
</SelectOption>
|
||||
))}
|
||||
{[
|
||||
<SelectOption key="empty" value="">
|
||||
{t("common:none")}
|
||||
</SelectOption>,
|
||||
...(config?.groups?.map((group) => (
|
||||
<SelectOption key={group.name} value={group.name}>
|
||||
{group.name}
|
||||
</SelectOption>
|
||||
)) || []),
|
||||
]}
|
||||
</Select>
|
||||
)}
|
||||
></Controller>
|
||||
|
|
Loading…
Reference in a new issue