Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
theme.keycloak.v2.admin.resources.assets.CreateFlow-34c2df83.js.map Maven / Gradle / Ivy
Go to download
The user inferface to administrate the Keycloak server.
{"version":3,"file":"CreateFlow-34c2df83.js","sources":["../../src/authentication/form/FlowType.tsx","../../src/authentication/form/CreateFlow.tsx"],"sourcesContent":["import AuthenticationFlowRepresentation from \"@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation\";\nimport {\n FormGroup,\n Select,\n SelectOption,\n SelectVariant,\n} from \"@patternfly/react-core\";\nimport { useState } from \"react\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { HelpItem } from \"ui-shared\";\n\nconst TYPES = [\"basic-flow\", \"client-flow\"] as const;\n\nexport const FlowType = () => {\n const { t } = useTranslation(\"authentication\");\n const { control } = useFormContext();\n const [open, setOpen] = useState(false);\n\n return (\n \n }\n fieldId=\"flowType\"\n >\n (\n {\n field.onChange(value.toString());\n setOpen(false);\n }}\n selections={t(`top-level-flow-type.${field.value}`)}\n variant={SelectVariant.single}\n aria-label={t(\"flowType\")}\n isOpen={open}\n >\n {TYPES.map((type) => (\n \n {t(`top-level-flow-type.${type}`)}\n \n ))}\n \n )}\n />\n \n );\n};\n","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\";\n\nimport { adminClient } 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 { FlowType } from \"./FlowType\";\nimport { NameDescription } from \"./NameDescription\";\n\nexport default function CreateFlow() {\n const { t } = useTranslation(\"authentication\");\n const navigate = useNavigate();\n const { realm } = useRealm();\n const { addAlert } = useAlerts();\n const form = useForm();\n const { handleSubmit } = form;\n\n const onSubmit = async (formValues: AuthenticationFlowRepresentation) => {\n const flow = { ...formValues, builtIn: false, topLevel: true };\n\n try {\n const { id } = await adminClient.authenticationManagement.createFlow(\n flow\n );\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 \n \n {t(\"common:create\")}\n \n (\n \n )}\n >\n {t(\"common:cancel\")}\n \n \n \n \n \n >\n );\n}\n"],"names":["TYPES","FlowType","useTranslation","control","useFormContext","open","setOpen","useState","jsx","FormGroup","HelpItem","Controller","field","Select","_","value","SelectVariant","type","SelectOption","CreateFlow","navigate","useNavigate","realm","useRealm","addAlert","useAlerts","form","useForm","handleSubmit","onSubmit","formValues","flow","id","adminClient","AlertVariant","toFlow","error","jsxs","Fragment","ViewHeader","PageSection","FormProvider","FormAccess","NameDescription","ActionGroup","Button","props","Link","toAuthentication"],"mappings":"0pBAaA,MAAMA,EAAQ,CAAC,aAAc,aAAa,EAE7BC,EAAW,IAAM,CAC5B,KAAM,CAAE,CAAA,EAAMC,EAAe,gBAAgB,EACvC,CAAE,QAAAC,GAAYC,IACd,CAACC,EAAMC,CAAO,EAAIC,WAAS,EAAK,EAGpC,OAAAC,EAAA,IAACC,EAAA,CACC,MAAO,EAAE,UAAU,EACnB,UACED,EAAA,IAACE,EAAA,CACC,SAAU,EAAE,sCAAsC,EAClD,aAAa,y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