"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7485],{79313:(e,t,n)=>{n.d(t,{A:()=>p});var s=n(65043),i=n(89923),a=n(64159),o=n(20554),r=n(58661),l=n(56629),c=n(53518),d=n(70579);const p=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:n,idp:p,idpType:u}=e;const f=(0,o.jL)(),[x,j]=(0,s.useState)(!1);if(!p)return null;const A="_"===p?"Default":p;return(0,d.jsx)(r.A,{title:"Delete ".concat(A),confirmText:"Delete",isOpen:n,titleIcon:(0,d.jsx)(i.xWY,{}),isLoading:x,onConfirm:()=>{j(!0),l.F.idp.deleteConfiguration(p,u).then((e=>{(e=>{t(!0),f((0,a.YR)(!0===e.restart))})(e.data)})).catch((e=>f((0,a.C9)((0,c.S)(e.error))))).finally((()=>j(!1)))},onClose:()=>t(!1),confirmButtonProps:{disabled:x},confirmationContent:(0,d.jsxs)(s.Fragment,{children:["Are you sure you want to delete IDP ",(0,d.jsx)("b",{children:A})," ","configuration? ",(0,d.jsx)("br",{})]})})}},87485:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var s=n(65043),i=n(89923),a=n(73216),o=n(56629),r=n(53518),l=n(20554),c=n(99161),d=n(77938),p=n(64159),u=n(77403),f=n(6681),x=n(79313),j=n(48793),A=n(92452),C=n(70579);const b=e=>{let{idpType:t}=e;const n=(0,l.jL)(),b=(0,a.Zp)(),[h,m]=(0,s.useState)(!1),[y,D]=(0,s.useState)(""),[_,O]=(0,s.useState)(!1),[g,I]=(0,s.useState)([]),M=(0,d._)(c.Ms,[c.OV.ADMIN_CONFIG_UPDATE]),N=(0,d._)(c.Ms,[c.OV.ADMIN_CONFIG_UPDATE]),F=(0,d._)(c.Ms,[c.OV.ADMIN_CONFIG_UPDATE]);(0,s.useEffect)((()=>{T()}),[]),(0,s.useEffect)((()=>{_&&(F?o.F.idp.listConfigurations(t).then((e=>{O(!1),e.data.results&&I(e.data.results.map((e=>(e.name="_"===e.name?"Default":e.name,e.enabled=!0===e.enabled?"Enabled":"Disabled",e))))})).catch((e=>{O(!1),n((0,p.C9)((0,r.S)(e.error)))})):O(!1))}),[_,O,I,n,F,t]);const T=()=>{O(!0)},E=[{type:"view",onClick:e=>{let n="Default"===e.name?"_":e.name;b("/identity/idp/".concat(t,"/configurations/").concat(n))},disableButtonFunction:()=>!N},{type:"delete",onClick:e=>{m(!0),D(e="Default"===e?"_":e)},sendOnlyId:!0,disableButtonFunction:e=>!M||"Default"===e}];return(0,s.useEffect)((()=>{n((0,p.ph)("idp_configs"))}),[]),(0,C.jsxs)(s.Fragment,{children:[h&&(0,C.jsx)(x.A,{deleteOpen:h,idp:y,idpType:t,closeDeleteModalAndRefresh:async e=>{m(!1),e&&T()}}),(0,C.jsx)(j.A,{label:"".concat(t.toUpperCase()," Configurations"),actions:(0,C.jsx)(A.A,{})}),(0,C.jsx)(i.Mxu,{children:(0,C.jsxs)(i.xA9,{container:!0,children:[(0,C.jsxs)(i.xA9,{item:!0,xs:12,sx:{...u._0.actionsTray,justifyContent:"flex-end",gap:8},children:[(0,C.jsx)(d.R,{scopes:[c.OV.ADMIN_CONFIG_UPDATE],resource:c.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(f.A,{tooltip:"Refresh",children:(0,C.jsx)(i.$nd,{id:"refresh-keys",variant:"regular",icon:(0,C.jsx)(i.fNY,{}),onClick:()=>O(!0)})})}),(0,C.jsx)(d.R,{scopes:[c.OV.ADMIN_CONFIG_UPDATE],resource:c.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(f.A,{tooltip:"Create ".concat(t," configuration"),children:(0,C.jsx)(i.$nd,{id:"create-idp",label:"Create Configuration",variant:"callAction",icon:(0,C.jsx)(i.REV,{}),onClick:()=>b("/identity/idp/".concat(t,"/configurations/add-idp"))})})})]}),(0,C.jsx)(i.xA9,{item:!0,xs:12,children:(0,C.jsx)(d.R,{scopes:[c.OV.ADMIN_CONFIG_UPDATE],resource:c.Ms,errorProps:{disabled:!0},children:(0,C.jsx)(i.bQt,{itemActions:E,columns:[{label:"Name",elementKey:"name"},{label:"Type",elementKey:"type"},{label:"Enabled",elementKey:"enabled"}],isLoading:_,records:g,entityName:"Keys",idField:"name"})})})]})})]})},h=()=>(0,C.jsx)(b,{idpType:"openid"})}}]);
//# sourceMappingURL=7485.7f393450.chunk.js.map