Files
openmaxio-object-browser/web-app/build/static/js/1324.b4c459ae.chunk.js

2 lines
12 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1324,4705,5851],{94141:(e,s,t)=>{t.d(s,{A:()=>d});var l=t(65043),n=t(22166),i=t(89923),o=t(21383),r=t(64159),c=t(49555),a=t(70579);const d=e=>{let{onClose:s,modalOpen:t,title:d,children:u,wideLimit:p=!0,titleIcon:x=null,iconColor:h="default",sx:m}=e;const j=(0,o.jL)(),[g,b]=(0,l.useState)(!1),y=(0,n.d4)((e=>e.system.modalSnackBar));(0,l.useEffect)((()=>{j((0,r.h0)(""))}),[j]),(0,l.useEffect)((()=>{if(y){if(""===y.message)return void b(!1);"error"!==y.type&&b(!0)}}),[y]);let f="";return y&&(f=y.detailedErrorMsg,(""===f||f&&f.length<5)&&(f=y.message)),(0,a.jsxs)(i.ngX,{onClose:s,open:t,title:d,titleIcon:x,widthLimit:p,sx:m,iconColor:h,children:[(0,a.jsx)(c.A,{isModal:!0}),(0,a.jsx)(i.qb_,{onClose:()=>{b(!1),j((0,r.h0)(""))},open:g,message:f,mode:"inline",variant:"error"===y.type?"error":"default",autoHideDuration:"error"===y.type?10:5,condensed:!0}),u]})}},85851:(e,s,t)=>{t.r(s),t.d(s,{default:()=>u});var l=t(65043),n=t(89923),i=t(64159),o=t(21383),r=t(58661),c=t(56629),a=t(53518),d=t(70579);const u=e=>{let{selectedGroups:s,deleteOpen:t,closeDeleteModalAndRefresh:u}=e;const p=(0,o.jL)(),[x,h]=(0,l.useState)(!1);if(!s)return null;const m=s.map((e=>(0,d.jsx)("div",{children:(0,d.jsx)("b",{children:e})},e)));return(0,d.jsx)(r.A,{title:"Delete Group"+(s.length>1?"s":""),confirmText:"Delete",isOpen:t,titleIcon:(0,d.jsx)(n.xWY,{}),isLoading:x,onConfirm:()=>{for(let e of s)h(!0),c.F.group.removeGroup(e).then((e=>{u(!0)})).catch((async e=>{const s=await e.json();p((0,i.C9)((0,a.S)(s))),u(!1)})).finally((()=>h(!1)))},onClose:()=>u(!1),confirmationContent:(0,d.jsxs)(l.Fragment,{children:["Are you sure you want to delete the following"," ",1===s.length?"":s.length," group",s.length>1?"s?":"?",m]})})}},91324:(e,s,t)=>{t.r(s),t.d(s,{default:()=>C});var l=t(65043),n=t(73216),i=t(89923),o=t(56629),r=t(53518),c=t(99161),a=t(77938),d=t(64159),u=t(21383),p=t(62560),x=t(74705),h=t(77403),m=t(22923),j=t(94141),g=t(70579);const b=e=>{let{title:s="",groupStatus:t="enabled",preSelectedUsers:n=[],selectedGroup:c="",open:a,onClose:p}=e;const x=(0,u.jL)(),[b,y]=(0,l.useState)(n);return(0,g.jsxs)(j.A,{modalOpen:a,onClose:p,title:s,titleIcon:(0,g.jsx)(i.WC,{}),children:[(0,g.jsxs)(i.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,g.jsx)(i.EmB,{label:"Selected Group",sx:{width:"100%"},children:c}),(0,g.jsx)(m.A,{selectedUsers:b,setSelectedUsers:y,editMode:!c})]}),(0,g.jsxs)(i.xA9,{item:!0,xs:12,sx:h.Uz.modalButtonBar,children:[(0,g.jsx)(i.$nd,{id:"reset-add-group-member",type:"button",variant:"regular",onClick:()=>{y(n)},label:"Reset"}),(0,g.jsx)(i.$nd,{id:"save-add-group-member",type:"button",variant:"callAction",onClick:()=>{o.F.group.updateGroup(c,{members:b,status:t}).then((()=>{p()})).catch((e=>{p(),x((0,d.Dy)((0,r.S)(e.error)))}))},label:"Save"})]})]})};var y=t(85851),f=t(64681),v=t(6681),A=t(88617),S=t(48793);const C=()=>{const e=(0,u.jL)(),s=(0,n.Zp)(),t=(0,n.g)(),[h,m]=(0,l.useState)({}),[j,C]=(0,l.useState)(!1),[P,G]=(0,l.useState)(!1),[M,U]=(0,l.useState)(!1),[k,w]=(0,l.useState)(""),[E,L]=(0,l.useState)("members"),{members:z=[],policy:D="",status:I}=h,N=z.filter((e=>e.includes(k))),R=(0,a._)(c.Ms,c.Ld,!0);(0,l.useEffect)((()=>{e((0,d.ph)("group_details"))}),[]),(0,l.useEffect)((()=>{t.groupName&&J()}),[t.groupName]);const F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length<=0?[]:e.split(",")}(D),B="enabled"===I,K=z.length>0?"Edit Members":"Add Members",_=(0,a._)(c.Ms,c.Oh),O=(0,a._)(c.Ms,c.Hr,!0),$=(0,a._)(c.Ms,c.QR,!0),H=(0,a._)(c.Ms,c.yv,!0);function J(){_&&o.F.group.groupInfo(t.groupName||"").then((e=>{m(e.data)})).catch((s=>{e((0,d.Dy)((0,r.S)(s.error))),m({})}))}const T=(0,g.jsxs)(i.azJ,{onMouseMove:()=>{e((0,d.ph)("groups_members"))},children:[(0,g.jsx)(i._xt,{separator:!0,sx:{marginBottom:15},actions:(0,g.jsxs)(i.azJ,{sx:{display:"flex",gap:10},children:[(0,g.jsx)(f.A,{placeholder:"Search members",onChange:e=>{w(e)},value:k,sx:{maxWidth:280}}),(0,g.jsx)(a.R,{resource:c.Ms,scopes:c.BD,errorProps:{disabled:!0},chi
//# sourceMappingURL=1324.b4c459ae.chunk.js.map