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

theme.keycloak.v2.admin.resources.assets.DedicatedScopes-yIosmr7I.js Maven / Gradle / Ivy

There is a newer version: 26.0.7
Show newest version
import{jsxs as h,jsx as e,Fragment as T}from"react/jsx-runtime";import{useState as C}from"react";import{u as v,a as R,f as D,b3 as I,P as E,ac as x,ad as P,a4 as F,ar as k,k as b,d as L,w as O,a3 as H,aF as g,bR as w}from"./main-C7ps2lmX.js";import{M as K}from"./MapperList-c_RL-W3b.js";import{R as N,u as V}from"./RoutableTabs-T8JTILEW.js";import{V as j}from"./ViewHeader-B7eeFzFA.js";import{u as z}from"./useParams-B67lSY02.js";import{F as G}from"./FormAccess-DyLNkc18.js";import{R as B}from"./AddRoleMappingModal-DW8o4W0z.js";import{a as y,b as M}from"./Tabs-CMdqT4Cg.js";import"react-dom";import"./PaginatingTableToolbar-Cjsz5Jh4.js";import"./EmptyStateFooter-DqmBOP2I.js";import"./EmptyStateActions-DWNUFByn.js";import"./KeycloakDataTable-DbY4la1D.js";import"./Td-D2hVFK0Z.js";import"./grip-vertical-icon-BxF7V59o.js";import"./_baseFlatten-eIEJR-AJ.js";import"./DataListItemRow-BC0LurDd.js";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"./GroupPickerDialog-C09EjRTA.js";import"./FlexItem-BzZfUnQ1.js";import"./KeySelect-jKxsKqdI.js";import"./useToggle-K3Kx99tM.js";import"./MultiLineInput-DiPNQ1LE.js";import"./PageList-s9OtSlkz.js";import"./ConfirmDialog-hx7XKLbN.js";import"./filter-icon-DO0QNij3.js";const q=({client:p})=>{const{adminClient:s}=v(),{t:r}=R(),{addAlert:l,addError:m}=D(),[t,f]=C(p),{hasAccess:i}=I(),u=i("manage-clients")||t.access?.manage,S=async c=>{try{const n=c.filter(a=>a.client===void 0).map(a=>a.role).flat();await Promise.all([s.clients.addRealmScopeMappings({id:t.id},n),...c.filter(a=>a.client!==void 0).map(a=>s.clients.addClientScopeMappings({id:t.id,client:a.client.id},[a.role]))]),l(r("clientScopeSuccess"),b.success)}catch(n){m("clientScopeError",n)}},A=async()=>{const c={...t,fullScopeAllowed:!t.fullScopeAllowed};try{await s.clients.update({id:t.id},c),l(r("clientScopeSuccess"),b.success),f(c)}catch(n){m("clientScopeError",n)}};return h(E,{children:[e(G,{role:"manage-clients",fineGrainedAccess:t.access?.manage,isHorizontal:!0,children:e(x,{hasNoPaddingTop:!0,label:r("fullScopeAllowed"),labelIcon:e(P,{helpText:r("fullScopeAllowedHelp"),fieldLabelId:"fullScopeAllowed"}),fieldId:"fullScopeAllowed",children:e(F,{id:"fullScopeAllowed",label:r("on"),labelOff:r("off"),isChecked:t.fullScopeAllowed,onChange:A,"aria-label":r("fullScopeAllowed")})})}),!t.fullScopeAllowed&&h(T,{children:[e(k,{}),e(B,{name:t.clientId,id:t.id,type:"clients",save:S,isManager:u})]})]})};function Ce(){const{adminClient:p}=v(),{t:s}=R(),r=L(),{realm:l,clientId:m}=z(),{addAlert:t,addError:f}=D(),[i,u]=C();O(()=>p.clients.findOne({id:m}),u,[]);const S=o=>V(g({realm:l,clientId:m,tab:o})),A=S("mappers"),c=S("scope");if(!i)return e(H,{});const n=async o=>{if(Array.isArray(o))try{await p.clients.addMultipleProtocolMappers({id:i.id},o),u(await p.clients.findOne({id:i.id})),t(s("mappingCreatedSuccess"),b.success)}catch(d){f("mappingCreatedError",d)}else{const d=o;r(w({realm:l,id:i.id,mapperId:d.id}))}},a=async o=>{try{await p.clients.delProtocolMapper({id:i.id,mapperId:o.id}),u({...i,protocolMappers:i.protocolMappers?.filter(d=>d.id!==o.id)}),t(s("mappingDeletedSuccess"),b.success)}catch(d){f("mappingDeletedError",d)}return!0};return h(T,{children:[e(j,{titleKey:i.clientId+"-dedicated",subKey:"dedicatedScopeExplain",divider:!1}),e(E,{variant:"light",className:"pf-v5-u-p-0",children:h(N,{isBox:!0,mountOnEnter:!0,defaultLocation:g({realm:l,clientId:m,tab:"mappers"}),children:[e(y,{title:e(M,{children:s("mappers")}),"data-testid":"mappersTab",...A,children:e(K,{model:i,onAdd:n,onDelete:a,detailLink:o=>w({realm:l,id:i.id,mapperId:o})})}),e(y,{title:e(M,{children:s("scope")}),"data-testid":"scopeTab",...c,children:e(q,{client:i})})]})})]})}export{Ce as default};
//# sourceMappingURL=DedicatedScopes-yIosmr7I.js.map




© 2015 - 2025 Weber Informatics LLC | Privacy Policy