diff --git a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts index a245740e43..609fae3225 100644 --- a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts @@ -854,8 +854,8 @@ describe("Clients test", () => { advancedTab.revertAuthFlowOverride(); advancedTab.jumpToAuthFlow(); - advancedTab.checkBrowserFlowInput(""); - advancedTab.checkDirectGrantInput(""); + advancedTab.checkBrowserFlowInput("Choose..."); + advancedTab.checkDirectGrantInput("Choose..."); advancedTab.selectBrowserFlowInput("browser"); advancedTab.selectDirectGrantInput("docker auth"); diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts index 3fa57e7f13..0c65f325c2 100644 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts +++ b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts @@ -13,7 +13,7 @@ export default class AdvancedTab extends PageObject { #nodeHostInput = "node"; #addNodeConfirmBtn = "#add-node-confirm"; - #accessTokenSignatureAlgorithmInput = "#accessTokenSignatureAlgorithm"; + #accessTokenSignatureAlgorithmInput = "#access🍺token🍺signed🍺response🍺alg"; #fineGrainSaveBtn = "#fineGrainSave"; #fineGrainRevertBtn = "#fineGrainRevert"; #OIDCCompatabilitySaveBtn = "OIDCCompatabilitySave"; @@ -36,8 +36,8 @@ export default class AdvancedTab extends PageObject { #pushedAuthorizationRequestRequiredSwitch = "attributes.require🍺pushed🍺authorization🍺requests"; - #browserFlowInput = "#browserFlow"; - #directGrantInput = "#directGrant"; + #browserFlowInput = "#browser"; + #directGrantInput = "#direct_grant"; #jumpToOIDCCompatabilitySettings = "jump-link-openid-connect-compatibility-modes"; diff --git a/js/apps/admin-ui/src/clients/advanced/AuthenticationOverrides.tsx b/js/apps/admin-ui/src/clients/advanced/AuthenticationOverrides.tsx index 489e802d68..d12e3ae387 100644 --- a/js/apps/admin-ui/src/clients/advanced/AuthenticationOverrides.tsx +++ b/js/apps/admin-ui/src/clients/advanced/AuthenticationOverrides.tsx @@ -1,20 +1,11 @@ -import { - ActionGroup, - Button, - FormGroup, - Select, - SelectOption, - SelectVariant, -} from "@patternfly/react-core"; +import AuthenticationFlowRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation"; +import { ActionGroup, Button } from "@patternfly/react-core"; import { sortBy } from "lodash-es"; import { useState } from "react"; -import { Controller, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; - -import { FormAccess } from "../../components/form/FormAccess"; -import { HelpItem } from "ui-shared"; - +import { SelectControl } from "ui-shared"; import { adminClient } from "../../admin-client"; +import { FormAccess } from "../../components/form/FormAccess"; import { useFetch } from "../../utils/useFetch"; type AuthenticationOverridesProps = { @@ -31,11 +22,7 @@ export const AuthenticationOverrides = ({ hasConfigureAccess, }: AuthenticationOverridesProps) => { const { t } = useTranslation(); - const [flows, setFlows] = useState([]); - const [browserFlowOpen, setBrowserFlowOpen] = useState(false); - const [directGrantOpen, setDirectGrantOpen] = useState(false); - - const { control } = useFormContext(); + const [flows, setFlows] = useState([]); useFetch( () => adminClient.authenticationManagement.getFlows(), @@ -44,16 +31,7 @@ export const AuthenticationOverrides = ({ ...flows.filter((flow) => flow.providerId !== "client-flow"), ]; filteredFlows = sortBy(filteredFlows, [(f) => f.alias]); - setFlows([ - - {t("choose")} - , - ...filteredFlows.map((flow) => ( - - {flow.alias} - - )), - ]); + setFlows(filteredFlows); }, [], ); @@ -64,69 +42,31 @@ export const AuthenticationOverrides = ({ fineGrainedAccess={hasConfigureAccess} isHorizontal > - - } - > - ( - - )} - /> - + labelIcon={t("browserFlowHelp")} + controller={{ + defaultValue: "", + }} + options={[ + { key: "", value: t("choose") }, + ...flows.map(({ id, alias }) => ({ key: id!, value: alias! })), + ]} + /> {protocol === "openid-connect" && ( - - } - > - ( - - )} - /> - + labelIcon={t("directGrantHelp")} + controller={{ + defaultValue: "", + }} + options={[ + { key: "", value: t("choose") }, + ...flows.map(({ id, alias }) => ({ key: id!, value: alias! })), + ]} + /> )}