Changed unspecified to "" (#3367)
This commit is contained in:
parent
5c57e5103b
commit
6c57312273
1 changed files with 12 additions and 16 deletions
|
@ -16,13 +16,13 @@ import { TextField } from "../component/TextField";
|
||||||
import { FormGroupField } from "../component/FormGroupField";
|
import { FormGroupField } from "../component/FormGroupField";
|
||||||
import { HelpItem } from "../../components/help-enabler/HelpItem";
|
import { HelpItem } from "../../components/help-enabler/HelpItem";
|
||||||
|
|
||||||
const promptOptions = [
|
const promptOptions = {
|
||||||
"unspecified",
|
unspecified: "",
|
||||||
"none",
|
none: "none",
|
||||||
"consent",
|
consent: "consent",
|
||||||
"login",
|
login: "login",
|
||||||
"select_account",
|
select_account: "select_account",
|
||||||
];
|
};
|
||||||
|
|
||||||
export const ExtendedNonDiscoverySettings = () => {
|
export const ExtendedNonDiscoverySettings = () => {
|
||||||
const { t } = useTranslation("identity-providers");
|
const { t } = useTranslation("identity-providers");
|
||||||
|
@ -50,7 +50,7 @@ export const ExtendedNonDiscoverySettings = () => {
|
||||||
<FormGroupField label="prompt">
|
<FormGroupField label="prompt">
|
||||||
<Controller
|
<Controller
|
||||||
name="config.prompt"
|
name="config.prompt"
|
||||||
defaultValue={promptOptions[0]}
|
defaultValue=""
|
||||||
control={control}
|
control={control}
|
||||||
render={({ onChange, value }) => (
|
render={({ onChange, value }) => (
|
||||||
<Select
|
<Select
|
||||||
|
@ -61,18 +61,14 @@ export const ExtendedNonDiscoverySettings = () => {
|
||||||
onChange(value as string);
|
onChange(value as string);
|
||||||
setPromptOpen(false);
|
setPromptOpen(false);
|
||||||
}}
|
}}
|
||||||
selections={value}
|
selections={value || t(`prompts.unspecified`)}
|
||||||
variant={SelectVariant.single}
|
variant={SelectVariant.single}
|
||||||
aria-label={t("prompt")}
|
aria-label={t("prompt")}
|
||||||
isOpen={promptOpen}
|
isOpen={promptOpen}
|
||||||
>
|
>
|
||||||
{promptOptions.map((option) => (
|
{Object.entries(promptOptions).map(([key, val]) => (
|
||||||
<SelectOption
|
<SelectOption selected={val === value} key={key} value={val}>
|
||||||
selected={option === value}
|
{t(`prompts.${key}`)}
|
||||||
key={option}
|
|
||||||
value={option}
|
|
||||||
>
|
|
||||||
{t(`prompts.${option}`)}
|
|
||||||
</SelectOption>
|
</SelectOption>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
Loading…
Reference in a new issue