From 3cc2517ae4cea378fc4cfae6c2487d816c8bb0f9 Mon Sep 17 00:00:00 2001 From: Douglas Palmer Date: Tue, 24 Jan 2023 14:22:36 -0800 Subject: [PATCH] Align new admin console with the 'KERBEROS' feature (#4249) --- apps/admin-ui/src/user-federation/UserFederationLdapForm.tsx | 4 ++++ .../admin-ui/src/user-federation/UserFederationLdapWizard.tsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/admin-ui/src/user-federation/UserFederationLdapForm.tsx b/apps/admin-ui/src/user-federation/UserFederationLdapForm.tsx index 8c38115cc4..4544badfb9 100644 --- a/apps/admin-ui/src/user-federation/UserFederationLdapForm.tsx +++ b/apps/admin-ui/src/user-federation/UserFederationLdapForm.tsx @@ -14,6 +14,7 @@ import { LdapSettingsSearching } from "./ldap/LdapSettingsSearching"; import { LdapSettingsSynchronization } from "./ldap/LdapSettingsSynchronization"; import { toUserFederation } from "./routes/UserFederation"; import { SettingsCache } from "./shared/SettingsCache"; +import { useServerInfo } from "../context/server-info/ServerInfoProvider"; export type LdapComponentRepresentation = ComponentRepresentation & { config?: { @@ -35,6 +36,8 @@ export const UserFederationLdapForm = ({ const form = useFormContext(); const navigate = useNavigate(); const { realm } = useRealm(); + const kerberosDisabled = + useServerInfo().profileInfo?.disabledFeatures?.includes("KERBEROS"); return ( <> @@ -59,6 +62,7 @@ export const UserFederationLdapForm = ({ { title: t("kerberosIntegration"), panel: , + isHidden: kerberosDisabled, }, { title: t("cacheSettings"), panel: }, { diff --git a/apps/admin-ui/src/user-federation/UserFederationLdapWizard.tsx b/apps/admin-ui/src/user-federation/UserFederationLdapWizard.tsx index 90e7199028..85e8a4ef09 100644 --- a/apps/admin-ui/src/user-federation/UserFederationLdapWizard.tsx +++ b/apps/admin-ui/src/user-federation/UserFederationLdapWizard.tsx @@ -16,10 +16,13 @@ import { useTranslation } from "react-i18next"; import type ComponentRepresentation from "@keycloak/keycloak-admin-client/lib/defs/componentRepresentation"; import { useForm } from "react-hook-form"; +import { useServerInfo } from "../context/server-info/ServerInfoProvider"; export const UserFederationLdapWizard = () => { const form = useForm(); const { t } = useTranslation("user-federation"); + const kerberosDisabled = + useServerInfo().profileInfo?.disabledFeatures?.includes("KERBEROS"); const steps = [ { @@ -76,6 +79,7 @@ export const UserFederationLdapWizard = () => { showSectionDescription /> ), + isDisabled: kerberosDisabled, }, { name: t("cacheSettings"),