"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[8455],{58455:function(e,a,s){s.r(a);var n=s(29439),t=s(1413),l=s(72791),c=s(56028),i=s(61889),o=s(75952),r=s(11135),d=s(25787),u=s(23814),m=s(81207),p=s(90673),f=s(38734),Z=s(87995),h=s(25469),x=s(80184);a.default=(0,d.Z)((function(e){return(0,r.Z)((0,t.Z)((0,t.Z)({},u.ID),u.bK))}))((function(e){var a=e.modalOpen,s=e.onClose,t=e.classes,r=e.bucket,d=e.toEdit,u=e.initial,v=(0,h.TL)(),j=(0,l.useState)(u),b=(0,n.Z)(j,2),g=b[0],k=b[1];return(0,x.jsx)(l.Fragment,{children:(0,x.jsx)(c.Z,{modalOpen:a,title:"Edit Access Rule for ".concat("".concat(r,"/").concat(d||"")),onClose:s,titleIcon:(0,x.jsx)(f.sR0,{}),children:(0,x.jsxs)(i.ZP,{container:!0,children:[(0,x.jsx)(i.ZP,{item:!0,xs:12,className:t.spacerTop,children:(0,x.jsx)(p.Z,{id:"access",name:"Access",onChange:function(e){k(e.target.value)},label:"Access",value:g,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1})}),(0,x.jsxs)(i.ZP,{item:!0,xs:12,className:t.modalButtonBar,children:[(0,x.jsx)(o.z,{id:"clear",type:"button",variant:"regular",onClick:function(){k(u)},label:"Clear"}),(0,x.jsx)(o.z,{id:"save",type:"submit",variant:"callAction",onClick:function(){m.Z.invoke("PUT","/api/v1/bucket/".concat(r,"/access-rules"),{prefix:d,access:g}).then((function(e){s()})).catch((function(e){v((0,Z.Ih)(e)),s()}))},label:"Save"})]})]})})})}))},56028:function(e,a,s){var n=s(29439),t=s(1413),l=s(72791),c=s(60364),i=s(13400),o=s(55646),r=s(5574),d=s(65661),u=s(39157),m=s(11135),p=s(25787),f=s(23814),Z=s(25469),h=s(29823),x=s(28057),v=s(87995),j=s(80184);a.Z=(0,p.Z)((function(e){return(0,m.Z)((0,t.Z)((0,t.Z)({},f.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},f.sN))}))((function(e){var a=e.onClose,s=e.modalOpen,m=e.title,p=e.children,f=e.classes,b=e.wideLimit,g=void 0===b||b,k=e.noContentPadding,C=e.titleIcon,N=void 0===C?null:C,y=(0,Z.TL)(),w=(0,l.useState)(!1),B=(0,n.Z)(w,2),E=B[0],M=B[1],S=(0,c.v9)((function(e){return e.system.modalSnackBar}));(0,l.useEffect)((function(){y((0,v.MK)(""))}),[y]),(0,l.useEffect)((function(){if(S){if(""===S.message)return void M(!1);"error"!==S.type&&M(!0)}}),[S]);var P=g?{classes:{paper:f.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},z="";return S&&(z=S.detailedErrorMsg,(""===S.detailedErrorMsg||S.detailedErrorMsg.length<5)&&(z=S.message)),(0,j.jsxs)(r.Z,(0,t.Z)((0,t.Z)({open:s,classes:f},P),{},{scroll:"paper",onClose:function(e,s){"backdropClick"!==s&&a()},className:f.root,children:[(0,j.jsxs)(d.Z,{className:f.title,children:[(0,j.jsxs)("div",{className:f.titleText,children:[N," ",m]}),(0,j.jsx)("div",{className:f.closeContainer,children:(0,j.jsx)(i.Z,{"aria-label":"close",id:"close",className:f.closeButton,onClick:a,disableRipple:!0,size:"small",children:(0,j.jsx)(h.Z,{})})})]}),(0,j.jsx)(x.Z,{isModal:!0}),(0,j.jsx)(o.Z,{open:E,className:f.snackBarModal,onClose:function(){M(!1),y((0,v.MK)(""))},message:z,ContentProps:{className:"".concat(f.snackBar," ").concat(S&&"error"===S.type?f.errorSnackBar:"")},autoHideDuration:S&&"error"===S.type?1e4:5e3}),(0,j.jsx)(u.Z,{className:k?"":f.content,children:p})]}))}))}}]);
//# sourceMappingURL=8455.ac01170a.chunk.js.map