-
Notifications
You must be signed in to change notification settings - Fork 0
/
16.bundle.min.js
1 lines (1 loc) · 11.5 KB
/
16.bundle.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{389:function(e,a,t){"use strict";t.r(a);var r=t(0),s=t.n(r),n=t(1),l=t.n(n),c=t(22),o=t(31),m=t(33),i=t(382),u=t(24),d=t(90),f=t.n(d),p=t(91),h=t.n(p),E=t(18),g=t.n(E),N=t(2),b=t(94),v=t(36),w=t(20),x=t(29),y=window.console,P=function(){var e=Object(r.useState)(!1),a=g()(e,2),t=a[0],n=a[1],l=Object(r.useState)({uuid:"",name:"",email:"",username:"",notes:"",phoneNumber:"",country:{name:""}}),m=g()(l,2),d=m[0],p=m[1],E=Object(o.a)(),P=E.register,k=E.handleSubmit,j=E.errors,U=E.formState;Object(r.useEffect)((function(){L()}),[]);var L=function(){n(!0),v.a.myProfile().then((function(e){e.success&&p(e.result.data)}),(function(e){return c.a.error(e.message,{position:"top-right"})})).finally((function(){n(!1)}))},F=function(){var e=h()(f.a.mark((function e(a){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x.a.getUser()||x.a.getUser().username!==a){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,v.a.checkUsername(a.trim()).then((function(e){return"Username Available!"===e.message||"The username is already taken."}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}();return s.a.createElement(i.a,{in:!0,appear:!0,timeout:500,classNames:"fade"},s.a.createElement("div",{className:"col-12 col-md-12 col-lg-7"},s.a.createElement("div",{className:"card card-primary "+(t?"spinner":"")},s.a.createElement(N.a,{isLoading:t}),s.a.createElement("div",{className:"card-header"},s.a.createElement("h4",{className:"card-title"},"Update your Profile Details",s.a.createElement("div",{className:"text-primary text-small"},s.a.createElement("i",{className:"fa fa-info-circle"})," Update your details as per your need."))),s.a.createElement("div",{className:"card-body"},s.a.createElement("form",{role:"form",className:"needs-validation",onSubmit:k((function(e){return y.log("User Profile Form Submitted!"),n(!0),b.a.updateProfile(e).then((function(e){c.a.success(e.message,{position:"top-right"})}),(function(e){c.a.error(e.message,{position:"top-right"})})).finally((function(){n(!1)}))}))},s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"full_name"},"Full Name:"),s.a.createElement("input",{id:"full_name",name:"name",placeholder:"Eg. John",defaultValue:d.name,className:"form-control"+w.a.checkValadity("name",j,U),ref:P({required:"Your full name can't be empty."}),autoFocus:!0}),s.a.createElement(u.a,{error:j.name})),s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"alt_contact"},"Alternative Contact (Optiona):"),s.a.createElement("input",{id:"alt_contact",name:"altContact",placeholder:"Eg. 9849049389",className:"form-control"+w.a.checkValadity("altContact",j,U),ref:P()}),s.a.createElement(u.a,{error:j.altContact}))),s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"email"},"Email:"),s.a.createElement("input",{id:"email",name:"email",defaultValue:d.email,placeholder:"Eg. johndoe@example.com",className:"form-control"+w.a.checkValadity("email",j,U),ref:P({required:"Please enter your email address.",pattern:{value:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i,message:"Invalid Email address or check for ending space"}})}),s.a.createElement(u.a,{error:j.email})),s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"username"},"Username:"),s.a.createElement("input",{id:"username",name:"username",placeholder:"Eg. jonhdoe",defaultValue:d.username,className:"form-control"+w.a.checkValadity("username",j,U),ref:P({required:"Please specify your username.",minLength:{value:3,message:"Username should be minimum of 3 characters."},maxLength:{value:16,message:"Username can't contain more than 16 characters."},validate:F})}),s.a.createElement(u.a,{error:j.username}))),s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-lg-12"},s.a.createElement("div",{className:"form-group"},s.a.createElement("label",{htmlFor:"notes",className:"form-control-label"},"Other Notes:"),s.a.createElement("textarea",{id:"notes",name:"notes",rows:"3",className:"form-control",defaultValue:d.notes,placeholder:"Write that will help you learn about the group ...",ref:P({required:"Please enter the details about the group",minLength:{value:10,message:"Note must contain at least 10 characters."},maxLength:{value:200,message:"Note shouldn't contain more than 200 characters."}})}),s.a.createElement("div",{className:"help-block"},s.a.createElement(u.a,{field:"Note",error:j.notes}))))),s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"col-lg-6"},s.a.createElement("div",{className:"form-group"},s.a.createElement("label",{className:"form-control-label",htmlFor:"input-device"},"You are from:"),s.a.createElement("h6",null,s.a.createElement("i",{className:"fa fa-globe"})," ",d.country.name))),s.a.createElement("div",{className:"form-group col-lg-6 mb-0"},s.a.createElement("label",{htmlFor:"phone_number"},"Phone Number:"),s.a.createElement("h6",null,s.a.createElement("i",{className:"fa fa-mobile"})," ",d.phoneNumber))),s.a.createElement("div",{className:"dropdown-divider"}),s.a.createElement("div",{className:"button-group text-right"},s.a.createElement("button",{type:"reset",className:"btn btn-warning btn-lg mr-2"},"Reset"),s.a.createElement("button",{disabled:U.isSubmitting,type:"submit",className:"btn btn-primary btn-lg"},"Update Profile")))))))};P.propTypes={title:l.a.string};var k=Object(m.g)(P),j=window.console,U=function(e){var a=Object(o.a)(),t=a.register,n=a.handleSubmit,l=a.errors,m=a.getValues,d=a.formState;Object(r.useEffect)((function(){f()}),[]);var f=function(){w.a.loadAssets({cssLinks:[],jsLinks:["/assets/modules/jquery-pwstrength/jquery.pwstrength.min.js","/assets/js/page/auth-register.js"]})};return s.a.createElement("section",{className:"section"},s.a.createElement(i.a,{in:!0,appear:!0,timeout:500,classNames:"hero"},s.a.createElement("div",{className:"section-header"},s.a.createElement("h5",{className:"mb-0 mr-5"},s.a.createElement("i",{className:"fa fa-user"})," ",e.title),s.a.createElement("div",{className:"section-header-breadcrumb"},s.a.createElement("div",{className:"breadcrumb-item active"},s.a.createElement("a",{href:"/dashboard"},"Dashboard")),s.a.createElement("div",{className:"breadcrumb-item"},"Profile")))),s.a.createElement(i.a,{in:!0,appear:!0,timeout:500,classNames:"fade"},s.a.createElement("div",{className:"section-body"},s.a.createElement("h2",{className:"section-title"},"Hi, ",x.a.getUser()?x.a.getUser().name:"Guest","!"),s.a.createElement("p",{className:"section-lead"},"View and Update information about yourself on this page."),s.a.createElement("div",{className:"row mt-sm-4"},s.a.createElement(k,null),s.a.createElement(i.a,{in:!0,appear:!0,timeout:500,classNames:"fade"},s.a.createElement("div",{className:"col-12 col-md-12 col-lg-5"},s.a.createElement("div",{className:"card card-primary "},s.a.createElement("div",{className:"card-header"},s.a.createElement("h4",{className:"card-title"},"Reset Your Login Credentials",s.a.createElement("div",{className:"text-primary text-small"},s.a.createElement("i",{className:"fa fa-info-circle"})," Your information is safe with bank level security."))),s.a.createElement("div",{className:"card-body"},s.a.createElement("form",{role:"form",className:"needs-validation",onSubmit:n((function(e,a){return j.log("Password Reset Form Submitted!"),b.a.updatePassword(e).then((function(e){c.a.success(e.message,{position:"top-right"}),a.target.reset()}),(function(e){c.a.error(e.message,{position:"top-right"})}))}))},s.a.createElement("div",{className:"row"},s.a.createElement("div",{className:"form-group col-lg-12"},s.a.createElement("label",{htmlFor:"password",className:"d-block"},"Current Password:"),s.a.createElement("input",{id:"password",type:"password",className:"form-control"+w.a.checkValadity("oldPassword",l,d),name:"oldPassword",placeholder:"xxxxxxxxxx",ref:t({required:"You must specify a password.",minLength:{value:8,message:"Password minimum of 8 characters."},maxLength:{value:16,message:"Password cannot contain more than 16 characters."}})}),s.a.createElement(u.a,{error:l.oldPassword})),s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"password",className:"d-block"},"New Password:"),s.a.createElement("input",{id:"password",type:"password",className:"form-control pwstrength"+w.a.checkValadity("newPassword",l,d),"data-indicator":"pwindicator",name:"newPassword",placeholder:"xxxxxxxxxx",ref:t({required:"You must specify a password.",minLength:{value:8,message:"Password minimum of 8 characters."},maxLength:{value:16,message:"Password cannot contain more than 16 characters."}})}),s.a.createElement(u.a,{error:l.newPassword}),s.a.createElement("div",{id:"pwindicator",className:"pwindicator"},s.a.createElement("div",{className:"bar"})," ",s.a.createElement("div",{className:"label"}))),s.a.createElement("div",{className:"form-group col-lg-6"},s.a.createElement("label",{htmlFor:"confirm_password",className:"d-block"},"Confirm New Password:"),s.a.createElement("input",{id:"confirm_password",type:"password",name:"confirmPassword",placeholder:"xxxxxxxxxx",className:"form-control"+w.a.checkValadity("confirmPassword",l,d),ref:t({required:"Please confirm your password.",minLength:{value:8,message:"Password minimum of 8 characters."},maxLength:{value:16,message:"Password cannot contain more than 16 characters."},validate:function(e){return e===m().newPassword||"The passwords do not match."}})}),s.a.createElement(u.a,{error:l.confirmPassword})),s.a.createElement("div",{className:"form-group col-lg-12"},s.a.createElement("div",{className:"text-primary text-small"},s.a.createElement("i",{className:"fa fa-info-circle"})," ",s.a.createElement("strong",null,"Guidelines for strong Password:"),s.a.createElement("div",{className:"bg-light p-2 font-weight-bold"},s.a.createElement("div",null,"-- Include Upper Case letters like (A-Z)"),s.a.createElement("div",null,"-- Include Small Case letters like (a-z)"),s.a.createElement("div",null,"-- Invlude Numbers like (0-9) and"),s.a.createElement("div",null,"-- Include Special characters like (@!$%#&^*+)")))),s.a.createElement("div",{className:"form-group col-lg-12"},s.a.createElement("div",{className:"text-warning text-small"},s.a.createElement("i",{className:"fa fa-info-circle"})," Your Login Credentials should be kept confediential and should never share with anyone."))),s.a.createElement("div",{className:"form-group text-right"},s.a.createElement("button",{type:"reset",className:"btn btn-warning btn-lg mr-2"},"Reset"),s.a.createElement("button",{disabled:d.isSubmitting,type:"submit",className:"btn btn-primary btn-lg"},"Reset Password")))))))))))};U.propTypes={title:l.a.string};a.default=Object(m.g)(U)},94:function(e,a,t){"use strict";var r=t(25),s={listPaginatedUsers:function(e,a){return r.a.get("/users/"+e+"/"+a,!0).then((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(e)}))},updatePassword:function(e){return r.a.post("/users/password/update",e,!0).then((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(e)}))},updateProfile:function(e){return r.a.post("/users/me/update",e,!0).then((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(e)}))},loadUserByUuid:function(e){return r.a.get("/"+e,!0).then((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(e)}))}};a.a=s}}]);