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

theme.keycloak.v2.admin.resources.assets.CreateFlow-34c2df83.js Maven / Gradle / Ivy

There is a newer version: 25.0.1
Show newest version
import{u as d,a as f,r as x,j as e,F as w,h as j,C as g,b as F,c as v,d as b,e as S,P as y,f as T,B as m,L as A,t as C,g as I,A as p,i as L}from"./index-0cda761d.js";import{F as V}from"./FormAccess-835af982.js";import{V as E}from"./ViewHeader-ff389f8e.js";import{S as P,a as B,b as N}from"./Select-68736f55.js";import{N as O}from"./NameDescription-c11e0880.js";import{A as k}from"./Form-4087ddae.js";import"./copy-icon-b8d617db.js";import"./GridItem-1535d986.js";import"./Text-b9444fb8.js";import"./ToolbarContent-fee3570e.js";import"./check-fc57dbe1.js";import"./star-icon-2ee5dfa7.js";import"./KeycloakTextArea-9049d04c.js";import"./KeycloakTextInput-ada01047.js";const u=["basic-flow","client-flow"],z=()=>{const{t}=d("authentication"),{control:i}=f(),[n,s]=x.useState(!1);return e.jsx(w,{label:t("flowType"),labelIcon:e.jsx(j,{helpText:t("authentication-help:topLevelFlowType"),fieldLabelId:"authentication:flowType"}),fieldId:"flowType",children:e.jsx(g,{name:"providerId",defaultValue:u[0],control:i,render:({field:a})=>e.jsx(P,{toggleId:"flowType",onToggle:s,onSelect:(o,l)=>{a.onChange(l.toString()),s(!1)},selections:t(`top-level-flow-type.${a.value}`),variant:B.single,"aria-label":t("flowType"),isOpen:n,children:u.map(o=>e.jsx(N,{selected:o===a.value,value:o,children:t(`top-level-flow-type.${o}`)},o))})})})};function X(){const{t}=d("authentication"),i=F(),{realm:n}=v(),{addAlert:s}=b(),a=S(),{handleSubmit:o}=a,l=async c=>{const h={...c,builtIn:!1,topLevel:!0};try{const{id:r}=await I.authenticationManagement.createFlow(h);s(t("flowCreatedSuccess"),p.success),i(L({realm:n,id:r,usedBy:"notInUse"}))}catch(r){s(t("flowCreateError",{error:r.response?.data?.errorMessage||r}),p.danger)}};return e.jsxs(e.Fragment,{children:[e.jsx(E,{titleKey:"authentication:createFlow",subKey:"authentication-help:createFlow"}),e.jsx(y,{variant:"light",children:e.jsx(T,{...a,children:e.jsxs(V,{isHorizontal:!0,role:"manage-authorization",onSubmit:o(l),children:[e.jsx(O,{}),e.jsx(z,{}),e.jsxs(k,{children:[e.jsx(m,{"data-testid":"create",type:"submit",children:t("common:create")}),e.jsx(m,{"data-testid":"cancel",variant:"link",component:c=>e.jsx(A,{...c,to:C({realm:n})}),children:t("common:cancel")})]})]})})})]})}export{X as default};
//# sourceMappingURL=CreateFlow-34c2df83.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy