"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(17205),E=t(10096),g=t(49785),h=t(71733),f=t(12131),I=t(72109),S=t(84167),l=t(88575),i=t(10354),p=t(60029),c=t(67061),F=t(56034),U=t(14578),x=t(94354),N=t(15292),d=t(55852),y=t(2913),o=t(31678),O=t(72235),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(I.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(),f.Ny.push("/admin/users/")};return e.createElement(O.l,{defaultValues:D,onSubmit:Y},({register:a,control:T,errors:r})=>e.createElement(e.Fragment,null,e.createElement(S.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(p.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(g.xI,{render:({field:{ref:G,...C}})=>e.createElement(x.z,{...C,options:B}),control:T,name:"role"})),e.createElement(l.D,{label:"Send invite email"},e.createElement(N.d,{id:"send-email-switch",...a("sendEmail")}))),e.createElement(c.B,null,e.createElement(d.$n,{type:"submit"},"Submit"),e.createElement(d.z9,{href:h.I.assureBaseUrl((0,y.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.8501c1d309eada3baaab.js.map