Files
openmaxio-object-browser/portal-ui/build/static/js/4061.678a4eaa.chunk.js
Alex 3875fb3eaa Release v0.31.0 (#2912)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-06-29 12:21:34 -07:00

2 lines
22 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[4061,8896,9134],{81159:function(e,n,t){var i=t(4942),s=t(1413),o=t(72791),l=t(11135),a=t(25787),r=t(9955),c=t(30829),d=t(20068),u=t(20890),h=t(61889),m=t(23814),x=t(29945),f=t(28182),p=t(80184),b=(0,a.Z)((function(e){return{root:{width:50,height:24,padding:0,margin:0},switchBase:{padding:1,"&$checked":{transform:"translateX(24px)",color:e.palette.common.white,"& + $track":{backgroundColor:"#4CCB92",boxShadow:"inset 0px 1px 4px rgba(0,0,0,0.1)",opacity:1,border:"none"}},"&$focusVisible $thumb":{color:"#4CCB92",border:"6px solid #fff"}},thumb:{width:22,height:22,backgroundColor:"#FAFAFA",border:"2px solid #FFFFFF",marginLeft:1},track:{borderRadius:12,backgroundColor:"#E2E2E2",boxShadow:"inset 0px 1px 4px rgba(0,0,0,0.1)",opacity:1,transition:e.transitions.create(["background-color","border"])},checked:{},focusVisible:{},switchContainer:{display:"flex",alignItems:"center",justifyContent:"flex-end"}}}))(r.Z);n.Z=(0,a.Z)((function(e){return(0,l.Z)((0,s.Z)((0,s.Z)({indicatorLabelOn:{fontWeight:"bold",color:"#081C42 !important"},indicatorLabel:{fontSize:12,color:"#E2E2E2",margin:"0 8px 0 10px"},fieldDescription:{marginTop:4,color:"#999999"},tooltip:{fontSize:16}},m.OR),m.YI))}))((function(e){var n=e.label,t=void 0===n?"":n,l=e.onChange,a=e.value,r=e.id,m=e.name,g=e.checked,Z=void 0!==g&&g,v=e.disabled,j=void 0!==v&&v,y=e.switchOnly,C=void 0!==y&&y,P=e.tooltip,S=void 0===P?"":P,N=e.description,k=void 0===N?"":N,F=e.classes,w=e.indicatorLabels,A=e.extraInputProps,L=void 0===A?{}:A,E=(0,p.jsxs)(o.Fragment,{children:[!C&&(0,p.jsx)("span",{className:(0,f.Z)(F.indicatorLabel,(0,i.Z)({},F.indicatorLabelOn,!Z)),children:w&&w.length>1?w[1]:"OFF"}),(0,p.jsx)(b,{checked:Z,onChange:l,color:"primary",name:m,inputProps:(0,s.Z)({"aria-label":"primary checkbox"},L),disabled:j,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,value:a,id:r}),!C&&(0,p.jsx)("span",{className:(0,f.Z)(F.indicatorLabel,(0,i.Z)({},F.indicatorLabelOn,Z)),children:w?w[0]:"ON"})]});return C?E:(0,p.jsx)("div",{children:(0,p.jsxs)(h.ZP,{container:!0,alignItems:"center",children:[(0,p.jsx)(h.ZP,{item:!0,xs:12,sm:8,md:8,children:""!==t&&(0,p.jsxs)(c.Z,{htmlFor:r,className:F.inputLabel,children:[(0,p.jsx)("span",{children:t}),""!==S&&(0,p.jsx)("div",{className:F.tooltipContainer,children:(0,p.jsx)(d.Z,{title:S,placement:"top-start",children:(0,p.jsx)("div",{className:F.tooltip,children:(0,p.jsx)(x.byK,{})})})})]})}),(0,p.jsx)(h.ZP,{item:!0,xs:12,sm:""!==t?4:12,md:""!==t?4:12,textAlign:"right",justifyContent:"end",className:F.switchContainer,children:E}),""!==k&&(0,p.jsx)(h.ZP,{item:!0,xs:12,textAlign:"left",children:(0,p.jsx)(u.Z,{component:"p",className:F.fieldDescription,children:k})})]})})}))},64163:function(e,n,t){var i=t(1413),s=t(72791),o=t(61889),l=t(11135),a=t(25787),r=t(23814),c=t(80184);n.Z=(0,a.Z)((function(e){return(0,l.Z)((0,i.Z)({},r.xx))}))((function(e){var n=e.classes,t=e.label,i=void 0===t?"":t,l=e.content,a=e.multiLine,r=void 0!==a&&a,d=e.actionButton;return(0,c.jsx)(s.Fragment,{children:(0,c.jsxs)(o.ZP,{className:n.prefinedContainer,children:[""!==i&&(0,c.jsx)(o.ZP,{item:!0,xs:12,className:n.predefinedTitle,children:i}),(0,c.jsxs)(o.ZP,{item:!0,xs:12,className:"".concat(n.predefinedList," ").concat(d?n.includesActionButton:""),children:[(0,c.jsx)(o.ZP,{item:!0,xs:12,className:r?n.innerContentMultiline:n.innerContent,children:l}),d&&(0,c.jsx)("div",{className:n.overlayShareOption,children:d})]})]})})}))},60680:function(e,n,t){t(72791);var i=t(11135),s=t(25787),o=t(80184);n.Z=(0,s.Z)((function(e){return(0,i.Z)({root:{padding:0,margin:0,fontSize:".9rem"}})}))((function(e){var n=e.classes,t=e.children;return(0,o.jsx)("h1",{className:n.root,children:t})}))},14917:function(e,n,t){t(72791);var i=t(61889),s=t(72455),o=t(80184),l=(0,s.Z)((function(e){return{headerBarIcon:{marginRight:".7rem",color:e.palette.primary.main,"& .min-icon":{width:44,height:44},"@media (max-width: 600px)":{display:"none"}},headerBarSubheader:{color:"grey","@media (max-width: 900px)":{maxWidth:200}},stContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:8,borderBottom:"1px solid #EAEAEA","@media (max-width: 600px)":{flexFlow:"column"}},titleColumn:{height:"auto",justifyContent:"center",display:"flex",flexFlow:"column",alignItems:"flex-start","& h1":{fontSize:19}},leftItems:{display:"flex",alignItems:"center","@media (max-width: 600px)":{flexFlow:"column",width:"100%"}},rightItems:{display:"flex",alignItems:"center","& button":{marginLeft:8},"@media (max-width: 600px)":{width:"100%"}}}}));n.Z=function(e){var n=e.icon,t=e.title,s=e.subTitle,a=e.actions,r=e.className,c=l();return(0,o.jsx)(i.ZP,{container:!0,children:(0,o.jsxs)(i.ZP,{item:!0,xs:12,className:"".concat(c.stContainer," ").concat(r||""),children:[(0,o.jsxs)("div",{className:c.leftItems,children:[n?(0,o.jsx)("div",{className:c.headerBarIcon,children:n}):null,(0,o.jsxs)("div",{className:c.titleColumn,children:[(0,o.jsx)("h1",{style:{margin:0},children:t}),(0,o.jsx)("span",{className:c.headerBarSubheader,children:s})]})]}),(0,o.jsx)("div",{className:c.rightItems,children:a})]})})}},50276:function(e,n,t){var i=t(1413),s=t(29439),o=t(72791),l=t(64554),a=t(43896),r=t(83449),c=t(47283),d=t(82851),u=t(25787),h=t(13967),m=t(11135),x=t(95193),f=t(57689),p=t(80184),b={minHeight:60};n.Z=(0,u.Z)((function(e){return(0,m.Z)({tabsContainer:{display:"flex",height:"100%",width:"100%"},tabsHeaderContainer:{width:"300px",background:"#F8F8F8",borderRight:"1px solid #EAEAEA","& .MuiTabs-root":{"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{display:"flex",flexFlow:"row",alignItems:"center",justifyContent:"flex-start",borderBottom:"1px solid #EAEAEA","& .MuiSvgIcon-root":{marginRight:8,marginBottom:0},"&.Mui-selected":{background:"#E5E5E5",fontWeight:600}},"&. MuiTabs-scroller":{display:"none"}}},tabContentContainer:{width:"100%","& .MuiTabPanel-root":{height:"100%"}},tabPanel:{height:"100%"},"@media (max-width: 900px)":{tabsContainer:{flexFlow:"column",flexDirection:"column"},tabsHeaderContainer:{width:"100%",borderBottom:" 1px solid #EAEAEA","& .MuiTabs-root .MuiTabs-scroller .MuiButtonBase-root":{borderBottom:" 0px"}}}})}))((function(e){var n=e.children,t=e.classes,u=e.selectedTab,m=void 0===u?"0":u,g=e.routes,Z=e.isRouteTabs,v=(0,h.Z)(),j=(0,f.TH)().pathname,y=void 0===j?"":j,C=(0,x.Z)(v.breakpoints.down("md")),P=(0,o.useState)(m),S=(0,s.Z)(P,2),N=S[0],k=S[1],F=[],w=[];if((0,o.useEffect)((function(){if(Z){var e=n.find((function(e){return e.tabConfig.to===y}));e&&k(e.tabConfig.value)}}),[Z,n,y]),!n)return null;n.forEach((function(e){F.push(e.tabConfig),w.push(e.content)}));return(0,p.jsx)(r.ZP,{value:"".concat(N),children:(0,p.jsxs)(l.Z,{className:t.tabsContainer,children:[(0,p.jsx)(l.Z,{className:t.tabsHeaderContainer,children:(0,p.jsx)(c.Z,{onChange:function(e,n){k(n)},orientation:C?"horizontal":"vertical",variant:C?"scrollable":"standard",scrollButtons:"auto",className:t.tabList,children:F.map((function(e,n){return e?(0,p.jsx)(a.Z,(0,i.Z)((0,i.Z)({className:t.tabHeader,value:"".concat(n),style:b},e),{},{disableRipple:!0,disableTouchRipple:!0,focusRipple:!0}),"v-tab-".concat(n)):null}))})}),(0,p.jsxs)(l.Z,{className:t.tabContentContainer,children:[Z?null:w.map((function(e,n){return(0,p.jsx)(d.Z,{classes:(0,i.Z)({},t.tabPanel),value:"".concat(n),children:e||null},"v-tab-p-".concat(n))})),Z?(0,p.jsx)("div",{className:t.tabPanel,children:g}):null]})]})})}))},88896:function(e,n,t){t.r(n);var i=t(37762),s=t(29439),o=(t(72791),t(51691)),l=t(23508),a=t(9505),r=t(29945),c=t(45248),d=t(87995),u=t(81551),h=t(80184);n.default=function(e){var n=e.selectedGroups,t=e.deleteOpen,m=e.closeDeleteModalAndRefresh,x=(0,u.TL)(),f=(0,a.Z)((function(){return m(!0)}),(function(e){x((0,d.Ih)(e)),m(!1)})),p=(0,s.Z)(f,2),b=p[0],g=p[1];if(!n)return null;var Z=n.map((function(e){return(0,h.jsx)("div",{children:(0,h.jsx)("b",{children:e})},e)}));return(0,h.jsx)(l.Z,{title:"Delete Group".concat(n.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,h.jsx)(r.NvT,{}),isLoading:b,onConfirm:function(){var e,t=(0,i.Z)(n);try{for(t.s();!(e=t.n()).done;){var s=e.value;g("DELETE","/api/v1/group/".concat((0,c.LL)(s)))}}catch(o){t.e(o)}finally{t.f()}},onClose:function(){return m(!1)},confirmationContent:(0,h.jsxs)(o.Z,{children:["Are you sure you want to delete the following ",n.length," ","group",n.length>1?"s?":"?",Z]})})}},94061:function(e,n,t){t.r(n),t.d(n,{default:function(){return I},formatPolicy:function(){return R}});var i=t(29439),s=t(1413),o=t(72791),l=t(57689),a=t(29945),r=t(11135),c=t(23814),d=t(25787),u=t(61889),h=t(14917),m=t(92983),x=t(81207),f=t(39134),p=t(40228),b=t(56028),g=t(64163),Z=t(45248),v=t(87995),j=t(81551),y=t(80184),C=(0,d.Z)((function(e){return(0,r.Z)((0,s.Z)((0,s.Z)((0,s.Z)({userSelector:{"& .MuiPaper-root":{padding:0,marginBottom:15}}},c.ID),c.DF),c.oO))}))((function(e){var n=e.classes,t=e.title,s=void 0===t?"":t,l=e.groupStatus,r=void 0===l?"enabled":l,c=e.preSelectedUsers,d=void 0===c?[]:c,h=e.selectedGroup,m=void 0===h?"":h,f=e.open,C=e.onClose,P=(0,j.TL)(),S=(0,o.useState)(d),N=(0,i.Z)(S,2),k=N[0],F=N[1];return(0,y.jsxs)(b.Z,{modalOpen:f,onClose:C,title:s,titleIcon:(0,y.jsx)(a.ZmA,{}),children:[(0,y.jsx)(u.ZP,{container:!0,children:(0,y.jsxs)(u.ZP,{item:!0,xs:12,children:[(0,y.jsx)("div",{className:n.formFieldRow,children:(0,y.jsx)(g.Z,{label:"Selected Group",content:m})}),(0,y.jsx)("div",{className:n.userSelector,children:(0,y.jsx)(p.Z,{selectedUsers:k,setSelectedUsers:F,editMode:!m})})]})}),(0,y.jsxs)(u.ZP,{item:!0,xs:12,className:n.modalButtonBar,children:[(0,y.jsx)(a.zxk,{id:"reset-add-group-member",type:"button",variant:"regular",onClick:function(){F(d)},label:"Reset"}),(0,y.jsx)(a.zxk,{id:"save-add-group-member",type:"button",variant:"callAction",onClick:function(){x.Z.invoke("PUT","/api/v1/group/".concat((0,Z.LL)(m)),{group:m,members:k,status:r}).then((function(e){C()})).catch((function(e){C(),P((0,v.zb)(e))}))},label:"Save"})]})]})})),P=t(88896),S=t(50276),N=t(81159),k=t(60680),F=t(59114),w=t(56087),A=t(38442),L=t(47974),E=t(99670),T=function(){var e=(0,l.s0)(),n=(0,j.TL)();return(0,o.useEffect)((function(){n((0,v.Sc)("group_details"))}),[]),(0,y.jsx)(L.Z,{label:(0,y.jsx)(o.Fragment,{children:(0,y.jsx)(a.hbI,{label:"Groups",onClick:function(){return e(w.gA.GROUPS)}})}),actions:(0,y.jsx)(E.Z,{})})},B=t(74616),M=t(27454),R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length<=0?[]:e.split(",")},I=(0,d.Z)((function(e){return(0,r.Z)((0,s.Z)((0,s.Z)((0,s.Z)({pageContainer:{border:"1px solid #EAEAEA",width:"100%"},statusLabel:{fontSize:".8rem",marginRight:".7rem"},statusValue:{fontWeight:"bold",fontSize:".9rem",marginRight:".7rem"},searchField:(0,s.Z)((0,s.Z)({},c.qg.searchField),{},{maxWidth:280})},c.VX),c.bK),{},{actionsTray:(0,s.Z)((0,s.Z)({},c.OR.actionsTray),{},{alignItems:"center","& h1":{flex:1},"& button":{marginLeft:".8rem"},"@media (max-width: 900px)":{justifyContent:"flex-end","& h1":{display:"none"},"& button":{whiteSpace:"nowrap",textOverflow:"ellipsis"}}})},c.Bz))}))((function(e){var n=e.classes,t=(0,j.TL)(),s=(0,l.s0)(),r=(0,l.UO)(),c=(0,o.useState)({}),d=(0,i.Z)(c,2),p=d[0],b=d[1],g=(0,o.useState)(!1),L=(0,i.Z)(g,2),E=L[0],I=L[1],U=(0,o.useState)(!1),z=(0,i.Z)(U,2),O=z[0],K=z[1],G=(0,o.useState)(!1),D=(0,i.Z)(G,2),H=D[0],V=D[1],X=(0,o.useState)(""),_=(0,i.Z)(X,2),W=_[0],$=_[1],Y=(0,Z.IO)(r.groupName||""),q=p.members,Q=void 0===q?[]:q,J=p.policy,ee=void 0===J?"":J,ne=p.status,te=Q.filter((function(e){return e.includes(W)})),ie=(0,A.F)(w.C3,w.iw,!0);(0,o.useEffect)((function(){t((0,v.Sc)("groups_members"))}),[]),(0,o.useEffect)((function(){Y&&ue()}),[Y]);var se=R(ee),oe="enabled"===ne,le=Q.length>0?"Edit Members":"Add Members",ae=(0,A.F)(w.C3,w.k_),re=(0,A.F)(w.C3,w.kt,!0),ce=(0,A.F)(w.C3,w.UA,!0),de=(0,A.F)(w.C3,w.GD,!0);function ue(){ae&&x.Z.invoke("GET","/api/v1/group/".concat((0,Z.LL)(Y))).then((function(e){b(e)})).catch((function(e){t((0,v.zb)(e)),b({})}))}var he=(0,y.jsxs)(o.Fragment,{children:[(0,y.jsxs)("div",{className:n.actionsTray,onMouseMove:function(){t((0,v.Sc)("groups_members"))},children:[(0,y.jsx)(k.Z,{children:"Members"}),(0,y.jsx)(F.Z,{placeholder:"Search members",onChange:function(e){$(e)},overrideClass:n.searchField,value:W}),(0,y.jsx)(A.s,{resource:w.C3,scopes:w.uH,errorProps:{disabled:!0},children:(0,y.jsx)(M.Z,{tooltip:re?le:(0,w.MK)(w.vN,"edit Group membership"),children:(0,y.jsx)(a.zxk,{id:"add-user-group",label:le,variant:"callAction",icon:(0,y.jsx)(a.dtP,{}),onClick:function(){K(!0)},disabled:!re})})})]}),(0,y.jsx)(u.ZP,{item:!0,xs:12,children:(0,y.jsx)(A.s,{resource:w.C3,scopes:w.Rs,errorProps:{disabled:!0},children:(0,y.jsx)(m.Z,{itemActions:[{type:"view",onClick:function(e){s("".concat(w.gA.USERS,"/").concat((0,Z.LL)(e)))},disableButtonFunction:function(){return!ie}}],columns:[{label:"Access Key",elementKey:""}],selectedItems:[],isLoading:!1,records:te,entityName:"Users",idField:"",tooltip:ie?"":(0,w.MK)(w.iw,"view User details")})})})]}),me=(0,y.jsxs)(o.Fragment,{children:[(0,y.jsxs)("div",{className:n.actionsTray,onMouseMove:function(){t((0,v.Sc)("groups_policies"))},children:[(0,y.jsx)(k.Z,{children:"Policies"}),(0,y.jsx)(M.Z,{tooltip:ce?"Set Policies":(0,w.MK)(w.UA,"assign Policies"),children:(0,y.jsx)(a.zxk,{id:"set-policies",label:"Set Policies",variant:"callAction",icon:(0,y.jsx)(a.v42,{}),onClick:function(){I(!0)},disabled:!ce})})]}),(0,y.jsx)(u.ZP,{item:!0,xs:12,children:(0,y.jsx)(m.Z,{itemActions:[{type:"view",onClick:function(e){s("".concat(w.gA.POLICIES,"/").concat((0,Z.LL)(e)))},disableButtonFunction:function(){return!de}}],columns:[{label:"Policy",elementKey:""}],isLoading:!1,records:se,entityName:"Policies",idField:"",tooltip:de?"":(0,w.MK)(w.GD,"view Policy details")})})]});return(0,y.jsxs)(o.Fragment,{children:[(0,y.jsx)(T,{}),(0,y.jsxs)(a.Xgh,{className:n.pageContainer,children:[(0,y.jsx)(u.ZP,{item:!0,xs:12,children:(0,y.jsx)(h.Z,{icon:(0,y.jsx)(o.Fragment,{children:(0,y.jsx)(a.wws,{width:40})}),title:Y,subTitle:null,actions:(0,y.jsxs)(o.Fragment,{children:[(0,y.jsx)("span",{className:n.statusLabel,children:"Group Status:"}),(0,y.jsx)("span",{id:"group-status",className:n.statusValue,children:oe?"Enabled":"Disabled"}),(0,y.jsx)(M.Z,{tooltip:(0,A.F)(w.C3,w.xh,!0)?"":(0,w.MK)(w.xh,"enable or disable Groups"),children:(0,y.jsx)(A.s,{resource:w.C3,scopes:w.xh,errorProps:{disabled:!0},matchAll:!0,children:(0,y.jsx)(N.Z,{indicatorLabels:["Enabled","Disabled"],checked:oe,value:"group_enabled",id:"group-status",name:"group-status",onChange:function(){var e;e=!oe,x.Z.invoke("PUT","/api/v1/group/".concat((0,Z.LL)(Y)),{group:Y,members:Q,status:e?"enabled":"disabled"}).then((function(e){ue()})).catch((function(e){t((0,v.zb)(e))}))},switchOnly:!0})})}),(0,y.jsx)("div",{className:n.spacerLeft,children:(0,y.jsx)(M.Z,{tooltip:"Delete Group",children:(0,y.jsx)(a.zxk,{id:"delete-user-group",variant:"secondary",icon:(0,y.jsx)(a.XHJ,{}),onClick:function(){V(!0)}})})})]})})}),(0,y.jsx)(u.ZP,{item:!0,xs:12,children:(0,y.jsxs)(S.Z,{children:[{tabConfig:{label:"Members"},content:he},{tabConfig:{label:"Policies"},content:me}]})})]}),E?(0,y.jsx)(f.default,{open:E,selectedGroups:[Y],selectedUser:null,closeModalAndRefresh:function(){I(!1),ue(),t((0,B.ue)([]))}}):null,O?(0,y.jsx)(C,{selectedGroup:Y,onSaveClick:function(){},title:le,groupStatus:ne,preSelectedUsers:Q,open:O,onClose:function(){K(!1),ue()}}):null,H&&(0,y.jsx)(P.default,{deleteOpen:H,selectedGroups:[Y],closeDeleteModalAndRefresh:function(e){V(!1),e&&s(w.gA.GROUPS)}})]})}))},40228:function(e,n,t){var i=t(93433),s=t(29439),o=t(1413),l=t(72791),a=t(11135),r=t(25787),c=t(40986),d=t(26181),u=t.n(d),h=t(35527),m=t(61889),x=t(21639),f=t(23814),p=t(81207),b=t(92983),g=t(59114),Z=t(87995),v=t(81551),j=t(80184);n.Z=(0,r.Z)((function(e){return(0,a.Z)((0,o.Z)((0,o.Z)({paper:{display:"flex",overflow:"auto",flexDirection:"column",boxShadow:"none",border:0},tableBlock:(0,o.Z)({},f.VX.tableBlock),searchBox:{flex:1}},f.OR),{},{actionsTitle:{fontSize:14,alignSelf:"center",minWidth:160,marginRight:10},noFound:{textAlign:"center",padding:e.spacing(3),border:"1px solid #EAEAEA",fontSize:".9rem"}},f.jY))}))((function(e){var n=e.classes,t=e.selectedUsers,o=e.setSelectedUsers,a=e.editMode,r=void 0!==a&&a,d=(0,v.TL)(),f=(0,l.useState)([]),y=(0,s.Z)(f,2),C=y[0],P=y[1],S=(0,l.useState)(!1),N=(0,s.Z)(S,2),k=N[0],F=N[1],w=(0,l.useState)(""),A=(0,s.Z)(w,2),L=A[0],E=A[1],T=(0,l.useCallback)((function(){p.Z.invoke("GET","/api/v1/users").then((function(e){var n=u()(e,"users",[]);n||(n=[]),P(n.sort(x.LQ)),F(!1)})).catch((function(e){d((0,Z.zb)(e)),F(!1)}))}),[d]);(0,l.useEffect)((function(){F(!0)}),[]),(0,l.useEffect)((function(){k&&T()}),[k,T]);var B=t||[],M=C.filter((function(e){return e.accessKey.includes(L)}));return(0,j.jsx)(l.Fragment,{children:(0,j.jsx)(m.ZP,{item:!0,xs:12,children:(0,j.jsxs)(h.Z,{className:n.paper,children:[k&&(0,j.jsx)(c.Z,{}),null!==C&&C.length>0?(0,j.jsxs)(l.Fragment,{children:[(0,j.jsxs)(m.ZP,{item:!0,xs:12,className:n.actionsTray,children:[(0,j.jsx)("label",{className:n.actionsTitle,children:r?"Edit Members":"Assign Users"}),(0,j.jsx)("div",{className:n.searchBox,children:(0,j.jsx)(g.Z,{placeholder:"Filter Users",onChange:E,value:L})})]}),(0,j.jsx)(m.ZP,{item:!0,xs:12,className:n.tableBlock,children:(0,j.jsx)(b.Z,{columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:function(e){var n=e.target,t=n.value,s=n.checked,l=(0,i.Z)(B);return s?l.push(t):l=l.filter((function(e){return e!==t})),o(l),l},selectedItems:B,isLoading:k,records:M,entityName:"Users",idField:"accessKey",customPaperHeight:n.multiSelectTable})})]}):(0,j.jsx)("div",{className:n.noFound,children:"No Users to display"})]})})})}))},58400:function(e,n,t){var i=t(93433),s=t(29439),o=t(1413),l=t(72791),a=t(11135),r=t(25787),c=t(40986),d=t(61889),u=t(21639),h=t(23814),m=t(92983),x=t(59114),f=t(87995),p=t(81551),b=t(74616),g=t(78687),Z=t(31776),v=t(80184);n.Z=(0,r.Z)((function(e){return(0,a.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({noFound:{textAlign:"center",padding:"10px 0"},searchBox:{flex:1},fieldLabel:{fontWeight:400,width:160,marginRight:10},tableBlock:(0,o.Z)({},h.VX.tableBlock),filterBox:{display:"flex",marginBottom:15,alignItems:"center","& span":{fontSize:14}}},h.qg),h.VX),h.OR),h.jY))}))((function(e){var n=e.classes,t=e.noTitle,o=void 0!==t&&t,a=(0,p.TL)(),r=(0,l.useState)([]),h=(0,s.Z)(r,2),j=h[0],y=h[1],C=(0,l.useState)(!1),P=(0,s.Z)(C,2),S=P[0],N=P[1],k=(0,l.useState)(""),F=(0,s.Z)(k,2),w=F[0],A=F[1],L=(0,g.v9)((function(e){return e.createUser.selectedPolicies})),E=(0,l.useCallback)((function(){N(!0),Z.h.policies.listPolicies().then((function(e){var n,t=null!==(n=e.data.policies)&&void 0!==n?n:[];N(!1),y(t.sort(u.g4))})).catch((function(e){N(!1),a((0,f.zb)(e))}))}),[a]);(0,l.useEffect)((function(){N(!0)}),[]),(0,l.useEffect)((function(){S&&E()}),[S,E]);var T=j.filter((function(e){return e.name.includes(w)}));return(0,v.jsx)(d.ZP,{container:!0,children:(0,v.jsxs)(d.ZP,{item:!0,xs:12,children:[S&&(0,v.jsx)(c.Z,{}),j.length>0?(0,v.jsxs)(l.Fragment,{children:[(0,v.jsxs)(d.ZP,{item:!0,xs:12,className:n.filterBox,children:[!o&&(0,v.jsx)("span",{className:n.fieldLabel,children:"Assign Policies"}),(0,v.jsx)("div",{className:n.searchBox,children:(0,v.jsx)(x.Z,{placeholder:"Start typing to search for a Policy",onChange:function(e){A(e)},value:w})})]}),(0,v.jsx)(d.ZP,{item:!0,xs:12,className:n.tableBlock,style:{paddingBottom:16},children:(0,v.jsx)(m.Z,{columns:[{label:"Policy",elementKey:"name"}],onSelect:function(e){var n=e.target,t=n.value,s=n.checked,o=(0,i.Z)(L);s?o.push(t):o=o.filter((function(e){return e!==t})),o=o.filter((function(e){return""!==e})),a((0,b.ue)(o))},selectedItems:L,isLoading:S,records:T,entityName:"Policies",idField:"name",customPaperHeight:n.multiSelectTable})})]}):(0,v.jsx)("div",{className:n.noFound,children:"No Policies Available"})]})})}))},39134:function(e,n,t){t.r(n);var i=t(29439),s=t(1413),o=t(72791),l=t(26181),a=t.n(l),r=t(29945),c=t(11135),d=t(25787),u=t(40986),h=t(61889),m=t(23814),x=t(56028),f=t(81207),p=t(58400),b=t(64163),g=t(45248),Z=t(87995),v=t(81551),j=t(78687),y=t(74616),C=t(80184);n.default=(0,d.Z)((function(e){return(0,c.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},m.oO),m.bK),{},{tableBlock:(0,s.Z)((0,s.Z)({},m.VX.tableBlock),{},{marginTop:15}),buttonContainer:{display:"flex",justifyContent:"flex-end",marginTop:".9rem","& button":{marginLeft:8}}}))}))((function(e){var n=e.classes,t=e.closeModalAndRefresh,s=e.selectedUser,l=e.selectedGroups,c=e.open,d=(0,v.TL)(),m=(0,o.useState)(!1),P=(0,i.Z)(m,2),S=P[0],N=P[1],k=(0,o.useState)([]),F=(0,i.Z)(k,2),w=F[0],A=F[1],L=(0,o.useState)([]),E=(0,i.Z)(L,2),T=E[0],B=E[1],M=(0,j.v9)((function(e){return e.createUser.selectedPolicies}));(0,o.useEffect)((function(){if(c){if(1===(null===l||void 0===l?void 0:l.length))return void(1===(null===l||void 0===l?void 0:l.length)&&f.Z.invoke("GET","/api/v1/group/".concat((0,g.LL)(l[0]))).then((function(e){var n=a()(e,"policy","");A(n.split(",")),B(n.split(",")),d((0,y.ue)(n.split(",")))})).catch((function(e){d((0,Z.zb)(e)),N(!1)})));var e=a()(s,"policy",[]);A(e),B(e),d((0,y.ue)(e))}}),[c,null===l||void 0===l?void 0:l.length,s]);var R=a()(s,"accessKey","");return(0,C.jsxs)(x.Z,{onClose:function(){t()},modalOpen:c,title:"Set Policies",children:[(0,C.jsxs)(h.ZP,{container:!0,children:[(1===(null===l||void 0===l?void 0:l.length)||null!=s)&&(0,C.jsxs)(o.Fragment,{children:[(0,C.jsx)(h.ZP,{item:!0,xs:12,children:(0,C.jsx)(b.Z,{label:"Selected ".concat(null!==l?"Group":"User"),content:null!==l?l[0]:R})}),(0,C.jsx)(h.ZP,{item:!0,xs:12,children:(0,C.jsx)(b.Z,{label:"Current Policy",content:w.join(", ")})})]}),l&&(null===l||void 0===l?void 0:l.length)>1&&(0,C.jsx)(b.Z,{label:"Selected Groups",content:l.join(", ")}),(0,C.jsx)(h.ZP,{item:!0,xs:12,children:(0,C.jsx)("div",{className:n.tableBlock,children:(0,C.jsx)(p.Z,{selectedPolicy:T})})})]}),(0,C.jsxs)(h.ZP,{item:!0,xs:12,className:n.buttonContainer,children:[(0,C.jsx)(r.zxk,{id:"reset",type:"button",variant:"regular",className:n.spacerRight,onClick:function(){B(w),d((0,y.ue)(w))},label:"Reset"}),(0,C.jsx)(r.zxk,{id:"save",type:"button",variant:"callAction",color:"primary",disabled:S,onClick:function(){var e=null,n=null;null!==l?n=l:null!==s&&(e=[s.accessKey]||0),N(!0),f.Z.invoke("PUT","/api/v1/set-policy-multi",{name:M,groups:n,users:e}).then((function(){N(!1),t()})).catch((function(e){N(!1),d((0,Z.zb)(e))}))},label:"Save"})]}),S&&(0,C.jsx)(h.ZP,{item:!0,xs:12,children:(0,C.jsx)(u.Z,{})})]})}))},21639:function(e,n,t){t.d(n,{KE:function(){return l},LQ:function(){return i},V2:function(){return o},g4:function(){return s}});var i=function(e,n){return e.accessKey>n.accessKey?1:e.accessKey<n.accessKey?-1:0},s=function(e,n){return e.name>n.name?1:e.name<n.name?-1:0},o=function(e,n){return e>n?1:e<n?-1:0},l=function(e,n){return e.policy>n.policy?1:e.policy<n.policy?-1:0}}}]);
//# sourceMappingURL=4061.678a4eaa.chunk.js.map