"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7707],{33057:(A,s,t)=>{t.r(s),t.d(s,{UserInvitePage:()=>u,default:()=>B});var e=t(39953),i=t(13253),E=t(21308),g=t(57837),m=t(27366),h=t(13601),f=t(66729),I=t(85830),S=t(2827),l=t(96227),c=t(38637),F=t(36495),p=t(69865),U=t(12190),x=t(9006),N=t(20454),O=t(26286),d=t(4919),y=t(50820),o=t(57721),C=t(65531);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.h,{href:"https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/#organization-roles",variant:"bodySmall",external:!0},"our documentation"),"."),R=Object.values(o.OrgRole).map(n=>({label:n===o.OrgRole.None?"No basic role":n,value:n})),T={name:"",email:"",role:o.OrgRole.Editor,sendEmail:!0},z=()=>{const n=(0,o.useDispatch)(),P=async a=>{await n((0,C.MA)(a)).unwrap(),h.E1.push("/admin/users/")};return e.createElement(I.l,{defaultValues:T,onSubmit:P},({register:a,control:L,errors:r})=>e.createElement(e.Fragment,null,e.createElement(S.C,null,e.createElement(l.g,{invalid:!!r.loginOrEmail,error:r.loginOrEmail?"Email or username is required":void 0,label:"Email or username"},e.createElement(c.I,{...a("loginOrEmail",{required:!0}),placeholder:"email@example.com"})),e.createElement(l.g,{invalid:!!r.name,label:"Name"},e.createElement(c.I,{...a("name"),placeholder:"(optional)"})),e.createElement(l.g,{invalid:!!r.role,label:e.createElement(F._,null,e.createElement(m.K,{gap:.5},e.createElement("span",null,"Role"),v&&e.createElement(p.u,{placement:"right-end",interactive:!0,content:v},e.createElement(U.J,{name:"info-circle",size:"xs"}))))},e.createElement(x.g,{render:({field:{ref:K,...j}})=>e.createElement(N.S,{...j,options:R}),control:L,name:"role"})),e.createElement(l.g,{label:"Send invite email"},e.createElement(O.r,{id:"send-email-switch",...a("sendEmail")}))),e.createElement(m.K,null,e.createElement(d.zx,{type:"submit"},"Submit"),e.createElement(d.Qj,{href:g.u.assureBaseUrl((0,y.iE)().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.Vt.user.orgName));return e.createElement(i.T,{navId:"global-users",pageNav:{text:"Invite user"},subTitle:n},e.createElement(i.T.Contents,null,e.createElement(z,null)))}const B=u}}]);

//# sourceMappingURL=UserInvitePage.329144af97f354070773.js.map