"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4619],{94619:function(e,a,t){t.r(a);var s=t(29439),n=t(1413),l=t(72791),i=t(56028),o=t(61889),r=t(36151),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,n.Z)((0,n.Z)({},p.DF),p.ID))}))((function(e){var a=e.modalOpen,t=e.onClose,n=e.classes,d=e.bucket,u=(0,Z.TL)(),p=(0,l.useState)(""),j=(0,s.Z)(p,2),k=j[0],b=j[1],g=(0,l.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:n.formFieldRow,children:(0,v.jsx)(c.Z,{value:k,label:"Prefix",id:"prefix",name:"prefix",placeholder:"Enter Prefix",onChange:function(e){b(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:n.modalButtonBar,children:[(0,v.jsx)(r.Z,{type:"button",color:"primary",variant:"outlined",onClick:function(){b(""),w("readonly")},children:"Clear"}),(0,v.jsx)(r.Z,{type:"submit",variant:"contained",color:"primary",disabled:""===k.trim(),onClick:function(){f.Z.invoke("PUT","/api/v1/bucket/".concat(d,"/access-rules"),{prefix:k,access:y}).then((function(e){t()})).catch((function(e){u((0,x.Ih)(e)),t()}))},children:"Save"})]})]})})}))},56028:function(e,a,t){var s=t(29439),n=t(1413),l=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),j=t(80184);a.Z=(0,f.Z)((function(e){return(0,p.Z)((0,n.Z)((0,n.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,k=e.wideLimit,b=void 0===k||k,g=e.noContentPadding,C=e.titleIcon,y=void 0===C?null:C,w=(0,h.TL)(),N=(0,l.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,l.useEffect)((function(){w((0,v.MK)(""))}),[w]),(0,l.useEffect)((function(){if(S){if(""===S.message)return void M(!1);"error"!==S.type&&M(!0)}}),[S]);var D=b?{classes:{paper:m.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},E="";return S&&(E=S.detailedErrorMsg,(""===S.detailedErrorMsg||S.detailedErrorMsg.length<5)&&(E=S.message)),(0,j.jsxs)(c.Z,(0,n.Z)((0,n.Z)({open:t,classes:m},D),{},{scroll:"paper",onClose:function(e,t){"backdropClick"!==t&&a()},className:m.root,children:[(0,j.jsxs)(d.Z,{className:m.title,children:[(0,j.jsxs)("div",{className:m.titleText,children:[y," ",p]}),(0,j.jsx)("div",{className:m.closeContainer,children:(0,j.jsx)(o.Z,{"aria-label":"close",id:"close",className:m.closeButton,onClick:a,disableRipple:!0,size:"small",children:(0,j.jsx)(x.Z,{})})})]}),(0,j.jsx)(Z.Z,{isModal:!0}),(0,j.jsx)(r.Z,{open:B,className:m.snackBarModal,onClose:function(){M(!1),w((0,v.MK)(""))},message:E,ContentProps:{className:"".concat(m.snackBar," ").concat(S&&"error"===S.type?m.errorSnackBar:"")},autoHideDuration:S&&"error"===S.type?1e4:5e3}),(0,j.jsx)(u.Z,{className:g?"":m.content,children:f})]}))}))}}]);
//# sourceMappingURL=4619.e0972aca.chunk.js.map