2 lines
6.3 KiB
JavaScript
2 lines
6.3 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1913],{33690:function(e,n,t){t.r(n);var o=t(29439),i=t(1413),a=t(72791),r=t(36151),l=t(11135),s=t(25787),c=t(61889),u=t(23814),d=t(81207),f=t(56028),p=t(90673),m=t(38734),x=t(92217),Z=t(87995),h=t(25469),j=t(80184);(0,l.Z)((0,i.Z)((0,i.Z)({},u.ID),u.bK));n.default=(0,s.Z)((function(e){return(0,l.Z)((0,i.Z)((0,i.Z)((0,i.Z)({codeMirrorContainer:{marginBottom:20,"& label":{marginBottom:".5rem"},"& label + div":{display:"none"}}},u.DF),u.ID),u.bK))}))((function(e){var n=e.classes,t=e.open,i=e.bucketName,l=e.actualPolicy,s=e.actualDefinition,u=e.closeModalAndRefresh,b=(0,h.TL)(),g=(0,a.useState)(!1),v=(0,o.Z)(g,2),y=v[0],C=v[1],P=(0,a.useState)(""),S=(0,o.Z)(P,2),N=S[0],k=S[1],M=(0,a.useState)(""),O=(0,o.Z)(M,2),w=O[0],B=O[1];return(0,a.useEffect)((function(){k(l),B(s?JSON.stringify(JSON.parse(s),null,4):"")}),[k,l,B,s]),(0,j.jsx)(f.Z,{title:"Change Access Policy",modalOpen:t,onClose:function(){u()},titleIcon:(0,j.jsx)(m.QXQ,{}),children:(0,j.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),y||(C(!0),d.Z.invoke("PUT","/api/v1/buckets/".concat(i,"/set-policy"),{access:N,definition:w}).then((function(e){C(!1),u()})).catch((function(e){C(!1),b((0,Z.zb)(e))})))},children:(0,j.jsxs)(c.ZP,{container:!0,children:[(0,j.jsxs)(c.ZP,{item:!0,xs:12,className:n.modalFormScrollable,children:[(0,j.jsx)(c.ZP,{item:!0,xs:12,className:n.formFieldRow,children:(0,j.jsx)(p.Z,{value:N,label:"Access Policy",id:"select-access-policy",name:"select-access-policy",onChange:function(e){k(e.target.value)},options:[{value:"PRIVATE",label:"Private"},{value:"PUBLIC",label:"Public"},{value:"CUSTOM",label:"Custom"}]})}),"CUSTOM"===N&&(0,j.jsx)(c.ZP,{item:!0,xs:12,className:n.codeMirrorContainer,children:(0,j.jsx)(x.Z,{label:"Write Policy",value:w,onBeforeChange:function(e,n,t){B(t)},editorHeight:"350px"})})]}),(0,j.jsxs)(c.ZP,{item:!0,xs:12,className:n.modalButtonBar,children:[(0,j.jsx)(r.Z,{type:"button",variant:"outlined",color:"primary",onClick:function(){u()},disabled:y,children:"Cancel"}),(0,j.jsx)(r.Z,{type:"submit",variant:"contained",color:"primary",disabled:y||"CUSTOM"===N&&!w,children:"Set"})]})]})})})}))},92217:function(e,n,t){var o=t(1413),i=t(72791),a=t(61889),r=t(30829),l=t(20068),s=t(64554),c=t(11135),u=t(25787),d=t(84570),f=t(23814),p=t(38734),m=t(40603),x=t(78029),Z=t.n(x),h=t(85457),j=t(80184);n.Z=(0,u.Z)((function(e){return(0,c.Z)((0,o.Z)({},f.YI))}))((function(e){var n=e.value,t=e.label,o=void 0===t?"":t,c=e.tooltip,u=void 0===c?"":c,f=e.mode,x=void 0===f?"json":f,b=e.classes,g=e.onBeforeChange,v=(e.readOnly,e.editorHeight),y=void 0===v?"250px":v;return(0,j.jsxs)(i.Fragment,{children:[(0,j.jsx)(a.ZP,{item:!0,xs:12,children:(0,j.jsxs)(r.Z,{className:b.inputLabel,children:[(0,j.jsx)("span",{children:o}),""!==u&&(0,j.jsx)("div",{className:b.tooltipContainer,children:(0,j.jsx)(l.Z,{title:u,placement:"top-start",children:(0,j.jsx)("div",{className:b.tooltip,children:(0,j.jsx)(d.Z,{})})})})]})}),(0,j.jsx)(a.ZP,{item:!0,xs:12,style:{maxHeight:y,overflow:"auto"},children:(0,j.jsx)(h.Z,{value:n,language:x,onChange:function(e){g(null,null,e.target.value)},id:"code_wrapper",padding:15,style:{fontSize:12,backgroundColor:"#fefefe",fontFamily:"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace"}})}),(0,j.jsx)(a.ZP,{item:!0,xs:12,sx:{borderTop:"1px solid #eaeaea",background:"#f7f7f7"},children:(0,j.jsx)(s.Z,{sx:{display:"flex",alignItems:"center",padding:"2px",paddingRight:"5px",justifyContent:"flex-end","& button":{height:"26px",width:"26px",padding:"2px"," .min-icon":{marginLeft:"0"}}},children:(0,j.jsx)(Z(),{text:n,children:(0,j.jsx)(m.Z,{tooltip:"Copy to Clipboard",onClick:function(){},text:"",icon:(0,j.jsx)(p.TIy,{}),color:"primary",variant:"outlined"})})})})]})}))},56028:function(e,n,t){var o=t(29439),i=t(1413),a=t(72791),r=t(60364),l=t(13400),s=t(55646),c=t(5574),u=t(65661),d=t(39157),f=t(11135),p=t(25787),m=t(23814),x=t(25469),Z=t(29823),h=t(28057),j=t(87995),b=t(80184);n.Z=(0,p.Z)((function(e){return(0,f.Z)((0,i.Z)((0,i.Z)({},m.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},m.sN))}))((function(e){var n=e.onClose,t=e.modalOpen,f=e.title,p=e.children,m=e.classes,g=e.wideLimit,v=void 0===g||g,y=e.noContentPadding,C=e.titleIcon,P=void 0===C?null:C,S=(0,x.TL)(),N=(0,a.useState)(!1),k=(0,o.Z)(N,2),M=k[0],O=k[1],w=(0,r.v9)((function(e){return e.system.modalSnackBar}));(0,a.useEffect)((function(){S((0,j.MK)(""))}),[S]),(0,a.useEffect)((function(){if(w){if(""===w.message)return void O(!1);"error"!==w.type&&O(!0)}}),[w]);var B=v?{classes:{paper:m.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},T="";return w&&(T=w.detailedErrorMsg,(""===w.detailedErrorMsg||w.detailedErrorMsg.length<5)&&(T=w.message)),(0,b.jsxs)(c.Z,(0,i.Z)((0,i.Z)({open:t,classes:m},B),{},{scroll:"paper",onClose:function(e,t){"backdropClick"!==t&&n()},className:m.root,children:[(0,b.jsxs)(u.Z,{className:m.title,children:[(0,b.jsxs)("div",{className:m.titleText,children:[P," ",f]}),(0,b.jsx)("div",{className:m.closeContainer,children:(0,b.jsx)(l.Z,{"aria-label":"close",id:"close",className:m.closeButton,onClick:n,disableRipple:!0,size:"small",children:(0,b.jsx)(Z.Z,{})})})]}),(0,b.jsx)(h.Z,{isModal:!0}),(0,b.jsx)(s.Z,{open:M,className:m.snackBarModal,onClose:function(){O(!1),S((0,j.MK)(""))},message:T,ContentProps:{className:"".concat(m.snackBar," ").concat(w&&"error"===w.type?m.errorSnackBar:"")},autoHideDuration:w&&"error"===w.type?1e4:5e3}),(0,b.jsx)(d.Z,{className:y?"":m.content,children:p})]}))}))},61120:function(e,n,t){function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}t.d(n,{Z:function(){return o}})},60136:function(e,n,t){t.d(n,{Z:function(){return i}});var o=t(89611);function i(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&(0,o.Z)(e,n)}},82963:function(e,n,t){t.d(n,{Z:function(){return a}});var o=t(71002),i=t(97326);function a(e,n){if(n&&("object"===(0,o.Z)(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}}}]);
|
|
//# sourceMappingURL=1913.aef0d716.chunk.js.map
|