2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1329],{51270:(e,t,n)=>{n.d(t,{Z:()=>d});var s=n(72791),i=n(29945),a=n(87995),o=n(44690),r=n(9505),l=n(23508),c=n(80184);const d=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,idp:d,idpType:u}=e;const p=(0,o.TL)(),[f,x]=(0,r.Z)((e=>{t(!0),p((0,a.cN)(!0===e.restart))}),(e=>p((0,a.Ih)(e))));if(!d)return null;const j="_"===d?"Default":d;return(0,c.jsx)(l.Z,{title:"Delete ".concat(j),confirmText:"Delete",isOpen:n,titleIcon:(0,c.jsx)(i.NvT,{}),isLoading:f,onConfirm:()=>{x("DELETE","/api/v1/idp/".concat(u,"/").concat(d))},onClose:()=>t(!1),confirmButtonProps:{disabled:f},confirmationContent:(0,c.jsxs)(s.Fragment,{children:["Are you sure you want to delete IDP ",(0,c.jsx)("b",{children:j})," ","configuration? ",(0,c.jsx)("br",{})]})})}},31329:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var s=n(72791),i=n(29945),a=n(57689),o=n(31776),r=n(82342),l=n(44690),c=n(56087),d=n(38442),u=n(87995),p=n(23814),f=n(27454),x=n(51270),j=n(79844),C=n(99670),h=n(80184);const D=e=>{let{idpType:t}=e;const n=(0,l.TL)(),D=(0,a.s0)(),[m,y]=(0,s.useState)(!1),[b,F]=(0,s.useState)(""),[_,A]=(0,s.useState)(!1),[I,T]=(0,s.useState)([]),g=(0,d.F)(c.C3,[c.Ft.ADMIN_CONFIG_UPDATE]),N=(0,d.F)(c.C3,[c.Ft.ADMIN_CONFIG_UPDATE]),E=(0,d.F)(c.C3,[c.Ft.ADMIN_CONFIG_UPDATE]);(0,s.useEffect)((()=>{P()}),[]),(0,s.useEffect)((()=>{_&&(E?o.h.idp.listConfigurations(t).then((e=>{A(!1),e.data.results&&T(e.data.results.map((e=>(e.name="_"===e.name?"Default":e.name,e.enabled=!0===e.enabled?"Enabled":"Disabled",e))))})).catch((e=>{A(!1),n((0,u.Ih)((0,r.g)(e.error)))})):A(!1))}),[_,A,T,n,E,t]);const P=()=>{A(!0)},k=[{type:"view",onClick:e=>{let n="Default"===e.name?"_":e.name;D("/identity/idp/".concat(t,"/configurations/").concat(n))},disableButtonFunction:()=>!N},{type:"delete",onClick:e=>{y(!0),F(e="Default"===e?"_":e)},sendOnlyId:!0,disableButtonFunction:e=>!g||"Default"===e}];return(0,s.useEffect)((()=>{n((0,u.Sc)("idp_configs"))}),[]),(0,h.jsxs)(s.Fragment,{children:[m&&(0,h.jsx)(x.Z,{deleteOpen:m,idp:b,idpType:t,closeDeleteModalAndRefresh:async e=>{y(!1),e&&P()}}),(0,h.jsx)(j.Z,{label:"".concat(t.toUpperCase()," Configurations"),actions:(0,h.jsx)(C.Z,{})}),(0,h.jsx)(i.Xgh,{children:(0,h.jsxs)(i.rjZ,{container:!0,children:[(0,h.jsxs)(i.rjZ,{item:!0,xs:12,sx:{...p.OR.actionsTray,justifyContent:"flex-end",gap:8},children:[(0,h.jsx)(d.s,{scopes:[c.Ft.ADMIN_CONFIG_UPDATE],resource:c.C3,errorProps:{disabled:!0},children:(0,h.jsx)(f.Z,{tooltip:"Refresh",children:(0,h.jsx)(i.zxk,{id:"refresh-keys",variant:"regular",icon:(0,h.jsx)(i.DuK,{}),onClick:()=>A(!0)})})}),(0,h.jsx)(d.s,{scopes:[c.Ft.ADMIN_CONFIG_UPDATE],resource:c.C3,errorProps:{disabled:!0},children:(0,h.jsx)(f.Z,{tooltip:"Create ".concat(t," configuration"),children:(0,h.jsx)(i.zxk,{id:"create-idp",label:"Create Configuration",variant:"callAction",icon:(0,h.jsx)(i.dtP,{}),onClick:()=>D("/identity/idp/".concat(t,"/configurations/add-idp"))})})})]}),(0,h.jsx)(i.rjZ,{item:!0,xs:12,children:(0,h.jsx)(d.s,{scopes:[c.Ft.ADMIN_CONFIG_UPDATE],resource:c.C3,errorProps:{disabled:!0},children:(0,h.jsx)(i.wQF,{itemActions:k,columns:[{label:"Name",elementKey:"name"},{label:"Type",elementKey:"type"},{label:"Enabled",elementKey:"enabled"}],isLoading:_,records:I,entityName:"Keys",idField:"name"})})})]})})]})},m=()=>(0,h.jsx)(D,{idpType:"openid"})}}]);
|
|
//# sourceMappingURL=1329.b71d618a.chunk.js.map
|