(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{"w+x2":function(e,r,n){"use strict";n.r(r),function(e){var t=n("q1tI"),a=n.n(t),o=n("0cfB"),i=n("/MKj"),u=n("kDLi"),s=n("t8hP"),c=n("lzJ5"),l=n("ZGyg"),m=n("3SGO");function d(e,r,n,t,a,o,i){try{var u=e[o](i),s=u.value}catch(e){return void n(e)}u.done?r(s):Promise.resolve(s).then(t,a)}function p(e){return function(){var r=this,n=arguments;return new Promise((function(t,a){var o=e.apply(r,n);function i(e){d(o,t,a,i,u,"next",e)}function u(e){d(o,t,a,i,u,"throw",e)}i(void 0)}))}}var f=function(){var e=p(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(s.getBackendSrv)().post("/api/admin/users",r));case 1:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),v={updateLocation:m.c};r.default=Object(o.hot)(e)(Object(i.connect)((function(e){return{navModel:Object(c.a)(e.navIndex,"global-users")}}),v)((function(e){var r=e.navModel,n=e.updateLocation,o=Object(t.useCallback)(function(){var e=p(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(r);case 2:n({path:"/admin/users"});case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[]);return a.a.createElement(l.a,{navModel:r},a.a.createElement(l.a.Contents,null,a.a.createElement("h1",null,"Add new user"),a.a.createElement(u.Forms.Form,{onSubmit:o,validateOn:"onBlur"},(function(e){var r=e.register,n=e.errors;return a.a.createElement(a.a.Fragment,null,a.a.createElement(u.Forms.Field,{label:"Name",required:!0,invalid:!!n.name,error:!!n.name&&"Name is required"},a.a.createElement(u.Forms.Input,{name:"name",size:"md",ref:r({required:!0})})),a.a.createElement(u.Forms.Field,{label:"E-mail"},a.a.createElement(u.Forms.Input,{name:"email",size:"md",ref:r})),a.a.createElement(u.Forms.Field,{label:"Username"},a.a.createElement(u.Forms.Input,{name:"login",size:"md",ref:r})),a.a.createElement(u.Forms.Field,{label:"Password",required:!0,invalid:!!n.password,error:!!n.password&&"Password is required and must contain at least 4 characters"},a.a.createElement(u.Forms.Input,{size:"md",type:"password",name:"password",ref:r({validate:function(e){return""!==e.trim()&&e.length>=4}})})),a.a.createElement(u.Forms.Button,{type:"submit"},"Create user"))}))))})))}.call(this,n("3UD+")(e))}}]);
//# sourceMappingURL=UserCreatePage.8f5dc27d3c2734b0870d.js.map