import { useTranslation } from "react-i18next"; import { useFormContext } from "react-hook-form"; import { Form } from "@patternfly/react-core"; import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation"; import { ScrollForm } from "../components/scroll-form/ScrollForm"; import { ClientDescription } from "./ClientDescription"; import { CapabilityConfig } from "./add/CapabilityConfig"; import { SamlConfig } from "./add/SamlConfig"; import { SamlSignature } from "./add/SamlSignature"; import { AccessSettings } from "./add/AccessSettings"; import { LoginSettingsPanel } from "./add/LoginSettingsPanel"; import { LogoutPanel } from "./add/LogoutPanel"; import { FormFields } from "./ClientDetails"; export type ClientSettingsProps = { client: ClientRepresentation; save: () => void; reset: () => void; }; export const ClientSettings = (props: ClientSettingsProps) => { const { t } = useTranslation(); const { watch } = useFormContext(); const protocol = watch("protocol"); const { client } = props; return ( ), }, { title: t("accessSettings"), panel: , }, { title: t("samlCapabilityConfig"), isHidden: protocol !== "saml" || client.bearerOnly, panel: , }, { title: t("signatureAndEncryption"), isHidden: protocol !== "saml" || client.bearerOnly, panel: , }, { title: t("capabilityConfig"), isHidden: protocol !== "openid-connect" || client.bearerOnly, panel: , }, { title: t("loginSettings"), isHidden: client.bearerOnly, panel: , }, { title: t("logoutSettings"), isHidden: client.bearerOnly, panel: , }, ]} /> ); };