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

theme.keycloak.v2.admin.resources.assets.CreateUser-DBawB1Ij.js Maven / Gradle / Ivy

import{jsx as a,jsxs as w,Fragment as C}from"react/jsx-runtime";import{u as b,a as A,f as F,d as x,c as y,g as E,w as P,a3 as V,P as k,k as G,bx as N,em as R,en as S}from"./main-C7ps2lmX.js";import{useState as d}from"react";import{V as j}from"./ViewHeader-B7eeFzFA.js";import{U as K,t as M}from"./UserForm-PSfSn7pK.js";/* empty css                     */import"react-dom";import"./SwitchControl-C_9Y74oV.js";import"./FormAccess-DyLNkc18.js";import"./copy-icon-ACZmDH8e.js";import"./GroupPickerDialog-C09EjRTA.js";import"./PaginatingTableToolbar-Cjsz5Jh4.js";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";import"./DataListItemRow-BC0LurDd.js";import"./useFormatDate-X7HJ5iYO.js";function $(){const{adminClient:n}=b(),{t:r}=A(),{addAlert:l,addError:u}=F(),p=x(),{realm:m,realmRepresentation:s}=y(),o=E({mode:"onChange"}),[f,g]=d([]),[c,h]=d();P(()=>n.users.getProfileMetadata({realm:m}),t=>{if(!t)throw new Error(r("notFound"));o.setValue("attributes.locale",s?.defaultLocale||""),h(t)},[]);const U=async t=>{try{const e=await n.users.create({...M(t),groups:f.map(i=>i.path),enabled:!0});l(r("userCreated"),G.success),p(N({id:e.id,realm:m,tab:"settings"}))}catch(e){R(e)?S(e,o.setError,(i,v)=>r(i,v)):u("userCreateError",e)}};return!s||!c?a(V,{}):w(C,{children:[a(j,{titleKey:r("createUser"),className:"kc-username-view-header"}),a(k,{variant:"light",children:a(K,{form:o,realm:s,userProfileMetadata:c,onGroupsUpdate:g,save:U})})]})}export{$ as default};
//# sourceMappingURL=CreateUser-DBawB1Ij.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy