import { Button, Wizard, WizardContextConsumer, WizardFooter, } from "@patternfly/react-core"; import { LdapSettingsGeneral } from "./ldap/LdapSettingsGeneral"; import { LdapSettingsConnection } from "./ldap/LdapSettingsConnection"; import { LdapSettingsSearching } from "./ldap/LdapSettingsSearching"; import { LdapSettingsSynchronization } from "./ldap/LdapSettingsSynchronization"; import { LdapSettingsKerberosIntegration } from "./ldap/LdapSettingsKerberosIntegration"; import { SettingsCache } from "./shared/SettingsCache"; import { LdapSettingsAdvanced } from "./ldap/LdapSettingsAdvanced"; import { useTranslation } from "react-i18next"; import type ComponentRepresentation from "@keycloak/keycloak-admin-client/lib/defs/componentRepresentation"; import { useForm } from "react-hook-form"; export const UserFederationLdapWizard = () => { const form = useForm(); const { t } = useTranslation("user-federation"); const steps = [ { name: t("requiredSettings"), id: "ldapRequiredSettingsStep", component: ( ), }, { name: t("connectionAndAuthenticationSettings"), id: "ldapConnectionSettingsStep", component: ( ), }, { name: t("ldapSearchingAndUpdatingSettings"), id: "ldapSearchingSettingsStep", component: ( ), }, { name: t("synchronizationSettings"), id: "ldapSynchronizationSettingsStep", component: ( ), }, { name: t("kerberosIntegration"), id: "ldapKerberosIntegrationSettingsStep", component: ( ), }, { name: t("cacheSettings"), id: "ldapCacheSettingsStep", component: ( ), }, { name: t("advancedSettings"), id: "ldapAdvancedSettingsStep", component: ( ), }, ]; const footer = ( {({ activeStep, onNext, onBack, onClose }) => { // First step buttons if (activeStep.id === "ldapRequiredSettingsStep") { return ( <> ); } // Other required step buttons else if ( activeStep.id === "ldapConnectionSettingsStep" || activeStep.id === "ldapSearchingSettingsStep" ) { return ( <> ); } // Last step buttons else if (activeStep.id === "ldapAdvancedSettingsStep") { return ( <> {/* TODO: close the wizard and finish */} ); } // All the other steps buttons return ( <> {/* TODO: validate last step and finish */} ); }} ); return ( ); };