theme.keycloak.v2.admin.resources.assets.UserFederationKerberosSettings-CeA77ZYv.js.map Maven / Gradle / Ivy
{"version":3,"file":"UserFederationKerberosSettings-CeA77ZYv.js","sources":["../../src/user-federation/kerberos/KerberosSettingsRequired.tsx","../../src/user-federation/UserFederationKerberosSettings.tsx"],"sourcesContent":["import {\n HelpItem,\n SelectControl,\n TextControl,\n} from \"@keycloak/keycloak-ui-shared\";\nimport { FormGroup, Switch } from \"@patternfly/react-core\";\nimport { isEqual } from \"lodash-es\";\nimport { useEffect } from \"react\";\nimport {\n Controller,\n FormProvider,\n UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { WizardSectionHeader } from \"../../components/wizard-section-header/WizardSectionHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\n\nexport type KerberosSettingsRequiredProps = {\n form: UseFormReturn;\n showSectionHeading?: boolean;\n showSectionDescription?: boolean;\n};\n\nexport const KerberosSettingsRequired = ({\n form,\n showSectionHeading = false,\n showSectionDescription = false,\n}: KerberosSettingsRequiredProps) => {\n const { t } = useTranslation();\n const { realm, realmRepresentation } = useRealm();\n\n const allowPassAuth = useWatch({\n control: form.control,\n name: \"config.allowPasswordAuthentication\",\n });\n\n useEffect(() => form.setValue(\"parentId\", realmRepresentation?.id), []);\n\n return (\n \n {showSectionHeading && (\n \n )}\n\n {/* Required settings */}\n \n {/* These hidden fields are required so data object written back matches data retrieved */}\n \n \n \n \n \n \n \n \n }\n fieldId=\"kc-debug\"\n hasNoPaddingTop\n >\n (\n field.onChange([`${value}`])}\n isChecked={field.value?.[0] === \"true\"}\n label={t(\"on\")}\n labelOff={t(\"off\")}\n aria-label={t(\"debug\")}\n />\n )}\n />\n \n \n }\n fieldId=\"kc-allow-password-authentication\"\n hasNoPaddingTop\n >\n (\n field.onChange([`${value}`])}\n isChecked={field.value?.[0] === \"true\"}\n label={t(\"on\")}\n labelOff={t(\"off\")}\n aria-label={t(\"allowPasswordAuthentication\")}\n />\n )}\n />\n \n {isEqual(allowPassAuth, [\"true\"]) ? (\n \n ) : null}\n \n }\n fieldId=\"kc-update-first-login\"\n hasNoPaddingTop\n >\n (\n field.onChange([`${value}`])}\n isChecked={field.value?.[0] === \"true\"}\n label={t(\"on\")}\n labelOff={t(\"off\")}\n aria-label={t(\"updateFirstLogin\")}\n />\n )}\n />\n \n \n \n );\n};\n","import type ComponentRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/componentRepresentation\";\nimport {\n ActionGroup,\n AlertVariant,\n Button,\n Form,\n PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigate } from \"react-router-dom\";\nimport { useAdminClient } from \"../admin-client\";\nimport { useAlerts } from \"../components/alert/Alerts\";\nimport { useRealm } from \"../context/realm-context/RealmContext\";\nimport { useFetch } from \"../utils/useFetch\";\nimport { useParams } from \"../utils/useParams\";\nimport { KerberosSettingsRequired } from \"./kerberos/KerberosSettingsRequired\";\nimport { toUserFederation } from \"./routes/UserFederation\";\nimport { Header } from \"./shared/Header\";\nimport { SettingsCache } from \"./shared/SettingsCache\";\n\nexport default function UserFederationKerberosSettings() {\n const { adminClient } = useAdminClient();\n\n const { t } = useTranslation();\n const form = useForm({ mode: \"onChange\" });\n const navigate = useNavigate();\n const { realm } = useRealm();\n\n const { id } = useParams<{ id?: string }>();\n\n const { addAlert, addError } = useAlerts();\n\n useFetch(\n async () => {\n if (id) {\n return adminClient.components.findOne({ id });\n }\n },\n (fetchedComponent) => {\n if (fetchedComponent) {\n setupForm(fetchedComponent);\n } else if (id) {\n throw new Error(t(\"notFound\"));\n }\n },\n [],\n );\n\n const setupForm = (component: ComponentRepresentation) => {\n form.reset({ ...component });\n };\n\n const save = async (component: ComponentRepresentation) => {\n try {\n if (!id) {\n await adminClient.components.create(component);\n navigate(`/${realm}/user-federation`);\n } else {\n await adminClient.components.update({ id }, component);\n }\n setupForm(component as ComponentRepresentation);\n addAlert(\n t(!id ? \"createUserProviderSuccess\" : \"userProviderSaveSuccess\"),\n AlertVariant.success,\n );\n } catch (error) {\n addError(\n !id ? \"createUserProviderError\" : \"userProviderSaveError\",\n error,\n );\n }\n };\n\n return (\n \n form.handleSubmit(save)()} />\n \n \n \n \n \n \n \n \n );\n}\n"],"names":["KerberosSettingsRequired","form","showSectionHeading","showSectionDescription","t","useTranslation","realm","realmRepresentation","useRealm","allowPassAuth","useWatch","useEffect","jsxs","FormProvider","jsx","WizardSectionHeader","FormAccess","TextControl","FormGroup","HelpItem","Controller","field","Switch","_event","value","isEqual","SelectControl","UserFederationKerberosSettings","adminClient","useAdminClient","useForm","navigate","useNavigate","id","useParams","addAlert","addError","useAlerts","useFetch","fetchedComponent","setupForm","component","save","AlertVariant","error","Header","PageSection","SettingsCache","Form","ActionGroup","Button","toUserFederation"],"mappings":"qmBAyBO,MAAMA,EAA2B,CAAC,CACvC,KAAAC,EACA,mBAAAC,EAAqB,GACrB,uBAAAC,EAAyB,EAC3B,IAAqC,CAC7B,KAAA,CAAE,EAAAC,GAAMC,IACR,CAAE,MAAAC,EAAO,oBAAAC,CAAoB,EAAIC,EAAS,EAE1CC,EAAgBC,EAAS,CAC7B,QAAST,EAAK,QACd,KAAM,oCAAA,CACP,EAES,OAAAU,EAAA,IAAMV,EAAK,SAAS,WAAYM,GAAqB,EAAE,EAAG,CAAA,CAAE,EAGpEK,EAACC,EAAc,CAAA,GAAGZ,EACf,SAAA,CACCC,GAAAY,EAACC,EAAA,CACC,MAAOX,EAAE,kBAAkB,EAC3B,YAAaA,EAAE,qCAAqC,EACpD,gBAAiBD,CAAA,CACnB,EAIDS,EAAAI,EAAA,CAAW,KAAK,eAAe,aAAY,GAE1C,SAAA,CAAAF,EAAC,QAAA,CACC,KAAK,SACL,aAAa,WACZ,GAAGb,EAAK,SAAS,YAAY,CAAA,CAChC,EACAa,EAAC,QAAA,CACC,KAAK,SACL,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