@keycloakify/keycloak-admin-ui
Version:
Repackaged Keycloak Admin UI
33 lines • 4.01 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button, useWizardContext, Wizard, WizardFooter, WizardFooterWrapper, WizardStep, } from "@patternfly/react-core";
import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next";
import useIsFeatureEnabled, { Feature } from "../utils/useIsFeatureEnabled";
import { LdapSettingsAdvanced } from "../user-federation/ldap/LdapSettingsAdvanced";
import { LdapSettingsConnection } from "../user-federation/ldap/LdapSettingsConnection";
import { LdapSettingsGeneral } from "../user-federation/ldap/LdapSettingsGeneral";
import { LdapSettingsKerberosIntegration } from "../user-federation/ldap/LdapSettingsKerberosIntegration";
import { LdapSettingsSearching } from "../user-federation/ldap/LdapSettingsSearching";
import { LdapSettingsSynchronization } from "../user-federation/ldap/LdapSettingsSynchronization";
import { SettingsCache } from "../user-federation/shared/SettingsCache";
const UserFedLdapFooter = () => {
const { t } = useTranslation();
const { activeStep, goToNextStep, goToPrevStep, close } = useWizardContext();
return (_jsx(WizardFooter, { activeStep: activeStep, onNext: goToNextStep, onBack: goToPrevStep, onClose: close, isBackDisabled: activeStep.index === 1, backButtonText: t("back"), nextButtonText: t("next"), cancelButtonText: t("cancel") }));
};
const SkipCustomizationFooter = () => {
const { goToNextStep, goToPrevStep, close } = useWizardContext();
const { t } = useTranslation();
return (_jsxs(WizardFooterWrapper, { children: [_jsx(Button, { variant: "secondary", onClick: goToPrevStep, children: t("back") }), _jsx(Button, { variant: "primary", type: "submit", onClick: goToNextStep, children: t("next") }), _jsx(Button, { variant: "link", children: t("skipCustomizationAndFinish") }), _jsx(Button, { variant: "link", onClick: close, children: t("cancel") })] }));
};
export const UserFederationLdapWizard = () => {
const form = useForm();
const { t } = useTranslation();
const isFeatureEnabled = useIsFeatureEnabled();
return (_jsxs(Wizard, { height: "100%", footer: _jsx(UserFedLdapFooter, {}), children: [_jsx(WizardStep, { name: t("requiredSettings"), id: "ldapRequiredSettingsStep", children: _jsx(LdapSettingsGeneral, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("connectionAndAuthenticationSettings"), id: "ldapConnectionSettingsStep", children: _jsx(LdapSettingsConnection, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("ldapSearchingAndUpdatingSettings"), id: "ldapSearchingSettingsStep", children: _jsx(LdapSettingsSearching, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("synchronizationSettings"), id: "ldapSynchronizationSettingsStep", footer: _jsx(SkipCustomizationFooter, {}), children: _jsx(LdapSettingsSynchronization, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("kerberosIntegration"), id: "ldapKerberosIntegrationSettingsStep", isDisabled: !isFeatureEnabled(Feature.Kerberos), footer: _jsx(SkipCustomizationFooter, {}), children: _jsx(LdapSettingsKerberosIntegration, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("cacheSettings"), id: "ldapCacheSettingsStep", footer: _jsx(SkipCustomizationFooter, {}), children: _jsx(SettingsCache, { form: form, showSectionHeading: true, showSectionDescription: true }) }), _jsx(WizardStep, { name: t("advancedSettings"), id: "ldapAdvancedSettingsStep", footer: {
backButtonText: t("back"),
nextButtonText: t("finish"),
cancelButtonText: t("cancel"),
}, children: _jsx(LdapSettingsAdvanced, { form: form, showSectionHeading: true, showSectionDescription: true }) })] }));
};
//# sourceMappingURL=UserFederationLdapWizard.js.map