Files
openmaxio-object-browser/portal-ui/build/static/js/1329.ebb06e52.chunk.js
2023-07-06 10:32:39 -07:00

2 lines
4.1 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1329],{51270:function(e,n,t){var i=t(29439),r=(t(72791),t(51691)),o=t(9505),s=t(23508),a=t(29945),c=t(87995),u=t(81551),l=t(80184);n.Z=function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,d=e.idp,f=e.idpType,p=(0,u.TL)(),x=(0,o.Z)((function(e){n(!0),p((0,c.cN)(!0===e.restart))}),(function(e){return p((0,c.Ih)(e))})),C=(0,i.Z)(x,2),h=C[0],m=C[1];if(!d)return null;var j="_"===d?"Default":d;return(0,l.jsx)(s.Z,{title:"Delete ".concat(j),confirmText:"Delete",isOpen:t,titleIcon:(0,l.jsx)(a.NvT,{}),isLoading:h,onConfirm:function(){m("DELETE","/api/v1/idp/".concat(f,"/").concat(d))},onClose:function(){return n(!1)},confirmButtonProps:{disabled:h},confirmationContent:(0,l.jsxs)(r.Z,{children:["Are you sure you want to delete IDP ",(0,l.jsx)("b",{children:j})," ","configuration? ",(0,l.jsx)("br",{})]})})}},31329:function(e,n,t){t.r(n),t.d(n,{default:function(){return N}});var i=t(72791),r=t(74165),o=t(15861),s=t(29439),a=t(1413),c=t(11135),u=t(25787),l=t(81551),d=t(57689),f=t(56087),p=t(38442),x=t(87995),C=t(23814),h=t(61889),m=t(27454),j=t(29945),D=t(92983),Z=t(51270),b=t(47974),y=t(99670),F=t(31776),_=t(82342),g=t(80184),I=(0,u.Z)((function(e){return(0,c.Z)((0,a.Z)({},C.Bz))}))((function(e){var n=e.classes,t=e.idpType,a=(0,l.TL)(),c=(0,d.s0)(),u=(0,i.useState)(!1),C=(0,s.Z)(u,2),I=C[0],N=C[1],A=(0,i.useState)(""),T=(0,s.Z)(A,2),P=T[0],v=T[1],E=(0,i.useState)(!1),k=(0,s.Z)(E,2),O=k[0],M=k[1],U=(0,i.useState)([]),w=(0,s.Z)(U,2),G=w[0],L=w[1],B=(0,p.F)(f.C3,[f.Ft.ADMIN_CONFIG_UPDATE]),K=(0,p.F)(f.C3,[f.Ft.ADMIN_CONFIG_UPDATE]),S=(0,p.F)(f.C3,[f.Ft.ADMIN_CONFIG_UPDATE]);(0,i.useEffect)((function(){z()}),[]),(0,i.useEffect)((function(){O&&(S?F.h.idp.listConfigurations(t).then((function(e){M(!1),e.data.results&&L(e.data.results.map((function(e){return e.name="_"===e.name?"Default":e.name,e.enabled=!0===e.enabled?"Enabled":"Disabled",e})))})).catch((function(e){M(!1),a((0,x.Ih)((0,_.g)(e.error)))})):M(!1))}),[O,M,L,a,S,t]);var z=function(){M(!0)},R=function(){var e=(0,o.Z)((0,r.Z)().mark((function e(n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N(!1),n&&z();case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),X=[{type:"view",onClick:function(e){var n="Default"===e.name?"_":e.name;c("/identity/idp/".concat(t,"/configurations/").concat(n))},disableButtonFunction:function(){return!K}},{type:"delete",onClick:function(e){N(!0),v(e="Default"===e?"_":e)},sendOnlyId:!0,disableButtonFunction:function(e){return!B||"Default"===e}}];return(0,i.useEffect)((function(){a((0,x.Sc)("idp_configs"))}),[]),(0,g.jsxs)(i.Fragment,{children:[I&&(0,g.jsx)(Z.Z,{deleteOpen:I,idp:P,idpType:t,closeDeleteModalAndRefresh:R}),(0,g.jsx)(b.Z,{label:"".concat(t.toUpperCase()," Configurations"),actions:(0,g.jsx)(y.Z,{})}),(0,g.jsx)(j.Xgh,{className:n.pageContainer,children:(0,g.jsxs)(h.ZP,{container:!0,spacing:1,children:[(0,g.jsxs)(h.ZP,{item:!0,xs:12,display:"flex",alignItems:"center",justifyContent:"flex-end",sx:{"& button":{marginLeft:"8px"}},children:[(0,g.jsx)(p.s,{scopes:[f.Ft.ADMIN_CONFIG_UPDATE],resource:f.C3,errorProps:{disabled:!0},children:(0,g.jsx)(m.Z,{tooltip:"Refresh",children:(0,g.jsx)(j.zxk,{id:"refresh-keys",variant:"regular",icon:(0,g.jsx)(j.DuK,{}),onClick:function(){return M(!0)}})})}),(0,g.jsx)(p.s,{scopes:[f.Ft.ADMIN_CONFIG_UPDATE],resource:f.C3,errorProps:{disabled:!0},children:(0,g.jsx)(m.Z,{tooltip:"Create ".concat(t," configuration"),children:(0,g.jsx)(j.zxk,{id:"create-idp",label:"Create Configuration",variant:"callAction",icon:(0,g.jsx)(j.dtP,{}),onClick:function(){return c("/identity/idp/".concat(t,"/configurations/add-idp"))}})})})]}),(0,g.jsx)(h.ZP,{item:!0,xs:12,className:n.tableBlock,children:(0,g.jsx)(p.s,{scopes:[f.Ft.ADMIN_CONFIG_UPDATE],resource:f.C3,errorProps:{disabled:!0},children:(0,g.jsx)(D.Z,{itemActions:X,columns:[{label:"Name",elementKey:"name"},{label:"Type",elementKey:"type"},{label:"Enabled",elementKey:"enabled"}],isLoading:O,records:G,entityName:"Keys",idField:"name"})})})]})})]})})),N=function(){return(0,g.jsx)(I,{idpType:"openid"})}}}]);
//# sourceMappingURL=1329.ebb06e52.chunk.js.map