From c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 9 Mar 2024 14:19:22 +0100 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js (limited to 'web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js') diff --git a/web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js b/web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js new file mode 100644 index 000000000..4a8a9d428 --- /dev/null +++ b/web/gui/v2/8663.c6d53b400dd7461702e6.chunk.js @@ -0,0 +1 @@ +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1ed24772-ca97-4754-aca2-cd9973693fb0",e._sentryDebugIdIdentifier="sentry-dbid-1ed24772-ca97-4754-aca2-cd9973693fb0")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[8663],{36925:function(e,t,n){n.d(t,{vV:function(){return r}});n(74916),n(77601);var a=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,r=function(e){return!!e&&a.test(e)}},86414:function(e,t,n){n.d(t,{m:function(){return d}});var a=n(93433),r=n(29439),o=(n(26699),n(32023),n(92222),n(21249),n(57640),n(9924),n(57327),n(41539),n(88449),n(2490),n(59849),n(74916),n(15306),n(67294)),i=n(93416),l=n(36925),c=(0,n(71893).default)(i.Select).withConfig({displayName:"styled__StyledSelect",componentId:"sc-bkkrx-0"})(["width:100%;"]),s=(n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(51532),n(10072),n(23042),n(99137),n(71957),n(96306),n(103),n(74592),n(58276),n(35082),n(12813),n(18222),n(38563),n(50336),n(7512),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"name";return e.length?"string"===typeof e[0]?(0,a.Z)(new Set(e)):(0,a.Z)(new Map(e.map((function(e){return[e[t],e]}))).values()):[]}),u=[],d=function(e){var t=e.invitations,n=e.setInvitations,d=(0,o.useState)(u),f=(0,r.Z)(d,2),m=f[0],p=f[1],v=(0,o.useState)(""),b=(0,r.Z)(v,2),g=b[0],h=b[1],y=(0,o.useState)(""),w=(0,r.Z)(y,2),E=w[0],x=w[1],k=function(){return x("")},Z=(0,o.useCallback)((function(e){h(e.toLowerCase())}),[h]),C=o.useCallback((function(e){var t=e.emails,a=void 0===t?u:t,r=e.invitations,o=void 0===r?u:r;if(e.isEmailValid){var i=s(a),l=s(o);return p(i),n(l),h(""),void k()}x("Invalid Email")}),[n]),S=(0,o.useCallback)((function(e){return(0,l.vV)(e)&&!m.includes(e)}),[m]),I=(0,o.useCallback)((function(e){C({isEmailValid:!0,emails:e.map((function(e){return e.value})),invitations:e.map((function(e){return{email:e.value,name:e.value.split("@")[0]}}))})}),[p]),O=(0,o.useCallback)((function(e){var n=e.clipboardData.getData("Text").toLowerCase().replace(/ /g,",").replace(/,,/g,",").split(",").filter((function(e){return S(e)}))||u;C({emails:[].concat((0,a.Z)(m),(0,a.Z)(n)),invitations:[].concat((0,a.Z)(t),(0,a.Z)(n.map((function(e){return{email:e,name:e.split("@")[0]}})))),isEmailValid:n.length>0}),e.preventDefault()}),[m,t,S,C]),j=(0,o.useCallback)((function(e){if(g)switch(k(),e.key){case"Enter":case"Tab":case",":case" ":C({emails:[].concat((0,a.Z)(m),[g]),invitations:[].concat((0,a.Z)(t),[{email:g,name:g.split("@")[0]}]),isEmailValid:S(g)}),e.preventDefault()}}),[m,g,t,S,C]);return o.createElement(i.Flex,{justifyContent:"space-between",column:!0,onPaste:O},o.createElement(c,{components:{DropdownIndicator:null},inputValue:g,isClearable:!0,isMulti:!0,menuIsOpen:!1,onBlur:function(){g&&C({emails:[].concat((0,a.Z)(m),[g]),invitations:[].concat((0,a.Z)(t),[{email:g,name:g.split("@")[0]}]),isEmailValid:S(g)})},onChange:I,onInputChange:Z,onKeyDown:j,onClear:function(){p(u),n(u)},placeholder:"Enter an email and hit enter",value:m.map((function(e){return{label:t=e,value:t};var t}))}),E&&o.createElement(i.Text,{color:"error"},E))}},18663:function(e,t,n){n.d(t,{l:function(){return U}});var a=n(87462),r=n(15861),o=n(29439),i=n(64687),l=n.n(i),c=(n(21249),n(57640),n(9924),n(57327),n(41539),n(88449),n(2490),n(59849),n(92222),n(67294)),s=n(93416),u=n(92432),d=n(74855),f=n(52631),m=n(90025),p=n(91008),v=n(86414),b=n(74059),g=n(95383),h=n(35838),y=n(53338),w=n(16645),E=n(7693),x=n(92903),k=n(87181),Z=function(e){var t=e.id,n=e.handleDelete,a=(0,h.D)(t,"email");return c.createElement(s.Flex,{justifyContent:"between",alignItems:"center"},c.createElement(s.Flex,{gap:4},c.createElement(s.Icon,{color:"text",name:"check"}),c.createElement(s.Text,null,a)),c.createElement(s.Button,{flavour:"borderless",icon:"trashcan",onClick:function(){return n({email:a})}}))},C=n(93017),S=n(36925),I=n(33335),O=n(8048),j=n(46475),_=n(39979),D=n(54005),R=n(63346),T=function(e){var t=e.email;return(0,S.vV)(t)},P=(0,_.Z)(s.Button),B={header:"Invitations",text:"Invitations successfully sent!"},U=function(e){var t=e.onClose,n=e.isSubmodal,i=void 0!==n&&n,S=(0,b.OS)(),_=S.id,U=S.name,F=S.slug,N=(0,g.yE)(),V=(0,c.useState)(N),L=(0,o.Z)(V,2),M=L[0],q=L[1],A=(0,c.useState)([]),Q=(0,o.Z)(A,2),Y=Q[0],G=Q[1],J=(0,c.useState)([]),z=(0,o.Z)(J,2),H=z[0],K=z[1],$=(0,c.useState)(),W=(0,o.Z)($,2),X=W[0],ee=W[1],te=(0,D.Z)(),ne=te.sendLog,ae=te.isReady,re=(0,h.E)(_),oe=(0,o.Z)(re,4),ie=oe[0],le=oe[1],ce=oe[2],se=oe[3],ue=(0,C.Z)(),de=(0,o.Z)(ue,2)[1],fe=(0,c.useCallback)((function(e){var n=e||B,a=n.header,r=n.text,o=(0,d.sc)({header:a,text:r,success:!0}),i=H.filter(T).map((function(e){return e.email})).join(",");(0,u.L)("invite","invite-sent","".concat(X,"::").concat(i,"::").concat(M.join(",")),"","","invite-sent"),f.Z.success(o,{context:"manageInvitations"}),t(),ae&&ne({isSuccess:!0},!0)}),[ne,ae]),me=function(){var e=(0,r.Z)(l().mark((function e(){var t,n,a;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H.filter(T),n=t.map((function(e){return{email:e.email,name:e.name,role:X,roomIDs:M}})),a="".concat(window.location.origin,"/spaces/").concat(F,"/join-space"),ce(n,a,{onSuccess:fe,onError:function(e){de(e),ne({isFailure:!0,error:e.message},!0)}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=(0,I.QB)(),ve=function(e){return function(t){var n=t.email;e&&le(e),K(H.filter((function(e){return e.email!==n}))),G(Y.filter((function(e){return e.email!==n})))}},be=(0,c.useCallback)((function(){q([])}),[q]),ge="member"===X;return c.createElement(w.u6,{onClose:t,closeOnClickOutside:!1},c.createElement(R.ZP,{feature:"ManageInvitationsModal"},c.createElement(E.x,{onClose:t,isSubmodal:i,title:"Invite Users"}),c.createElement(x.B,null,"Invite users to\xa0",U),c.createElement(w.TZ,null,c.createElement(k.qQ,null,"Send invitations to your team"),c.createElement(k.ne,null,"TIP: You can send more invitations at once, separate each with a comma."),c.createElement(v.m,{invitations:H,setInvitations:K}),c.createElement("br",null),c.createElement(k.qQ,null,"Rooms"),c.createElement(s.Flex,{alignItems:"center",justifyContent:"between",margin:[1,0,2]},c.createElement(s.TextSmall,null,"Choose one or more rooms you'd like to invite users to."),!!M.length&&c.createElement(s.Button,{onClick:be,padding:[0],flavour:"borderless","data-ga":"rooms-clear",label:"Clear",small:!0},"Clear")),c.createElement(s.Box,{"data-testid":"invite-selectRoom"},c.createElement(m.Z,(0,a.Z)({selectedValue:M,onChange:q},ge?{formatOptions:function(e){return{isDisabled:e.name===y.TY}},filterValues:function(e){return e.label===y.TY}}:{}))),c.createElement("br",null),c.createElement(k.qQ,null,"Role"),c.createElement(k.ne,null,"Choose a role for invited user."," ",c.createElement(p.Z,{href:j.R,target:"_blank",rel:"noopener noreferrer",Component:s.TextSmall},"Learn more")),c.createElement(s.Box,{"data-testid":"invite-selectRole"},c.createElement(O.Z,{availableRoles:pe,dataGA:"invite-to-space",dataTestId:"invite-selectRole",onChange:function(e){ee(e.target.value)},value:X})),c.createElement(k.p7,null,c.createElement(P,{label:"Send",onClick:me,disabled:0===H.length||!X,flavour:"hollow",isLoading:se,"data-ga":"manage-invitations-modal::click-send::modal-footer"})),c.createElement(s.H5,{margin:[2,0,0]},"Invitations awaiting response"),c.createElement(s.Flex,{column:!0},ie.length>0?ie.map((function(e){return c.createElement(Z,{key:e,handleDelete:ve(e),id:e})})):c.createElement(k.xB,null,c.createElement("br",null),c.createElement(k.qQ,null,"You haven't invited any users yet."))))))}},87181:function(e,t,n){n.d(t,{ne:function(){return c},p7:function(){return i},qQ:function(){return o},xB:function(){return l}});var a=n(71893),r=n(93416),o=(0,a.default)(r.H5).withConfig({displayName:"styled__StyledH5",componentId:"sc-1kusjmi-0"})(["display:flex;align-items:center;"]),i=a.default.div.withConfig({displayName:"styled__FormRow",componentId:"sc-1kusjmi-1"})(["width:100%;display:flex;flex-flow:row no-wrap;justify-content:flex-end;margin-top:",";"],(0,r.getSizeBy)(2)),l=a.default.div.withConfig({displayName:"styled__StyledUserInvitationEmptyListItem",componentId:"sc-1kusjmi-2"})(["display:flex;flex-flow:column nowrap;align-items:center;"]),c=(0,a.default)(r.TextSmall).withConfig({displayName:"styled__StyledSecondaryText",componentId:"sc-1kusjmi-3"})(["margin:2px 0 8px;"])},46475:function(e,t,n){n.d(t,{R:function(){return a}});var a="https://learn.netdata.cloud/docs/nightly/concepts/role-based-access-model"},8048:function(e,t,n){n(2707),n(21249),n(57640),n(9924),n(26699),n(32023),n(9653),n(92222);var a=n(67294),r=n(93416),o=n(71893),i=n(64637),l=n(87917),c=n(74059),s=n(91008),u=n(79655),d=n(33335),f=n(99826),m={admin:"Users with this role can control Spaces, Rooms, Nodes, Users and Billing. They can also access any Room in the Space.",member:"Users with this role can create Rooms and invite other Members. They can only see the Rooms they belong to and all Nodes in the All Nodes room",manager:"Users with this role can manage Rooms and Users. They can access any Room in the Space.",troubleshooter:"Users with this role can use Netdata to troubleshoot, not manage entities. They can access any Room in the Space.",observer:"Users with this role can only view data in specific Rooms.",billing:"Users with this role can handle billing options and invoices."},p=(0,o.default)(r.Flex).withConfig({displayName:"rolePicker__PlanBadge",componentId:"sc-ypuqww-0"})(["pointer-events:auto;"]);t.Z=function(e){var t=e.availableRoles,n=e.dataGA,o=e.dataTestId,v=e.onChange,b=e.value,g=(0,c.OS)("plan"),h=(0,a.useMemo)((function(){return(0,l.xJ)(g).map((function(e){return{isChecked:e===b,isEnabled:t.includes(e),role:e}})).sort((function(e,t){return Number(t.isEnabled)-Number(e.isEnabled)}))}),[t,l.xJ,g,b]),y=(0,d.gI)("billing:ReadAll"),w=(0,f.Z)().url;return a.createElement(r.Flex,{column:!0,gap:2,"data-testid":"".concat(o,"-roleOptions")},h.map((function(e){var t=e.isChecked,l=e.isEnabled,c=e.role,d=l?void 0:"medium",f="troubleshooter"===c?"pro":"business";return a.createElement(r.RadioButton,{key:c,checked:t,"data-ga":"".concat(n,"::select-role-").concat(c,"::global-view"),"data-testid":"".concat(o,"-").concat(c,"Option"),disabled:!l,onChange:v,value:c,alignItems:"start"},a.createElement(r.Flex,{column:!0},a.createElement(r.Flex,{gap:2,alignItems:"center"},a.createElement(r.Text,{opacity:d},(0,i.fm)(c)),!l&&a.createElement(p,{background:"sideBarMini",border:{side:"all",color:"border"},cursor:"initial",padding:[1],round:!0},a.createElement(s.Z,{align:"bottom",as:u.rU,boxProps:{as:r.Flex},color:"text",Component:r.TextMicro,content:"Upgrade your plan in order to use this role","data-ga":"".concat(n,"::click-plan-badge-").concat(f,"::global-view"),disabled:!y,hoverColor:"textFocus",showToolTip:!0,strong:!0,to:w},"Upgrade now!"))),a.createElement(r.TextSmall,{color:"textLite",opacity:d},m[c])))})))}},35838:function(e,t,n){n.d(t,{D:function(){return D},E:function(){return _}});var a=n(15861),r=n(29439),o=n(4942),i=n(93433),l=n(64687),c=n.n(l),s=(n(66992),n(41539),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(92222),n(21249),n(57640),n(9924),n(15581),n(2490),n(34514),n(54747),n(57327),n(88449),n(59849),n(47941),n(82526),n(38880),n(49337),n(33321),n(69070),n(67294)),u=n(4480),d=(0,u.xu)({key:"invitation",default:{id:"",email:""}}),f=(0,u.xu)({key:"invitationIds",default:[]}),m=n(45987),p=n(26398),v=["role"];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var g=function(e){return e.map((function(e){return{id:e.id,email:e.email}}))},h=function(e){return p.Z.get("/api/v2/spaces/".concat(e,"/invitations"),{transform:g})},y={member:1,admin:2,manager:3,troubleshooter:4,observer:5,billing:6},w=function(e){return e.map((function(e){var t=e.role,n=(0,m.Z)(e,v);if(void 0===y[t])throw new Error("role not found");return function(e){for(var t=1;t1};function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function I(e){for(var t=1;t