"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7720],{91230:(L,s,t)=>{t.r(s),t.d(s,{UserInvitePage:()=>u,default:()=>R});var e=t(96540),m=t(36830),E=t(10096),g=t(71733),h=t(12131),f=t(72109),I=t(51253),p=t(84167),l=t(88575),i=t(10354),S=t(60029),c=t(67061),F=t(56034),U=t(14578),N=t(16504),y=t(94354),O=t(15292),d=t(55852),x=t(2913),o=t(80348),z=t(47259);const v=e.createElement(e.Fragment,null,'You can now select the "No basic role" option and add permissions to your custom needs. You can find more information in\xA0',e.createElement(f.Y,{href:"https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/#organization-roles",variant:"bodySmall",external:!0},"our documentation"),"."),B=Object.values(o.OrgRole).map(n=>({label:n===o.OrgRole.None?"No basic role":n,value:n})),D={name:"",email:"",role:o.OrgRole.Editor,sendEmail:!0},P=()=>{const n=(0,o.useDispatch)(),Y=async a=>{await n((0,z.KU)(a)).unwrap(),h.Ny.push("/admin/users/")};return e.createElement(I.l,{defaultValues:D,onSubmit:Y},({register:a,control:C,errors:r})=>e.createElement(e.Fragment,null,e.createElement(p.n,null,e.createElement(l.D,{invalid:!!r.loginOrEmail,error:r.loginOrEmail?"Email or username is required":void 0,label:"Email or username"},e.createElement(i.p,{...a("loginOrEmail",{required:!0}),placeholder:"email@example.com"})),e.createElement(l.D,{invalid:!!r.name,label:"Name"},e.createElement(i.p,{...a("name"),placeholder:"(optional)"})),e.createElement(l.D,{invalid:!!r.role,label:e.createElement(S.J,null,e.createElement(c.B,{gap:.5},e.createElement("span",null,"Role"),v&&e.createElement(F.m,{placement:"right-end",interactive:!0,content:v},e.createElement(U.I,{name:"info-circle",size:"xs"}))))},e.createElement(N.e,{render:({field:{ref:G,...T}})=>e.createElement(y.z,{...T,options:B}),control:C,name:"role"})),e.createElement(l.D,{label:"Send invite email"},e.createElement(O.d,{id:"send-email-switch",...a("sendEmail")}))),e.createElement(c.B,null,e.createElement(d.$n,{type:"submit"},"Submit"),e.createElement(d.z9,{href:g.I.assureBaseUrl((0,x.zj)().appSubUrl+"/admin/users"),variant:"secondary"},"Back"))))};function u(){const n=e.createElement(e.Fragment,null,"Send invitation or add existing Grafana user to the organization.",e.createElement("span",{className:"highlight-word"}," ",E.TP.user.orgName));return e.createElement(m.Y,{navId:"global-users",pageNav:{text:"Invite user"},subTitle:n},e.createElement(m.Y.Contents,null,e.createElement(P,null)))}const R=u}}]);

//# sourceMappingURL=UserInvitePage.c8243c9cee4b06e10222.js.map