(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{IeNb:function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"UserInvitePage",(function(){return u}));var a=n("q1tI"),r=n.n(a),o=n("0cfB"),l=n("/MKj"),i=n("pkzr"),c=n("HJRA"),s=n("lzJ5"),m=n("ZGyg"),u=function(e){var t=e.navModel;return r.a.createElement(m.a,{navModel:t},r.a.createElement(m.a.Contents,null,r.a.createElement("h3",{className:"page-sub-heading"},"Invite User"),r.a.createElement("div",{className:"p-b-2"},"Send invite or add existing Grafana user to the organization",r.a.createElement("span",{className:"highlight-word"}," ",c.b.user.orgName)),r.a.createElement(i.a,null)))};t.default=Object(o.hot)(e)(Object(l.connect)((function(e){return{navModel:Object(s.a)(e.navIndex,"users")}}))(u))}.call(this,n("3UD+")(e))},pkzr:function(e,t,n){"use strict";(function(e){var a=n("q1tI"),r=n.n(a),o=n("kDLi"),l=n("ZFWI"),i=n("GQ3c"),c=n("t8hP"),s=n("3SGO"),m=n("/MKj"),u=n("0cfB"),d=n("HJRA"),p=n("Obii"),v=n("UIT+");function E(e,t,n,a,r,o,l){try{var i=e[o](l),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(a,r)}var f=[{label:"Viewer",value:i.OrgRole.Viewer},{label:"Editor",value:i.OrgRole.Editor},{label:"Admin",value:i.OrgRole.Admin}],b={updateLocation:s.c};t.a=Object(u.hot)(e)(Object(m.connect)(null,b)((function(e){var t=e.updateLocation,n=function(){var e,n=(e=regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(c.getBackendSrv)().post("/api/org/invites",n);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),d.a.emit(p.AppEvents.alertError,["Failed to send invite",e.t0.message]);case 8:t({path:"org/users/"});case 9:case"end":return e.stop()}}),e,null,[[0,5]])})),function(){var t=this,n=arguments;return new Promise((function(a,r){var o=e.apply(t,n);function l(e){E(o,a,r,l,i,"next",e)}function i(e){E(o,a,r,l,i,"throw",e)}l(void 0)}))});return function(e){return n.apply(this,arguments)}}(),a={name:"",email:"",role:i.OrgRole.Editor,sendEmail:!0};return r.a.createElement(o.Forms.Form,{defaultValues:a,onSubmit:n},(function(e){var t=e.register,n=e.control,a=e.errors;return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.Forms.Field,{invalid:!!a.loginOrEmail,error:!!a.loginOrEmail&&"Email or Username is required",label:"Email or Username"},r.a.createElement(o.Forms.Input,{size:"md",name:"loginOrEmail",placeholder:"email@example.com",ref:t({required:!0})})),r.a.createElement(o.Forms.Field,{invalid:!!a.name,label:"Name"},r.a.createElement(o.Forms.Input,{size:"md",name:"name",placeholder:"(optional)",ref:t})),r.a.createElement(o.Forms.Field,{invalid:!!a.role,label:"Role"},r.a.createElement(o.Forms.InputControl,{as:o.Forms.RadioButtonGroup,control:n,options:f,name:"role"})),r.a.createElement(o.Forms.Field,{invalid:!!a.sendEmail,label:"Send invite email"},r.a.createElement(o.Forms.Switch,{name:"sendEmail",ref:t})),r.a.createElement(o.HorizontalGroup,null,r.a.createElement(o.Forms.Button,{type:"submit"},"Submit"),r.a.createElement(o.Forms.LinkButton,{href:Object(v.a)(Object(l.c)().appSubUrl+"/org/users"),variant:"secondary"},"Back")))}))})))}).call(this,n("3UD+")(e))}}]);
//# sourceMappingURL=UserInvitePage.160d16a6a71bab373f30.js.map