Use flow type instead of flow name (#2570)
This commit is contained in:
parent
24f43d59ec
commit
d832891c06
3 changed files with 11 additions and 9 deletions
|
@ -84,7 +84,8 @@
|
|||
"registrationFlow": "Registration flow",
|
||||
"directGrantFlow": "Direct grant flow",
|
||||
"resetCredentialsFlow": "Reset credentials flow",
|
||||
"clientAuthenticationFlow": "Client authentication flow"
|
||||
"clientAuthenticationFlow": "Client authentication flow",
|
||||
"dockerAuthenticationFlow": "Docker authentication flow"
|
||||
},
|
||||
"editInfo": "Edit info",
|
||||
"editFlow": "Edit flow",
|
||||
|
|
|
@ -73,9 +73,9 @@ export default function AuthenticationSection() {
|
|||
throw new Error(t("common:notFound"));
|
||||
}
|
||||
|
||||
const defaultFlows = Object.entries(realmRep)
|
||||
.filter((entry) => REALM_FLOWS.includes(entry[0]))
|
||||
.map((entry) => entry[1]);
|
||||
const defaultFlows = Object.entries(realmRep).filter(([key]) =>
|
||||
REALM_FLOWS.includes(key)
|
||||
);
|
||||
|
||||
for (const flow of flows as AuthenticationType[]) {
|
||||
flow.usedBy = { values: [] };
|
||||
|
@ -101,10 +101,12 @@ export default function AuthenticationSection() {
|
|||
flow.usedBy.values = idps.map(({ alias }) => alias!);
|
||||
}
|
||||
|
||||
const isDefault = defaultFlows.includes(flow.alias);
|
||||
if (isDefault) {
|
||||
const defaultFlow = defaultFlows.find(
|
||||
([, alias]) => flow.alias === alias
|
||||
);
|
||||
if (defaultFlow) {
|
||||
flow.usedBy.type = "default";
|
||||
flow.usedBy.values.push(flow.alias!);
|
||||
flow.usedBy.values.push(defaultFlow[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import { CheckCircleIcon } from "@patternfly/react-icons";
|
|||
|
||||
import type { AuthenticationType } from "../AuthenticationSection";
|
||||
import { KeycloakDataTable } from "../../components/table-toolbar/KeycloakDataTable";
|
||||
import { toUpperCase } from "../../util";
|
||||
import useToggle from "../../utils/useToggle";
|
||||
|
||||
import "./used-by.css";
|
||||
|
@ -135,7 +134,7 @@ export const UsedBy = ({
|
|||
<Label label={t(type!)} />
|
||||
</Button>
|
||||
))}
|
||||
{type === "default" && <Label label={toUpperCase(values[0])} />}
|
||||
{type === "default" && <Label label={t(`flow.${values[0]}`)} />}
|
||||
{!type && t("notInUse")}
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue