"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4834],{97173:function(e,s,n){var t=n(49058),r=n(57223),o=n(73130),i=n(11927),l=n(4481),a=n(70466),c=n(18054);s.Z=(0,l.Z)((function(e){return(0,i.Z)((0,t.Z)({},a.xx))}))((function(e){var s=e.classes,n=e.label,t=void 0===n?"":n,i=e.content,l=e.multiLine,a=void 0!==l&&l;return(0,c.jsx)(r.Fragment,{children:(0,c.jsxs)(o.ZP,{className:s.prefinedContainer,children:[""!==t&&(0,c.jsx)(o.ZP,{item:!0,xs:12,className:s.predefinedTitle,children:t}),(0,c.jsx)(o.ZP,{item:!0,xs:12,className:s.predefinedList,children:(0,c.jsx)(o.ZP,{item:!0,xs:12,className:a?s.innerContentMultiline:s.innerContent,children:i})})]})})}))},74834:function(e,s,n){n.r(s);var t=n(77439),r=n(49058),o=n(57223),i=n(537),l=n(11927),a=n(4481),c=n(46266),d=n(39253),u=n(73130),x=n(70466),m=n(64519),Z=n(64964),j=n(82571),h=n(76701),f=n(97173),p=n(70783),b=n(18054),g={setModalErrorSnackMessage:m.zb},P=(0,i.$j)(null,g);s.default=(0,a.Z)((function(e){return(0,l.Z)((0,r.Z)((0,r.Z)({buttonContainer:{textAlign:"right"}},x.ID),x.DF))}))(P((function(e){var s=e.open,n=e.checkedUsers,r=e.closeModalAndRefresh,i=e.classes,l=e.setModalErrorSnackMessage,a=(0,o.useState)(!1),x=(0,t.Z)(a,2),m=x[0],g=x[1],P=(0,o.useState)(!1),v=(0,t.Z)(P,2),k=v[0],C=v[1],S=(0,o.useState)([]),N=(0,t.Z)(S,2),M=N[0],w=N[1];(0,o.useEffect)((function(){m&&(M.length>0?Z.Z.invoke("PUT","/api/v1/users-groups-bulk",{groups:M,users:n}).then((function(){g(!1),C(!0)})).catch((function(e){g(!1),l(e)})):(g(!1),l({errorMessage:"You need to select at least one group to assign",detailedError:""})))}),[m,g,r,M,n,l]);return(0,b.jsx)(h.Z,{modalOpen:s,onClose:function(){r(k)},title:k?"The selected users were added to the following groups.":"Add Users to Group",titleIcon:(0,b.jsx)(p.Zm,{}),children:k?(0,b.jsxs)(o.Fragment,{children:[(0,b.jsxs)(u.ZP,{container:!0,children:[(0,b.jsx)(f.Z,{label:"Groups",content:M.join(", ")}),(0,b.jsx)(f.Z,{label:"Users",content:n.join(", ")})]}),(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),(0,b.jsx)("br",{})]}):(0,b.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),g(!0)},children:(0,b.jsxs)(u.ZP,{container:!0,children:[(0,b.jsxs)(u.ZP,{item:!0,xs:12,className:i.modalFormScrollable,children:[(0,b.jsx)(u.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,b.jsx)(f.Z,{label:"Selected Users",content:n.join(", ")})}),(0,b.jsx)(u.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,b.jsx)(j.Z,{selectedGroups:M,setSelectedGroups:w})})]}),(0,b.jsxs)(u.ZP,{item:!0,xs:12,className:i.modalButtonBar,children:[(0,b.jsx)(c.Z,{type:"button",variant:"outlined",color:"primary",onClick:function(){w([])},children:"\u6e05\u9664"}),(0,b.jsx)(c.Z,{type:"submit",variant:"contained",color:"primary",disabled:m||M.length<1,children:"\u4fdd\u5b58"})]}),m&&(0,b.jsx)(u.ZP,{item:!0,xs:12,children:(0,b.jsx)(d.Z,{})})]})})})})))}}]);
//# sourceMappingURL=4834.a30f414d.chunk.js.map