theme.keycloak.v2.admin.resources.assets.UserFederationLdapSettings-BZOwKGoF.js Maven / Gradle / Ivy
import{jsxs as M,Fragment as R,jsx as e}from"react/jsx-runtime";import{useState as m}from"react";import{u as A,d as I,a as K,f as k,s as U,e as E,v as w,B as V,j as x,a2 as j,h as N,L as B,w as z,g as H,c as O,a3 as q,F as G,P as F,ei as T,ej as C}from"./index-C1LIsRX7.js";import{R as J,u as Q}from"./RoutableTabs-j5CUH0-6.js";import{U as W,s as X}from"./UserFederationLdapForm-B4hjuDFF.js";import{u as Y}from"./ConfirmDialog-B5qjiAuo.js";import{L as Z}from"./PaginatingTableToolbar-CpMLQtqt.js";import{K as _}from"./KeycloakDataTable-jyvvxdb8.js";import{E as $}from"./ExtendedHeader-Ciknl9tt.js";import{a as P,b as D}from"./Tabs-CNBvRApH.js";import"react-dom";import"./PageHandler-CFMh3rCu.js";import"./DynamicComponents-CIZcko9u.js";import"./ClientSelect-BTkwOwGP.js";import"./FileUpload-T43Q4AfB.js";import"./CodeEditor-CIeIZGz7.js";import"./copy-icon-DOS8MmN7.js";import"./EmptyStateFooter-Cm2IMTi1.js";import"./EmptyStateActions-DBSnfkAA.js";import"./GroupPickerDialog-DmX3SBxL.js";import"./DataListItemRow-COCiEHyF.js";import"./FlexItem-DCAd8FXq.js";import"./KeySelect-B2uWUd6C.js";import"./useToggle-K3Kx99tM.js";import"./MultiLineInput-AcwuO_FT.js";import"./AddRoleMappingModal-Ds4yp8lg.js";import"./filter-icon-BVyMUArZ.js";import"./Td-BwjBKSkH.js";import"./grip-vertical-icon-Bnn0MebT.js";import"./ViewHeader-qjLr6U82.js";import"./useParams-n_2fXkN1.js";import"./PageList-D9zZFEpa.js";import"./_baseFlatten-BHAcGTxk.js";import"./FormAccess-BcY70QlP.js";import"./SettingsCache-M0OqK1Pn.js";import"./isEqual-DmIBnf3S.js";const ee=({toDetail:i,...o})=>e(B,{to:i(o.id),children:o.name}),te=({toCreate:i,toDetail:o})=>{const{adminClient:s}=A(),n=I(),{t:r}=K(),{addAlert:g,addError:f}=k(),[p,y]=m(0),h=()=>y(p+1),[b,S]=m([]),d=U(),{id:L}=E(),[c,l]=m();w(()=>s.components.find({parent:L,type:"org.keycloak.storage.ldap.mappers.LDAPStorageMapper"}),a=>{S(d(a.map(v=>({...v,name:v.name,type:v.providerId})),z("name")))},[p]);const[u,t]=Y({titleKey:r("deleteMappingTitle",{mapperId:c?.id}),messageKey:"deleteMappingConfirm",continueButtonLabel:"delete",continueButtonVariant:V.danger,onConfirm:async()=>{try{await s.components.del({id:c.id}),h(),g(r("mappingDeletedSuccess"),x.success),l(void 0)}catch(a){f("mappingDeletedError",a)}}});return M(R,{children:[e(t,{}),e(_,{loader:b,ariaLabelKey:"ldapMappersList",searchPlaceholderKey:"searchForMapper",toolbarItem:e(j,{children:e(N,{"data-testid":"add-mapper-btn",variant:"primary",component:a=>e(B,{...a,to:i}),children:r("addMapper")})}),actions:[{title:r("delete"),onRowClick:a=>{l(a),u()}}],columns:[{name:"name",cellRenderer:a=>e(ee,{...a,toDetail:o})},{name:"type"}],emptyState:e(Z,{message:r("emptyMappers"),instructions:r("emptyMappersInstructions"),primaryActionText:r("emptyPrimaryAction"),onPrimaryAction:()=>n(i)})},p)]})};function Ve(){const{adminClient:i}=A(),{t:o}=K(),s=H({mode:"onChange"}),{realm:n}=O(),{id:r}=E(),{addAlert:g,addError:f}=k(),[p,y]=m(),[h,b]=m(0),S=()=>b(t=>t+1);w(()=>i.components.findOne({id:r}),t=>{if(!t)throw new Error(o("notFound"));y(t),l(t)},[r,h]);const d=t=>Q(T({realm:n,id:r,tab:t})),L=d("settings"),c=d("mappers"),l=t=>{s.reset(t),s.setValue("config.periodicChangedUsersSync",t.config?.changedSyncPeriod?.[0]!=="-1"),s.setValue("config.periodicFullSync",t.config?.fullSyncPeriod?.[0]!=="-1")},u=async t=>{try{await i.components.update({id:r},X(t)),g(o("userProviderSaveSuccess"),x.success),S()}catch(a){f("userProviderSaveError",a)}};return p?M(G,{...s,children:[e($,{provider:"LDAP",noDivider:!0,editMode:p.config?.editMode,save:()=>s.handleSubmit(u)()}),e(F,{variant:"light",className:"pf-v5-u-p-0",children:M(J,{defaultLocation:T({realm:n,id:r,tab:"settings"}),isBox:!0,children:[e(P,{id:"settings",title:e(D,{children:o("settings")}),...L,children:e(F,{variant:"light",children:e(W,{id:r,onSubmit:u})})}),e(P,{id:"mappers",title:e(D,{children:o("mappers")}),"data-testid":"ldap-mappers-tab",...c,children:e(te,{toCreate:C({realm:n,id:r,mapperId:"new"}),toDetail:t=>C({realm:n,id:r,mapperId:t})})})]})})]}):e(q,{})}export{Ve as default};
//# sourceMappingURL=UserFederationLdapSettings-BZOwKGoF.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy