2021-01-04 21:33:18 +00:00
import { Wizard } from "@patternfly/react-core" ;
2020-11-18 16:18:32 +00:00
import { useTranslation } from "react-i18next" ;
import React from "react" ;
2021-01-04 21:33:18 +00:00
import { KerberosSettingsRequired } from "./kerberos/KerberosSettingsRequired" ;
2021-02-11 20:51:51 +00:00
import { SettingsCache } from "./shared/SettingsCache" ;
2021-05-04 17:58:18 +00:00
import type ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation" ;
2021-01-22 20:15:32 +00:00
import { useForm } from "react-hook-form" ;
2020-11-18 16:18:32 +00:00
export const UserFederationKerberosWizard = ( ) = > {
const { t } = useTranslation ( "user-federation" ) ;
2021-01-22 20:15:32 +00:00
const form = useForm < ComponentRepresentation > ( { mode : "onChange" } ) ;
2020-11-18 16:18:32 +00:00
const steps = [
2020-12-15 22:50:09 +00:00
{
2021-01-04 21:33:18 +00:00
name : t ( "requiredSettings" ) ,
component : (
2021-01-22 20:15:32 +00:00
< KerberosSettingsRequired
form = { form }
showSectionHeading
showSectionDescription
/ >
2021-01-04 21:33:18 +00:00
) ,
} ,
{
name : t ( "cacheSettings" ) ,
component : (
2021-02-11 20:51:51 +00:00
< SettingsCache form = { form } showSectionHeading showSectionDescription / >
2021-01-04 21:33:18 +00:00
) ,
nextButtonText : t ( "common:finish" ) , // TODO: needs to disable until cache policy is valid
2020-12-15 22:50:09 +00:00
} ,
2020-11-18 16:18:32 +00:00
] ;
return (
< Wizard
2021-01-05 16:08:43 +00:00
// 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")}
2020-11-18 16:18:32 +00:00
steps = { steps }
/ >
) ;
} ;