All Downloads are FREE. Search and download functionalities are using the official Maven repository.

theme.keycloak.v2.admin.resources.assets.CreateFlow-Jjlzqfdt.js.map Maven / Gradle / Ivy

{"version":3,"file":"CreateFlow-Jjlzqfdt.js","sources":["../../src/authentication/form/CreateFlow.tsx"],"sourcesContent":["import type AuthenticationFlowRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation\";\nimport {\n  ActionGroup,\n  AlertVariant,\n  Button,\n  PageSection,\n} from \"@patternfly/react-core\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { FormSubmitButton, SelectControl } from \"@keycloak/keycloak-ui-shared\";\nimport { useAdminClient } from \"../../admin-client\";\nimport { useAlerts } from \"../../components/alert/Alerts\";\nimport { FormAccess } from \"../../components/form/FormAccess\";\nimport { ViewHeader } from \"../../components/view-header/ViewHeader\";\nimport { useRealm } from \"../../context/realm-context/RealmContext\";\nimport { toAuthentication } from \"../routes/Authentication\";\nimport { toFlow } from \"../routes/Flow\";\nimport { NameDescription } from \"./NameDescription\";\n\nconst TYPES = [\"basic-flow\", \"client-flow\"] as const;\n\nexport default function CreateFlow() {\n  const { adminClient } = useAdminClient();\n\n  const { t } = useTranslation();\n  const navigate = useNavigate();\n  const { realm } = useRealm();\n  const { addAlert } = useAlerts();\n  const form = useForm();\n  const { handleSubmit, formState } = form;\n\n  const onSubmit = async (formValues: AuthenticationFlowRepresentation) => {\n    const flow = { ...formValues, builtIn: false, topLevel: true };\n\n    try {\n      const { id } =\n        await adminClient.authenticationManagement.createFlow(flow);\n      addAlert(t(\"flowCreatedSuccess\"), AlertVariant.success);\n      navigate(\n        toFlow({\n          realm,\n          id: id!,\n          usedBy: \"notInUse\",\n        }),\n      );\n    } catch (error: any) {\n      addAlert(\n        t(\"flowCreateError\", {\n          error: error.response?.data?.errorMessage || error,\n        }),\n        AlertVariant.danger,\n      );\n    }\n  };\n\n  return (\n    <>\n      \n      \n        \n          \n            \n             ({\n                key: type,\n                value: t(`top-level-flow-type.${type}`),\n              }))}\n            />\n            \n              \n                {t(\"create\")}\n              \n               (\n                  \n                )}\n              >\n                {t(\"cancel\")}\n              \n            \n          \n        \n      \n    \n  );\n}\n"],"names":["TYPES","CreateFlow","adminClient","useAdminClient","t","useTranslation","navigate","useNavigate","realm","useRealm","addAlert","useAlerts","form","useForm","handleSubmit","formState","jsxs","Fragment","jsx","ViewHeader","PageSection","FormProvider","FormAccess","formValues","flow","id","AlertVariant","toFlow","error","NameDescription","SelectControl","type","ActionGroup","FormSubmitButton","Button","props","Link","toAuthentication"],"mappings":"mZAoBA,MAAMA,EAAQ,CAAC,aAAc,aAAa,EAE1C,SAAwBC,GAAa,CAC7B,KAAA,CAAE,YAAAC,GAAgBC,IAElB,CAAE,EAAAC,GAAMC,IACRC,EAAWC,IACX,CAAE,MAAAC,GAAUC,IACZ,CAAE,SAAAC,GAAaC,IACfC,EAAOC,IACP,CAAE,aAAAC,EAAc,UAAAC,CAAc,EAAAH,EA0BpC,OAEII,EAAAC,EAAA,CAAA,SAAA,CAAAC,EAACC,EAAW,CAAA,SAAS,aAAa,OAAO,+BAA+B,IACvEC,EAAY,CAAA,QAAQ,QACnB,SAACF,EAAAG,EAAA,CAAc,GAAGT,EAChB,SAAAI,EAACM,EAAA,CACC,aAAY,GACZ,KAAK,uBACL,SAAUR,EAhCH,MAAOS,GAAiD,CACvE,MAAMC,EAAO,CAAE,GAAGD,EAAY,QAAS,GAAO,SAAU,IAEpD,GAAA,CACF,KAAM,CAAE,GAAAE,CAAG,EACT,MAAMvB,EAAY,yBAAyB,WAAWsB,CAAI,EAC5Dd,EAASN,EAAE,oBAAoB,EAAGsB,EAAa,OAAO,EACtDpB,EACEqB,EAAO,CACL,MAAAnB,EACA,GAAAiB,EACA,OAAQ,UAAA,CACT,CAAA,QAEIG,EAAY,CACnBlB,EACEN,EAAE,kBAAmB,CACnB,MAAOwB,EAAM,UAAU,MAAM,c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