"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[7494],{47494:function(e,t,n){n.r(t);var c=n(29439),s=n(72791),i=n(29945),u=n(78687),o=n(57689),r=n(31776),l=n(82342),a=n(56087),d=n(38442),f=n(87995),_=n(9859),C=n(81551),S=n(75578),T=n(27454),p=n(80184),F=(0,S.Z)(s.lazy((function(){return n.e(4619).then(n.bind(n,94619))}))),b=(0,S.Z)(s.lazy((function(){return n.e(8990).then(n.bind(n,8990))}))),x=(0,S.Z)(s.lazy((function(){return n.e(8455).then(n.bind(n,58455))})));t.default=function(){var e=(0,C.TL)(),t=(0,o.UO)(),n=(0,u.v9)(_.HQ),S=(0,s.useState)(!0),E=(0,c.Z)(S,2),h=E[0],A=E[1],k=(0,s.useState)([]),O=(0,c.Z)(k,2),m=O[0],P=O[1],Z=(0,s.useState)(!1),I=(0,c.Z)(Z,2),j=I[0],U=I[1],B=(0,s.useState)(!1),y=(0,c.Z)(B,2),L=y[0],K=y[1],N=(0,s.useState)(""),v=(0,c.Z)(N,2),G=v[0],Y=v[1],R=(0,s.useState)(!1),g=(0,c.Z)(R,2),w=g[0],z=g[1],D=(0,s.useState)(""),Q=(0,c.Z)(D,2),H=Q[0],W=Q[1],q=(0,s.useState)(""),J=(0,c.Z)(q,2),M=J[0],V=J[1],X=t.bucketName||"",$=(0,d.F)(X,[a.Ft.S3_GET_BUCKET_POLICY,a.Ft.S3_GET_ACTIONS]),ee=(0,d.F)(X,[a.Ft.S3_DELETE_BUCKET_POLICY]),te=(0,d.F)(X,[a.Ft.S3_PUT_BUCKET_POLICY,a.Ft.S3_PUT_ACTIONS]);(0,s.useEffect)((function(){n&&A(!0)}),[n,A]);var ne=[{type:"delete",disableButtonFunction:function(){return!ee},onClick:function(e){K(!0),Y(e.prefix)}},{type:"view",disableButtonFunction:function(){return!te},onClick:function(e){W(e.prefix),V(e.access),z(!0)}}];(0,s.useEffect)((function(){e((0,f.Sc)("bucket_detail_prefix"))}),[]),(0,s.useEffect)((function(){h&&($?r.h.bucket.listAccessRulesWithBucket(X).then((function(e){P(e.data.accessRules),A(!1)})).catch((function(t){e((0,f.Ih)((0,l.g)(t))),A(!1)})):A(!1))}),[h,e,$,X]);return(0,p.jsxs)(s.Fragment,{children:[j&&(0,p.jsx)(F,{modalOpen:j,onClose:function(){U(!1),A(!0)},bucket:X}),L&&(0,p.jsx)(b,{modalOpen:L,onClose:function(){K(!1),A(!0)},bucket:X,toDelete:G}),w&&(0,p.jsx)(x,{modalOpen:w,onClose:function(){z(!1),A(!0)},bucket:X,toEdit:H,initial:M}),(0,p.jsx)(i.NZf,{separator:!0,sx:{marginBottom:15},actions:(0,p.jsx)(d.s,{scopes:[a.Ft.S3_GET_BUCKET_POLICY,a.Ft.S3_PUT_BUCKET_POLICY,a.Ft.S3_GET_ACTIONS,a.Ft.S3_PUT_ACTIONS],resource:X,matchAll:!0,errorProps:{disabled:!0},children:(0,p.jsx)(T.Z,{tooltip:"Add Access Rule",children:(0,p.jsx)(i.zxk,{id:"add-bucket-access-rule",onClick:function(){U(!0)},label:"Add Access Rule",icon:(0,p.jsx)(i.dtP,{}),variant:"callAction"})})}),children:"Anonymous Access"}),(0,p.jsx)(d.s,{scopes:[a.Ft.S3_GET_BUCKET_POLICY,a.Ft.S3_GET_ACTIONS],resource:X,errorProps:{disabled:!0},children:(0,p.jsx)(i.wQF,{itemActions:ne,columns:[{label:"Prefix",elementKey:"prefix",renderFunction:function(e){return e||"/"}},{label:"Access",elementKey:"access"}],isLoading:h,records:m||[],entityName:"Access Rules",idField:"prefix"})})]})}}}]);
//# sourceMappingURL=7494.bad4da61.chunk.js.map