"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[5298],{97173:function(e,n,t){var i=t(49058),l=t(57223),s=t(73130),c=t(11927),a=t(4481),o=t(70466),r=t(18054);n.Z=(0,a.Z)((function(e){return(0,c.Z)((0,i.Z)({},o.xx))}))((function(e){var n=e.classes,t=e.label,i=void 0===t?"":t,c=e.content,a=e.multiLine,o=void 0!==a&&a;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.jsx)(s.ZP,{item:!0,xs:12,className:n.predefinedList,children:(0,r.jsx)(s.ZP,{item:!0,xs:12,className:o?n.innerContentMultiline:n.innerContent,children:c})})]})})}))},81728:function(e,n,t){t.r(n);var i=t(77439),l=t(49058),s=t(57223),c=t(537),a=t(67066),o=t.n(a),r=t(11927),u=t(4481),d=t(46266),Z=t(39253),p=t(73130),x=t(70466),f=t(64519),m=t(76701),h=t(64964),j=t(90620),v=t(97173),b=t(18054),y={setModalErrorSnackMessage:f.zb},k=(0,c.$j)(null,y);n.default=(0,u.Z)((function(e){return(0,r.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},x.oO),x.bK),{},{tableBlock:(0,l.Z)((0,l.Z)({},x.VX.tableBlock),{},{marginTop:15}),buttonContainer:{textAlign:"right",marginTop:".9rem"}}))}))(k((function(e){var n=e.classes,t=e.closeModalAndRefresh,l=e.selectedUser,c=e.selectedGroup,a=e.setModalErrorSnackMessage,r=e.open,u=(0,s.useState)(!1),x=(0,i.Z)(u,2),f=x[0],y=x[1],k=(0,s.useState)([]),P=(0,i.Z)(k,2),g=P[0],C=P[1],N=(0,s.useState)([]),M=(0,i.Z)(N,2),S=M[0],T=M[1];(0,s.useEffect)((function(){if(r){if(null!==c)return void(c&&h.Z.invoke("GET","/api/v1/group?name=".concat(encodeURI(c))).then((function(e){var n=o()(e,"policy","");C(n.split(",")),T(n.split(","))})).catch((function(e){a(e),y(!1)})));var e=o()(l,"policy",[]);C(e),T(e)}}),[r,c,l]);var E=o()(l,"accessKey","");return(0,b.jsxs)(m.Z,{onClose:function(){t()},modalOpen:r,title:"\u8bbe\u7f6e\u7b56\u7565",children:[(0,b.jsx)(p.ZP,{item:!0,xs:12,children:(0,b.jsx)(v.Z,{label:"\u5f53\u524d".concat(null!==c?"\u7ec4":"\u7528\u6237"),content:null!==c?c:E})}),(0,b.jsx)(p.ZP,{item:!0,xs:12,children:(0,b.jsx)(v.Z,{label:"\u73b0\u884c\u7b56\u7565",content:g.join(", ")})}),(0,b.jsx)("div",{className:n.tableBlock,children:(0,b.jsx)(j.Z,{selectedPolicy:S,setSelectedPolicy:T})}),(0,b.jsxs)(p.ZP,{item:!0,xs:12,className:n.buttonContainer,children:[(0,b.jsx)(d.Z,{type:"button",variant:"outlined",color:"primary",className:n.spacerRight,onClick:function(){T(g)},children:"\u91cd\u7f6e"}),(0,b.jsx)(d.Z,{type:"button",variant:"contained",color:"primary",disabled:f,onClick:function(){var e="user",n=null;null!==c?(e="group",n=c):null!==l&&(n=l.accessKey),y(!0),h.Z.invoke("PUT","/api/v1/set-policy",{name:S,entityName:n,entityType:e}).then((function(){y(!1),t()})).catch((function(e){y(!1),a(e)}))},children:"\u4fdd\u5b58"})]}),f&&(0,b.jsx)(p.ZP,{item:!0,xs:12,children:(0,b.jsx)(Z.Z,{})})]})})))}}]);
//# sourceMappingURL=5298.7f6bd750.chunk.js.map