0dc3f08917
* initial save cancel logic * cleanup work after merge * move form logic up to parent * save working * update messages * no longer need to pass in save from children * pass form into wizard to fix build errors * fix lint fmt issue * add simple field validation and error prevention * localize validation strings * fix default value issues * localize default value
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Wizard } from "@patternfly/react-core";
|
|
import { useTranslation } from "react-i18next";
|
|
import React from "react";
|
|
import { KerberosSettingsRequired } from "./kerberos/KerberosSettingsRequired";
|
|
import { KerberosSettingsCache } from "./kerberos/KerberosSettingsCache";
|
|
import ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation";
|
|
import { useForm } from "react-hook-form";
|
|
|
|
export const UserFederationKerberosWizard = () => {
|
|
const { t } = useTranslation("user-federation");
|
|
const form = useForm<ComponentRepresentation>({ mode: "onChange" });
|
|
|
|
const steps = [
|
|
{
|
|
name: t("requiredSettings"),
|
|
component: (
|
|
<KerberosSettingsRequired
|
|
form={form}
|
|
showSectionHeading
|
|
showSectionDescription
|
|
/>
|
|
),
|
|
},
|
|
{
|
|
name: t("cacheSettings"),
|
|
component: (
|
|
<KerberosSettingsCache
|
|
form={form}
|
|
showSectionHeading
|
|
showSectionDescription
|
|
/>
|
|
),
|
|
nextButtonText: t("common:finish"), // TODO: needs to disable until cache policy is valid
|
|
},
|
|
];
|
|
|
|
return (
|
|
<Wizard
|
|
// Because this is an inline wizard, this title and description should be put into the page. Specifying them here causes the wizard component to make a header that would be used on a modal.
|
|
// title={t("addKerberosWizardTitle")}
|
|
// description={helpText("addKerberosWizardDescription")}
|
|
steps={steps}
|
|
/>
|
|
);
|
|
};
|