"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4619],{94619:function(e,a,t){t.r(a);var s=t(29439),l=t(1413),n=t(72791),i=t(56028),o=t(61889),r=t(75952),c=t(21435),d=t(11135),u=t(25787),p=t(23814),f=t(81207),m=t(90673),h=t(38734),x=t(87995),Z=t(25469),v=t(80184);a.default=(0,u.Z)((function(e){return(0,d.Z)((0,l.Z)((0,l.Z)({},p.DF),p.ID))}))((function(e){var a=e.modalOpen,t=e.onClose,l=e.classes,d=e.bucket,u=(0,Z.TL)(),p=(0,n.useState)(""),b=(0,s.Z)(p,2),j=b[0],k=b[1],g=(0,n.useState)("readonly"),C=(0,s.Z)(g,2),y=C[0],w=C[1];return(0,v.jsx)(i.Z,{modalOpen:a,title:"Add Access Rule",onClose:t,titleIcon:(0,v.jsx)(h.sR0,{}),children:(0,v.jsxs)(o.ZP,{container:!0,children:[(0,v.jsx)(o.ZP,{item:!0,xs:12,className:l.formFieldRow,children:(0,v.jsx)(c.Z,{value:j,label:"Prefix",id:"prefix",name:"prefix",placeholder:"Enter Prefix",onChange:function(e){k(e.target.value)},tooltip:"Leave this field blank to apply the rule to all prefixes and objects at the bucket root. Do not include the wildcard asterisk ``*`` as part of the prefix *unless* it is an explicit part of the prefix name. The Console automatically appends an asterisk to the appropriate sections of the resulting IAM policy."})}),(0,v.jsx)(o.ZP,{item:!0,xs:12,children:(0,v.jsx)(m.Z,{id:"access",name:"Access",onChange:function(e){w(e.target.value)},label:"Access",value:y,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1})}),(0,v.jsxs)(o.ZP,{item:!0,xs:12,className:l.modalButtonBar,children:[(0,v.jsx)(r.z,{id:"clear",type:"button",variant:"regular",onClick:function(){k(""),w("readonly")},label:"Clear"}),(0,v.jsx)(r.z,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===j.trim(),onClick:function(){f.Z.invoke("PUT","/api/v1/bucket/".concat(d,"/access-rules"),{prefix:j,access:y}).then((function(e){t()})).catch((function(e){u((0,x.Ih)(e)),t()}))},label:"Save"})]})]})})}))},56028:function(e,a,t){var s=t(29439),l=t(1413),n=t(72791),i=t(60364),o=t(13400),r=t(55646),c=t(5574),d=t(65661),u=t(39157),p=t(11135),f=t(25787),m=t(23814),h=t(25469),x=t(29823),Z=t(28057),v=t(87995),b=t(80184);a.Z=(0,f.Z)((function(e){return(0,p.Z)((0,l.Z)((0,l.Z)({},m.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},m.sN))}))((function(e){var a=e.onClose,t=e.modalOpen,p=e.title,f=e.children,m=e.classes,j=e.wideLimit,k=void 0===j||j,g=e.noContentPadding,C=e.titleIcon,y=void 0===C?null:C,w=(0,h.TL)(),N=(0,n.useState)(!1),P=(0,s.Z)(N,2),B=P[0],M=P[1],S=(0,i.v9)((function(e){return e.system.modalSnackBar}));(0,n.useEffect)((function(){w((0,v.MK)(""))}),[w]),(0,n.useEffect)((function(){if(S){if(""===S.message)return void M(!1);"error"!==S.type&&M(!0)}}),[S]);var A=k?{classes:{paper:m.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},D="";return S&&(D=S.detailedErrorMsg,(""===S.detailedErrorMsg||S.detailedErrorMsg.length<5)&&(D=S.message)),(0,b.jsxs)(c.Z,(0,l.Z)((0,l.Z)({open:t,classes:m},A),{},{scroll:"paper",onClose:function(e,t){"backdropClick"!==t&&a()},className:m.root,children:[(0,b.jsxs)(d.Z,{className:m.title,children:[(0,b.jsxs)("div",{className:m.titleText,children:[y," ",p]}),(0,b.jsx)("div",{className:m.closeContainer,children:(0,b.jsx)(o.Z,{"aria-label":"close",id:"close",className:m.closeButton,onClick:a,disableRipple:!0,size:"small",children:(0,b.jsx)(x.Z,{})})})]}),(0,b.jsx)(Z.Z,{isModal:!0}),(0,b.jsx)(r.Z,{open:B,className:m.snackBarModal,onClose:function(){M(!1),w((0,v.MK)(""))},message:D,ContentProps:{className:"".concat(m.snackBar," ").concat(S&&"error"===S.type?m.errorSnackBar:"")},autoHideDuration:S&&"error"===S.type?1e4:5e3}),(0,b.jsx)(u.Z,{className:g?"":m.content,children:f})]}))}))}}]);
//# sourceMappingURL=4619.82c18241.chunk.js.map