2 lines
7.1 KiB
JavaScript
2 lines
7.1 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9134],{64163:function(e,n,t){var i=t(1413),l=t(72791),s=t(61889),c=t(11135),o=t(25787),a=t(23814),r=t(80184);n.Z=(0,o.Z)((function(e){return(0,c.Z)((0,i.Z)({},a.xx))}))((function(e){var n=e.classes,t=e.label,i=void 0===t?"":t,c=e.content,o=e.multiLine,a=void 0!==o&&o,u=e.actionButton;return(0,r.jsx)(l.Fragment,{children:(0,r.jsxs)(s.ZP,{className:n.prefinedContainer,children:[""!==i&&(0,r.jsx)(s.ZP,{item:!0,xs:12,className:n.predefinedTitle,children:i}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,className:"".concat(n.predefinedList," ").concat(u?n.includesActionButton:""),children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,className:a?n.innerContentMultiline:n.innerContent,children:c}),u&&(0,r.jsx)("div",{className:n.overlayShareOption,children:u})]})]})})}))},56028:function(e,n,t){var i=t(29439),l=t(1413),s=t(72791),c=t(60364),o=t(13400),a=t(55646),r=t(5574),u=t(65661),d=t(39157),m=t(11135),f=t(25787),Z=t(23814),h=t(25469),x=t(29823),p=t(28057),v=t(87995),g=t(80184);n.Z=(0,f.Z)((function(e){return(0,m.Z)((0,l.Z)((0,l.Z)({},Z.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},Z.sN))}))((function(e){var n=e.onClose,t=e.modalOpen,m=e.title,f=e.children,Z=e.classes,j=e.wideLimit,b=void 0===j||j,P=e.noContentPadding,k=e.titleIcon,y=void 0===k?null:k,N=(0,h.TL)(),C=(0,s.useState)(!1),B=(0,i.Z)(C,2),S=B[0],L=B[1],T=(0,c.v9)((function(e){return e.system.modalSnackBar}));(0,s.useEffect)((function(){N((0,v.MK)(""))}),[N]),(0,s.useEffect)((function(){if(T){if(""===T.message)return void L(!1);"error"!==T.type&&L(!0)}}),[T]);var E=b?{classes:{paper:Z.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},M="";return T&&(M=T.detailedErrorMsg,(""===T.detailedErrorMsg||T.detailedErrorMsg.length<5)&&(M=T.message)),(0,g.jsxs)(r.Z,(0,l.Z)((0,l.Z)({open:t,classes:Z},E),{},{scroll:"paper",onClose:function(e,t){"backdropClick"!==t&&n()},className:Z.root,children:[(0,g.jsxs)(u.Z,{className:Z.title,children:[(0,g.jsxs)("div",{className:Z.titleText,children:[y," ",m]}),(0,g.jsx)("div",{className:Z.closeContainer,children:(0,g.jsx)(o.Z,{"aria-label":"close",id:"close",className:Z.closeButton,onClick:n,disableRipple:!0,size:"small",children:(0,g.jsx)(x.Z,{})})})]}),(0,g.jsx)(p.Z,{isModal:!0}),(0,g.jsx)(a.Z,{open:S,className:Z.snackBarModal,onClose:function(){L(!1),N((0,v.MK)(""))},message:M,ContentProps:{className:"".concat(Z.snackBar," ").concat(T&&"error"===T.type?Z.errorSnackBar:"")},autoHideDuration:T&&"error"===T.type?1e4:5e3}),(0,g.jsx)(d.Z,{className:P?"":Z.content,children:f})]}))}))},58400:function(e,n,t){var i=t(93433),l=t(29439),s=t(1413),c=t(72791),o=t(11135),a=t(25787),r=t(40986),u=t(61889),d=t(21639),m=t(23814),f=t(81207),Z=t(92983),h=t(59114),x=t(87995),p=t(25469),v=t(74616),g=t(60364),j=t(80184);n.Z=(0,a.Z)((function(e){return(0,o.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({noFound:{textAlign:"center",padding:"10px 0"},searchBox:{flex:1},fieldLabel:{fontWeight:400,width:160,marginRight:10},tableBlock:(0,s.Z)({},m.VX.tableBlock),filterBox:{display:"flex",marginBottom:15,alignItems:"center","& span":{fontSize:14}}},m.qg),m.VX),m.OR),m.jY))}))((function(e){var n=e.classes,t=(e.selectedPolicy,(0,p.TL)()),s=(0,c.useState)([]),o=(0,l.Z)(s,2),a=o[0],m=o[1],b=(0,c.useState)(!1),P=(0,l.Z)(b,2),k=P[0],y=P[1],N=(0,c.useState)(""),C=(0,l.Z)(N,2),B=C[0],S=C[1],L=(0,g.v9)((function(e){return e.createUser.selectedPolicies})),T=(0,c.useCallback)((function(){y(!0),f.Z.invoke("GET","/api/v1/policies?limit=1000").then((function(e){var n=null===e.policies?[]:e.policies;y(!1),m(n.sort(d.g4))})).catch((function(e){y(!1),t((0,x.zb)(e))}))}),[t]);(0,c.useEffect)((function(){y(!0)}),[]),(0,c.useEffect)((function(){k&&T()}),[k,T]);var E=a.filter((function(e){return e.name.includes(B)}));return(0,j.jsx)(u.ZP,{container:!0,children:(0,j.jsxs)(u.ZP,{item:!0,xs:12,children:[k&&(0,j.jsx)(r.Z,{}),a.length>0?(0,j.jsxs)(c.Fragment,{children:[(0,j.jsxs)(u.ZP,{item:!0,xs:12,className:n.filterBox,children:[(0,j.jsx)("span",{className:n.fieldLabel,children:"Assign Policies"}),(0,j.jsx)("div",{className:n.searchBox,children:(0,j.jsx)(h.Z,{placeholder:"Start typing to search for a Policy",onChange:function(e){S(e)},value:B})})]}),(0,j.jsx)(u.ZP,{item:!0,xs:12,className:n.tableBlock,style:{paddingBottom:16},children:(0,j.jsx)(Z.Z,{columns:[{label:"Policy",elementKey:"name"}],onSelect:function(e){var n=e.target,l=n.value,s=n.checked,c=(0,i.Z)(L);s?c.push(l):c=c.filter((function(e){return e!==l})),c=c.filter((function(e){return""!==e})),t((0,v.ue)(c))},selectedItems:L,isLoading:k,records:E,entityName:"Policies",idField:"name",customPaperHeight:n.multiSelectTable})})]}):(0,j.jsx)("div",{className:n.noFound,children:"No Policies Available"})]})})}))},39134:function(e,n,t){t.r(n);var i=t(29439),l=t(1413),s=t(72791),c=t(26181),o=t.n(c),a=t(11135),r=t(25787),u=t(36151),d=t(40986),m=t(61889),f=t(23814),Z=t(56028),h=t(81207),x=t(58400),p=t(64163),v=t(45248),g=t(87995),j=t(25469),b=t(60364),P=t(80184);n.default=(0,r.Z)((function(e){return(0,a.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},f.oO),f.bK),{},{tableBlock:(0,l.Z)((0,l.Z)({},f.VX.tableBlock),{},{marginTop:15}),buttonContainer:{textAlign:"right",marginTop:".9rem"}}))}))((function(e){var n=e.classes,t=e.closeModalAndRefresh,l=e.selectedUser,c=e.selectedGroups,a=e.open,r=(0,j.TL)(),f=(0,s.useState)(!1),k=(0,i.Z)(f,2),y=k[0],N=k[1],C=(0,s.useState)([]),B=(0,i.Z)(C,2),S=B[0],L=B[1],T=(0,s.useState)([]),E=(0,i.Z)(T,2),M=E[0],z=E[1],w=(0,b.v9)((function(e){return e.createUser.selectedPolicies}));(0,s.useEffect)((function(){if(a){if(1===(null===c||void 0===c?void 0:c.length))return void(1===(null===c||void 0===c?void 0:c.length)&&h.Z.invoke("GET","/api/v1/group/".concat((0,v.LL)(c[0]))).then((function(e){var n=o()(e,"policy","");L(n.split(",")),z(n.split(","))})).catch((function(e){r((0,g.zb)(e)),N(!1)})));var e=o()(l,"policy",[]);L(e),z(e)}}),[a,null===c||void 0===c?void 0:c.length,l]);var A=o()(l,"accessKey","");return(0,P.jsxs)(Z.Z,{onClose:function(){t()},modalOpen:a,title:"Set Policies",children:[(0,P.jsxs)(m.ZP,{container:!0,children:[(1===(null===c||void 0===c?void 0:c.length)||null!=l)&&(0,P.jsxs)(s.Fragment,{children:[(0,P.jsx)(m.ZP,{item:!0,xs:12,children:(0,P.jsx)(p.Z,{label:"Selected ".concat(null!==c?"Group":"User"),content:null!==c?c[0]:A})}),(0,P.jsx)(m.ZP,{item:!0,xs:12,children:(0,P.jsx)(p.Z,{label:"Current Policy",content:S.join(", ")})})]}),c&&(null===c||void 0===c?void 0:c.length)>1&&(0,P.jsx)(p.Z,{label:"Selected Groups",content:c.join(", ")}),(0,P.jsx)(m.ZP,{item:!0,xs:12,children:(0,P.jsx)("div",{className:n.tableBlock,children:(0,P.jsx)(x.Z,{selectedPolicy:M})})})]}),(0,P.jsxs)(m.ZP,{item:!0,xs:12,className:n.buttonContainer,children:[(0,P.jsx)(u.Z,{type:"button",variant:"outlined",color:"primary",className:n.spacerRight,onClick:function(){z(S)},children:"Reset"}),(0,P.jsx)(u.Z,{type:"button",variant:"contained",color:"primary",disabled:y,onClick:function(){var e=null,n=null;null!==c?n=c:null!==l&&(e=[l.accessKey]||0),N(!0),h.Z.invoke("PUT","/api/v1/set-policy-multi",{name:w,groups:n,users:e}).then((function(){N(!1),t()})).catch((function(e){N(!1),r((0,g.zb)(e))}))},children:"Save"})]}),y&&(0,P.jsx)(m.ZP,{item:!0,xs:12,children:(0,P.jsx)(d.Z,{})})]})}))}}]);
|
|
//# sourceMappingURL=9134.02674829.chunk.js.map
|