Align new admin console with the 'KERBEROS' feature (#4249)

This commit is contained in:
Douglas Palmer 2023-01-24 14:22:36 -08:00 committed by GitHub
parent 441ba1e8b0
commit 3cc2517ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import { LdapSettingsSearching } from "./ldap/LdapSettingsSearching";
import { LdapSettingsSynchronization } from "./ldap/LdapSettingsSynchronization"; import { LdapSettingsSynchronization } from "./ldap/LdapSettingsSynchronization";
import { toUserFederation } from "./routes/UserFederation"; import { toUserFederation } from "./routes/UserFederation";
import { SettingsCache } from "./shared/SettingsCache"; import { SettingsCache } from "./shared/SettingsCache";
import { useServerInfo } from "../context/server-info/ServerInfoProvider";
export type LdapComponentRepresentation = ComponentRepresentation & { export type LdapComponentRepresentation = ComponentRepresentation & {
config?: { config?: {
@ -35,6 +36,8 @@ export const UserFederationLdapForm = ({
const form = useFormContext<LdapComponentRepresentation>(); const form = useFormContext<LdapComponentRepresentation>();
const navigate = useNavigate(); const navigate = useNavigate();
const { realm } = useRealm(); const { realm } = useRealm();
const kerberosDisabled =
useServerInfo().profileInfo?.disabledFeatures?.includes("KERBEROS");
return ( return (
<> <>
@ -59,6 +62,7 @@ export const UserFederationLdapForm = ({
{ {
title: t("kerberosIntegration"), title: t("kerberosIntegration"),
panel: <LdapSettingsKerberosIntegration form={form} />, panel: <LdapSettingsKerberosIntegration form={form} />,
isHidden: kerberosDisabled,
}, },
{ title: t("cacheSettings"), panel: <SettingsCache form={form} /> }, { title: t("cacheSettings"), panel: <SettingsCache form={form} /> },
{ {

View file

@ -16,10 +16,13 @@ import { useTranslation } from "react-i18next";
import type ComponentRepresentation from "@keycloak/keycloak-admin-client/lib/defs/componentRepresentation"; import type ComponentRepresentation from "@keycloak/keycloak-admin-client/lib/defs/componentRepresentation";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { useServerInfo } from "../context/server-info/ServerInfoProvider";
export const UserFederationLdapWizard = () => { export const UserFederationLdapWizard = () => {
const form = useForm<ComponentRepresentation>(); const form = useForm<ComponentRepresentation>();
const { t } = useTranslation("user-federation"); const { t } = useTranslation("user-federation");
const kerberosDisabled =
useServerInfo().profileInfo?.disabledFeatures?.includes("KERBEROS");
const steps = [ const steps = [
{ {
@ -76,6 +79,7 @@ export const UserFederationLdapWizard = () => {
showSectionDescription showSectionDescription
/> />
), ),
isDisabled: kerberosDisabled,
}, },
{ {
name: t("cacheSettings"), name: t("cacheSettings"),