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

theme.keycloak.v2.admin.resources.assets.OrganizationsSection-CuGpkAlM.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
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,h as w,L as c,dG as l,dE as A,bG as E,ag as k,ah as P}from"./index-C1LIsRX7.js";import{u as I}from"./ConfirmDialog-B5qjiAuo.js";import{L as V}from"./PaginatingTableToolbar-CpMLQtqt.js";import{K as G}from"./KeycloakDataTable-jyvvxdb8.js";import{V as N}from"./ViewHeader-qjLr6U82.js";import{a1 as j}from"./Td-BwjBKSkH.js";import"react-dom";import"./EmptyStateFooter-Cm2IMTi1.js";import"./EmptyStateActions-DBSnfkAA.js";import"./_baseFlatten-BHAcGTxk.js";import"./grip-vertical-icon-Bnn0MebT.js";const F=a=>{const{t:i}=o(),{realm:e}=m();return t(j,{wrapModifier:"truncate",children:r(c,{to:A({realm:e,id:a.id,tab:"settings"}),children:[a.name,!a.enabled&&t(E,{isRead:!0,className:"pf-v5-u-ml-sm",children:i("disabled")},`${a.id}-disabled`)]},a.id)})},H=a=>{const{t:i}=o();return t(k,{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),h=()=>y(s+1),[f,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:f.id}),p(e("organizationDeletedSuccess")),h()}catch(n){u("organizationDeleteError",n)}}});return r(x,{children:[t(N,{titleKey:"organizationsList",subKey:"organizationsExplain",divider:!0}),r(S,{variant:"light",className:"pf-v5-u-p-0",children:[t(K,{}),t(G,{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:F},{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-CuGpkAlM.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy