"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7707],{8860:(e,r,n)=>{n.r(r),n.d(r,{UserInvitePage:()=>S,default:()=>B});n(76687);var a,s=n(28781),i=n(31271),l=n(83272),t=n(95129),d=n(49622),o=n(56481),c=n(72660),u=n(45550),h=n(9120),m=n(60521),g=n(81377),j=n(46286),x=n(55312),b=n(72e3),v=n(352),p=n(6802),f=n(52010);const E=["ref"];const O=[{label:"Viewer",value:v.B5.Viewer},{label:"Editor",value:v.B5.Editor},{label:"Admin",value:v.B5.Admin}],w={name:"",email:"",role:v.B5.Editor,sendEmail:!0},k=()=>{const e=(0,v.I0)();return(0,f.jsx)(o.l,{defaultValues:w,onSubmit:async r=>{await e((0,p.MA)(r)).unwrap(),d.E1.push("/org/users/")},children:e=>{let{register:r,control:n,errors:s}=e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.C,{children:[(0,f.jsx)(u.g,{invalid:!!s.loginOrEmail,error:s.loginOrEmail?"Email or username is required":void 0,label:"Email or username",children:(0,f.jsx)(h.I,Object.assign({},r("loginOrEmail",{required:!0}),{placeholder:"email@example.com"}))}),(0,f.jsx)(u.g,{invalid:!!s.name,label:"Name",children:(0,f.jsx)(h.I,Object.assign({},r("name"),{placeholder:"(optional)"}))}),(0,f.jsx)(u.g,{invalid:!!s.role,label:"Role",children:(0,f.jsx)(m.g,{render:e=>{let{}=e,r=function(e,r){if(null==e)return{};var n,a,s={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],r.indexOf(n)>=0||(s[n]=e[n]);return s}(e.field,E);return(0,f.jsx)(g.S,Object.assign({},r,{options:O}))},control:n,name:"role"})}),(0,f.jsx)(u.g,{label:"Send invite email",children:(0,f.jsx)(j.r,Object.assign({id:"send-email-switch"},r("sendEmail")))})]}),(0,f.jsxs)(t.Stack,{children:[a||(a=(0,f.jsx)(x.zx,{type:"submit",children:"Submit"})),(0,f.jsx)(x.Qj,{href:l.u.assureBaseUrl((0,b.iE)().appSubUrl+"/org/users"),variant:"secondary",children:"Back"})]})]})}})};var I,N;function S(){const e=(0,f.jsxs)(f.Fragment,{children:["Send invitation or add existing Grafana user to the organization.",(0,f.jsxs)("span",{className:"highlight-word",children:[" ",i.Vt.user.orgName]})]});return(0,f.jsx)(s.T,{navId:"users",pageNav:{text:"Invite user"},subTitle:e,children:(0,f.jsxs)(s.T.Contents,{children:[(0,f.jsxs)(s.T.OldNavOnly,{children:[I||(I=(0,f.jsx)("h3",{className:"page-sub-heading",children:"Invite user"})),(0,f.jsx)("div",{className:"p-b-2",children:e})]}),N||(N=(0,f.jsx)(k,{}))]})})}const B=S}}]);
//# sourceMappingURL=UserInvitePage.262184e9c6c31d029955.js.map