/* eslint-disable */ // @ts-nocheck import { HelpItem, SelectControl, TextControl, } from "../../../shared/keycloak-ui-shared"; import { FormGroup, Switch } from "../../../shared/@patternfly/react-core"; import { isEqual } from "lodash-es"; import { useEffect } from "react"; import { Controller, FormProvider, UseFormReturn, useWatch, } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { FormAccess } from "../../components/form/FormAccess"; import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader"; import { useRealm } from "../../context/realm-context/RealmContext"; export type KerberosSettingsRequiredProps = { form: UseFormReturn; showSectionHeading?: boolean; showSectionDescription?: boolean; }; export const KerberosSettingsRequired = ({ form, showSectionHeading = false, showSectionDescription = false, }: KerberosSettingsRequiredProps) => { const { t } = useTranslation(); const { realm, realmRepresentation } = useRealm(); const allowPassAuth = useWatch({ control: form.control, name: "config.allowPasswordAuthentication", }); useEffect(() => form.setValue("parentId", realmRepresentation.id), []); return ( {showSectionHeading && ( )} {/* Required settings */} {/* These hidden fields are required so data object written back matches data retrieved */} } fieldId="kc-debug" hasNoPaddingTop > ( field.onChange([`${value}`])} isChecked={field.value?.[0] === "true"} label={t("on")} labelOff={t("off")} aria-label={t("debug")} /> )} /> } fieldId="kc-allow-password-authentication" hasNoPaddingTop > ( field.onChange([`${value}`])} isChecked={field.value?.[0] === "true"} label={t("on")} labelOff={t("off")} aria-label={t("allowPasswordAuthentication")} /> )} /> {isEqual(allowPassAuth, ["true"]) ? ( ) : null} } fieldId="kc-update-first-login" hasNoPaddingTop > ( field.onChange([`${value}`])} isChecked={field.value?.[0] === "true"} label={t("on")} labelOff={t("off")} aria-label={t("updateFirstLogin")} /> )} /> ); };