theme.keycloak.v2.admin.resources.assets.UserFederationLdapSettings-B_vsB--L.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 k,d as I,a as A,f as K,s as U,e as x,w as E,B as V,k as w,a2 as j,i as N,L as B,x as z,g as H,c as O,a3 as q,F as G,P as F,ek as T,el as C}from"./main-C7ps2lmX.js";import{R as J,u as Q}from"./RoutableTabs-T8JTILEW.js";import{U as W,s as X}from"./UserFederationLdapForm-Dau3yBfR.js";import{u as Y}from"./ConfirmDialog-hx7XKLbN.js";import{L as Z}from"./PaginatingTableToolbar-Cjsz5Jh4.js";import{K as _}from"./KeycloakDataTable-DbY4la1D.js";import{E as $}from"./ExtendedHeader-BcI8Gfaz.js";import{a as P,b as D}from"./Tabs-CMdqT4Cg.js";import"react-dom";import"./PageHandler-P2CRgucq.js";import"./DynamicComponents-DvaX3FJx.js";import"./ClientSelect-B9UqjyP6.js";import"./FileUpload-CumNwlWc.js";import"./CodeEditor-C-nZkUJx.js";import"./copy-icon-ACZmDH8e.js";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";import"./GroupPickerDialog-C09EjRTA.js";import"./DataListItemRow-BC0LurDd.js";import"./FlexItem-BzZfUnQ1.js";import"./KeySelect-jKxsKqdI.js";import"./useToggle-K3Kx99tM.js";import"./MultiLineInput-DiPNQ1LE.js";import"./AddRoleMappingModal-DW8o4W0z.js";import"./filter-icon-DO0QNij3.js";import"./Td-D2hVFK0Z.js";import"./grip-vertical-icon-BxF7V59o.js";import"./ViewHeader-B7eeFzFA.js";import"./useParams-B67lSY02.js";import"./PageList-s9OtSlkz.js";import"./_baseFlatten-eIEJR-AJ.js";import"./FormAccess-DyLNkc18.js";import"./SettingsCache-BECJJhg-.js";import"./isEqual-BWOcMitS.js";const ee=({toDetail:i,...o})=>e(B,{to:i(o.id),children:o.name}),te=({toCreate:i,toDetail:o})=>{const{adminClient:s}=k(),n=I(),{t:r}=A(),{addAlert:g,addError:f}=K(),[p,y]=m(0),h=()=>y(p+1),[b,S]=m([]),d=U(),{id:L}=x(),[c,l]=m();E(()=>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"),w.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}=k(),{t:o}=A(),s=H({mode:"onChange"}),{realm:n}=O(),{id:r}=x(),{addAlert:g,addError:f}=K(),[p,y]=m(),[h,b]=m(0),S=()=>b(t=>t+1);E(()=>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"),w.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-B_vsB--L.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy