"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[7707],{87436:(x,i,t)=>{t.r(i),t.d(i,{UserInvitePage:()=>v,default:()=>B});var e=t(27702),m=t(44644),c=t(66574),u=t(94469),E=t(23852),g=t(26129),h=t(23839),f=t(5229),l=t(22209),s=t(1128),I=t(16310),S=t(40705),F=t(42074),d=t(66670),U=t(12308),a=t(18771),O=t(54422);const R=[{label:"Viewer",value:a.OrgRole.Viewer},{label:"Editor",value:a.OrgRole.Editor},{label:"Admin",value:a.OrgRole.Admin}],C={name:"",email:"",role:a.OrgRole.Editor,sendEmail:!0},y=()=>{const o=(0,a.useDispatch)(),N=async n=>{await o((0,O.MA)(n)).unwrap(),g.E1.push("/admin/users/")};return e.createElement(h.l,{defaultValues:C,onSubmit:N},({register:n,control:P,errors:r})=>e.createElement(e.Fragment,null,e.createElement(f.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(s.I,{...n("loginOrEmail",{required:!0}),placeholder:"email@example.com"})),e.createElement(l.g,{invalid:!!r.name,label:"Name"},e.createElement(s.I,{...n("name"),placeholder:"(optional)"})),e.createElement(l.g,{invalid:!!r.role,label:"Role"},e.createElement(I.g,{render:({field:{ref:T,...V}})=>e.createElement(S.S,{...V,options:R}),control:P,name:"role"})),e.createElement(l.g,{label:"Send invite email"},e.createElement(F.r,{id:"send-email-switch",...n("sendEmail")}))),e.createElement(E.K,null,e.createElement(d.zx,{type:"submit"},"Submit"),e.createElement(d.Qj,{href:u.u.assureBaseUrl((0,U.iE)().appSubUrl+"/admin/users"),variant:"secondary"},"Back"))))};function v(){const o=e.createElement(e.Fragment,null,"Send invitation or add existing Grafana user to the organization.",e.createElement("span",{className:"highlight-word"}," ",c.Vt.user.orgName));return e.createElement(m.T,{navId:"global-users",pageNav:{text:"Invite user"},subTitle:o},e.createElement(m.T.Contents,null,e.createElement(y,null)))}const B=v}}]);

//# sourceMappingURL=UserInvitePage.3ac95872df5d84cf4257.js.map