github.com/minio/console@v1.4.1/web-app/build/static/js/7659.124c07a5.chunk.js (about) 1 (self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7659],{97659:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>b});var n=o(65043),r=o(56629),a=o(85330),c=o(53518),i=o(89923),l=o(77403),s=o(64159),u=o(20554),p=o(95316),f=o(94141),d=o(41206),y=o(70579);const b=e=>{let{open:t,bucketName:o,actualPolicy:b,actualDefinition:m,closeModalAndRefresh:h}=e;const g=(0,u.jL)(),[v,C]=(0,n.useState)(!1),[j,x]=(0,n.useState)(""),[w,O]=(0,n.useState)(p.U);return(0,n.useEffect)((()=>{x(b),O(m?JSON.stringify(JSON.parse(m),null,4):p.U)}),[x,b,O,m]),(0,y.jsx)(f.A,{title:"Change Access Policy",modalOpen:t,onClose:()=>{h()},titleIcon:(0,y.jsx)(i.uYH,{}),children:(0,y.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),!v&&j&&(C(!0),r.F.buckets.bucketSetPolicy(o,{access:j,definition:w}).then((()=>{C(!1),h()})).catch((e=>{C(!1),g((0,s.Dy)((0,c.S)(e.error)))})))},children:[(0,y.jsxs)(i.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,y.jsx)(i.l6P,{value:j,label:"Access Policy",id:"select-access-policy",name:"select-access-policy",onChange:e=>{x(e)},options:[{value:a.jz.PRIVATE,label:"Private"},{value:a.jz.PUBLIC,label:"Public"},{value:a.jz.CUSTOM,label:"Custom"}]}),"PUBLIC"===j&&(0,y.jsx)(i.azJ,{className:"muted",style:{marginTop:"25px",fontSize:"14px",fontStyle:"italic"},children:"* Warning: With Public access anyone will be able to upload, download and delete files from this Bucket *"}),"CUSTOM"===j&&(0,y.jsx)(i.xA9,{item:!0,xs:12,children:(0,y.jsx)(d.A,{label:"Write Policy",value:w,onChange:e=>{O(e)},editorHeight:"300px",helptip:(0,y.jsx)(n.Fragment,{children:(0,y.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})})]}),(0,y.jsxs)(i.azJ,{sx:l.Uz.modalButtonBar,children:[(0,y.jsx)(i.$nd,{id:"cancel",type:"button",variant:"regular",onClick:()=>{h()},disabled:v,label:"Cancel"}),(0,y.jsx)(i.$nd,{id:"set",type:"submit",variant:"callAction",disabled:v||"CUSTOM"===j&&!w,label:"Set"})]})]})})}},41206:(e,t,o)=>{"use strict";o.d(t,{A:()=>s});var n=o(65043),r=o(89923),a=o(61476),c=o.n(a),i=o(6681),l=o(70579);const s=e=>{let{value:t,label:o="",tooltip:a="",mode:s="json",onChange:u,editorHeight:p=250,helptip:f}=e;return(0,l.jsx)(r.BYM,{value:t,onChange:e=>u(e),mode:s,tooltip:a,editorHeight:p,label:o,helpTools:(0,l.jsx)(n.Fragment,{children:(0,l.jsx)(i.A,{tooltip:"Copy to Clipboard",children:(0,l.jsx)(c(),{text:t,children:(0,l.jsx)(r.$nd,{type:"button",id:"copy-code-mirror",icon:(0,l.jsx)(r.TdU,{}),color:"primary",variant:"regular"})})})}),helpTip:f,helpTipPlacement:"right"})}},95316:(e,t,o)=>{"use strict";o.d(t,{U:()=>n});const n='{\n "Version": "2012-10-17",\n "Statement": [\n \n ]\n}'},75270:(e,t,o)=>{"use strict";var n=o(40139),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,a,c,i,l,s,u=!1;t||(t={}),o=t.debug||!1;try{if(c=n(),i=document.createRange(),l=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=r[t.format]||r.default;window.clipboardData.setData(a,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(s),i.selectNodeContents(s),l.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(p){o&&console.error("unable to copy using execCommand: ",p),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(p){o&&console.error("unable to copy using clipboardData: ",p),o&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(i):l.removeAllRanges()),s&&document.body.removeChild(s),c()}return u}},24480:(e,t,o)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=i(o(65043)),a=i(o(75270)),c=["text","onCopy","options","children"];function i(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function s(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach((function(t){m(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function u(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function p(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function d(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=b(e);if(t){var a=b(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,o)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var h=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(l,e);var t,o,n,i=d(l);function l(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return m(y(e=i.call.apply(i,[this].concat(o))),"onClick",(function(t){var o=e.props,n=o.text,c=o.onCopy,i=o.children,l=o.options,s=r.default.Children.only(i),u=(0,a.default)(n,l);c&&c(n,u),s&&s.props&&"function"===typeof s.props.onClick&&s.props.onClick(t)})),e}return t=l,(o=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),o=u(e,c),n=r.default.Children.only(t);return r.default.cloneElement(n,s(s({},o),{},{onClick:this.onClick}))}}])&&p(t.prototype,o),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.default.PureComponent);t.CopyToClipboard=h,m(h,"defaultProps",{onCopy:void 0,options:void 0})},61476:(e,t,o)=>{"use strict";var n=o(24480).CopyToClipboard;n.CopyToClipboard=n,e.exports=n},40139:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}}]); 2 //# sourceMappingURL=7659.124c07a5.chunk.js.map