"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1268],{92217:function(e,n,t){var o=t(1413),r=t(72791),i=t(61889),a=t(30829),c=t(20068),s=t(64554),l=t(11135),u=t(25787),d=t(84570),f=t(23814),p=t(38734),m=t(40603),x=t(78029),h=t.n(x),Z=t(85457),j=t(80184);n.Z=(0,u.Z)((function(e){return(0,l.Z)((0,o.Z)({},f.YI))}))((function(e){var n=e.value,t=e.label,o=void 0===t?"":t,l=e.tooltip,u=void 0===l?"":l,f=e.mode,x=void 0===f?"json":f,y=e.classes,b=e.onBeforeChange,v=(e.readOnly,e.editorHeight),g=void 0===v?"250px":v;return(0,j.jsxs)(r.Fragment,{children:[(0,j.jsx)(i.ZP,{item:!0,xs:12,children:(0,j.jsxs)(a.Z,{className:y.inputLabel,children:[(0,j.jsx)("span",{children:o}),""!==u&&(0,j.jsx)("div",{className:y.tooltipContainer,children:(0,j.jsx)(c.Z,{title:u,placement:"top-start",children:(0,j.jsx)("div",{className:y.tooltip,children:(0,j.jsx)(d.Z,{})})})})]})}),(0,j.jsx)(i.ZP,{item:!0,xs:12,style:{maxHeight:g,overflow:"auto"},children:(0,j.jsx)(Z.Z,{value:n,language:x,onChange:function(e){b(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)(i.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)(h(),{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"})})})})]})}))},82859:function(e,n,t){t.r(n);var o=t(29439),r=t(1413),i=t(72791),a=t(60364),c=t(16871),s=t(61889),l=t(40986),u=t(36151),d=t(11135),f=t(25787),p=t(81207),m=t(23814),x=t(92217),h=t(87995),Z=t(25469),j=t(82295),y=t(50896),b=t(80184);n.default=(0,f.Z)((function(e){return(0,d.Z)((0,r.Z)((0,r.Z)({errorState:{color:"#b53b4b",fontSize:14,fontWeight:"bold"},codeMirrorContainer:{marginBottom:20,paddingLeft:15,"& label":{marginBottom:".5rem"},"& label + div":{display:"none"}}},m.ID),m.YI))}))((function(e){var n=e.classes,t=(0,Z.TL)(),r=(0,c.s0)(),d=(0,a.v9)((function(e){return e.tenants.currentTenant})),f=(0,a.v9)((function(e){return e.tenants.currentNamespace})),m=(0,i.useState)(!1),v=(0,o.Z)(m,2),g=v[0],C=v[1],S=(0,i.useState)(!1),P=(0,o.Z)(S,2),w=P[0],k=P[1],T=(0,i.useState)(""),O=(0,o.Z)(T,2),_=O[0],L=O[1],M=(0,i.useState)(""),E=(0,o.Z)(M,2),F=E[0],I=E[1];(0,i.useEffect)((function(){p.Z.invoke("GET","/api/v1/namespaces/".concat(f,"/tenants/").concat(d,"/yaml")).then((function(e){k(!1),L(e.yaml)})).catch((function(e){k(!1),t((0,h.zb)(e))}))}),[d,f,t]),(0,i.useEffect)((function(){}),[]);var N=""!==_.trim();return(0,b.jsxs)(i.Fragment,{children:[g||w&&(0,b.jsx)(s.ZP,{item:!0,xs:12,children:(0,b.jsx)(l.Z,{})}),""!==F&&(0,b.jsx)("div",{className:n.errorState,children:F}),!w&&(0,b.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),g||(C(!0),I(""),p.Z.invoke("PUT","/api/v1/namespaces/".concat(f,"/tenants/").concat(d,"/yaml"),{yaml:_}).then((function(e){C(!1),t((0,j.v)()),I(""),r("/namespaces/".concat(f,"/tenants/").concat(d,"/summary"))})).catch((function(e){C(!1),I(e.errorMessage)})))},children:(0,b.jsxs)(s.ZP,{container:!0,children:[(0,b.jsx)(s.ZP,{item:!0,xs:12,children:(0,b.jsx)(y.Z,{children:"Tenant Specification"})}),(0,b.jsx)(s.ZP,{item:!0,xs:12,style:{border:"1px solid #eaeaea"},children:(0,b.jsx)(x.Z,{value:_,mode:"yaml",onBeforeChange:function(e,n,t){L(t)},editorHeight:"550px"})}),(0,b.jsxs)(s.ZP,{item:!0,xs:12,style:{textAlign:"right",paddingTop:16},children:[(0,b.jsx)(u.Z,{type:"button",variant:"outlined",color:"primary",disabled:g,onClick:function(){r("/namespaces/".concat(f,"/tenants/").concat(d,"/summary"))},children:"Cancel"}),(0,b.jsx)(u.Z,{type:"submit",variant:"contained",color:"primary",disabled:g||!N,style:{marginLeft:8},children:"Save"})]})]})})]})}))},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 r}});var o=t(89611);function r(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 i}});var o=t(71002),r=t(97326);function i(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,r.Z)(e)}}}]);
//# sourceMappingURL=1268.6b4f91d2.chunk.js.map