theme.keycloak.v2.admin.resources.assets.OrganizationsSection-DS9djTQW.js Maven / Gradle / Ivy
import{jsxs as r,Fragment as x,jsx as t}from"react/jsx-runtime";import{useState as d}from"react";import{u as L,c as m,a as o,f as T,d as B,B as R,P as S,a2 as v,i as w,L as c,dH as l,dF as A,bG as k,ag as E,ah as P}from"./main-C7ps2lmX.js";import{u as I}from"./ConfirmDialog-hx7XKLbN.js";import{L as V}from"./PaginatingTableToolbar-Cjsz5Jh4.js";import{K as N}from"./KeycloakDataTable-DbY4la1D.js";import{V as j}from"./ViewHeader-B7eeFzFA.js";import{a0 as F}from"./Td-D2hVFK0Z.js";import"react-dom";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";import"./_baseFlatten-eIEJR-AJ.js";import"./grip-vertical-icon-BxF7V59o.js";const G=a=>{const{t:i}=o(),{realm:e}=m();return t(F,{wrapModifier:"truncate",children:r(c,{to:A({realm:e,id:a.id,tab:"settings"}),children:[a.name,!a.enabled&&t(k,{isRead:!0,className:"pf-v5-u-ml-sm",children:i("disabled")},`${a.id}-disabled`)]},a.id)})},H=a=>{const{t:i}=o();return t(E,{numChips:2,expandedText:i("hide"),collapsedText:i("showRemaining"),children:a.domains?.map(e=>t(P,{isReadOnly:!0,children:e.name},e.name))})};function ae(){const{adminClient:a}=L(),{realm:i}=m(),{t:e}=o(),{addAlert:p,addError:u}=T(),g=B(),[s,y]=d(0),f=()=>y(s+1),[h,z]=d();async function O(n,D,C){return await a.organizations.find({first:n,max:D,search:C})}const[b,K]=I({titleKey:"organizationDelete",messageKey:"organizationDeleteConfirm",continueButtonLabel:"delete",continueButtonVariant:R.danger,onConfirm:async()=>{try{await a.organizations.delById({id:h.id}),p(e("organizationDeletedSuccess")),f()}catch(n){u("organizationDeleteError",n)}}});return r(x,{children:[t(j,{titleKey:"organizationsList",subKey:"organizationsExplain",divider:!0}),r(S,{variant:"light",className:"pf-v5-u-p-0",children:[t(K,{}),t(N,{loader:O,isPaginated:!0,ariaLabelKey:"organizationList",searchPlaceholderKey:"searchOrganization",toolbarItem:t(v,{children:t(w,{"data-testid":"addOrganization",component:n=>t(c,{...n,to:l({realm:i})}),children:e("createOrganization")})}),actions:[{title:e("delete"),onRowClick:n=>{z(n),b()}}],columns:[{name:"name",displayKey:"name",cellRenderer:G},{name:"domains",displayKey:"domains",cellRenderer:H},{name:"description",displayKey:"description"}],emptyState:t(V,{message:e("emptyOrganizations"),instructions:e("emptyOrganizationsInstructions"),primaryActionText:e("createOrganization"),onPrimaryAction:()=>g(l({realm:i}))})},s)]})]})}export{ae as default};
//# sourceMappingURL=OrganizationsSection-DS9djTQW.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy