"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9221],{64163:function(e,s,n){var t=n(1413),r=n(72791),l=n(61889),o=n(11135),i=n(25787),a=n(23814),c=n(80184);s.Z=(0,i.Z)((function(e){return(0,o.Z)((0,t.Z)({},a.xx))}))((function(e){var s=e.classes,n=e.label,t=void 0===n?"":n,o=e.content,i=e.multiLine,a=void 0!==i&&i,d=e.actionButton;return(0,c.jsx)(r.Fragment,{children:(0,c.jsxs)(l.ZP,{className:s.prefinedContainer,children:[""!==t&&(0,c.jsx)(l.ZP,{item:!0,xs:12,className:s.predefinedTitle,children:t}),(0,c.jsxs)(l.ZP,{item:!0,xs:12,className:"".concat(s.predefinedList," ").concat(d?s.includesActionButton:""),children:[(0,c.jsx)(l.ZP,{item:!0,xs:12,className:a?s.innerContentMultiline:s.innerContent,children:o}),d&&(0,c.jsx)("div",{className:s.overlayShareOption,children:d})]})]})})}))},49221:function(e,s,n){n.r(s);var t=n(29439),r=n(1413),l=n(72791),o=n(75952),i=n(11135),a=n(25787),c=n(40986),d=n(61889),u=n(23814),x=n(81207),m=n(83658),j=n(56028),Z=n(64163),f=n(38734),h=n(87995),p=n(25469),b=n(80184);s.default=(0,a.Z)((function(e){return(0,i.Z)((0,r.Z)((0,r.Z)({},u.ID),u.DF))}))((function(e){var s=e.open,n=e.checkedUsers,r=e.closeModalAndRefresh,i=e.classes,a=(0,p.TL)(),u=(0,l.useState)(!1),v=(0,t.Z)(u,2),g=v[0],P=v[1],k=(0,l.useState)(!1),C=(0,t.Z)(k,2),N=C[0],S=C[1],w=(0,l.useState)([]),F=(0,t.Z)(w,2),A=F[0],U=F[1];(0,l.useEffect)((function(){g&&(A.length>0?x.Z.invoke("PUT","/api/v1/users-groups-bulk",{groups:A,users:n}).then((function(){P(!1),S(!0)})).catch((function(e){P(!1),a((0,h.zb)(e))})):(P(!1),a((0,h.zb)({errorMessage:"You need to select at least one group to assign",detailedError:""}))))}),[g,P,r,A,n,a]);return(0,b.jsx)(j.Z,{modalOpen:s,onClose:function(){r(N)},title:N?"The selected users were added to the following groups.":"Add Users to Group",titleIcon:(0,b.jsx)(f.ZmA,{}),children:N?(0,b.jsxs)(l.Fragment,{children:[(0,b.jsxs)(d.ZP,{container:!0,children:[(0,b.jsx)(Z.Z,{label:"Groups",content:A.join(", ")}),(0,b.jsx)(Z.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(),P(!0)},children:(0,b.jsxs)(d.ZP,{container:!0,children:[(0,b.jsxs)(d.ZP,{item:!0,xs:12,className:i.modalFormScrollable,children:[(0,b.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,b.jsx)(Z.Z,{label:"Selected Users",content:n.join(", ")})}),(0,b.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,b.jsx)(m.Z,{selectedGroups:A,setSelectedGroups:U})})]}),(0,b.jsxs)(d.ZP,{item:!0,xs:12,className:i.modalButtonBar,children:[(0,b.jsx)(o.z,{id:"clear-bulk-add-group",type:"button",variant:"regular",color:"primary",onClick:function(){U([])},label:"Clear"}),(0,b.jsx)(o.z,{id:"save-add-group",type:"submit",variant:"callAction",disabled:g||A.length<1,label:"Save"})]}),g&&(0,b.jsx)(d.ZP,{item:!0,xs:12,children:(0,b.jsx)(c.Z,{})})]})})})}))}}]);
//# sourceMappingURL=9221.06d80718.chunk.js.map