Compare commits
1 Commits
password-r
...
self-regis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27611a7e07 |
812
package-lock.json
generated
812
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -33,8 +33,8 @@ const isFunction = (functionToCheck) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const requireAuth = (nextState, replace, next) => {
|
const requireAuth = (nextState, replace, next) => {
|
||||||
if (nextState.location.pathname === '/login' || nextState.location.pathname === '/sign-up' || nextState.location.pathname.toLowerCase() === '/selfregister' || (nextState.location.pathname.indexOf('/reset-password') > -1 && nextState.params.token !== undefined) || (nextState.location.pathname.indexOf('/ride') > -1 && nextState.params.ride_uuid !== undefined && nextState.params.user_uuid !== undefined)
|
if (nextState.location.pathname === '/login' || nextState.location.pathname === '/sign-up' || nextState.location.pathname === '/selfRegister' || (nextState.location.pathname.indexOf('/ride') > -1 && nextState.params.ride_uuid !== undefined && nextState.params.user_uuid !== undefined)
|
||||||
|| (!isFunction(replace) && (replace.location.pathname === '/login' || replace.location.pathname === '/sign-up' || nextState.location.pathname.toLowerCase() === '/selfRegister' || (replace.location.pathname.indexOf('/reset-password') > -1 && replace.params.token !== undefined) || (replace.location.pathname.indexOf('/ride') > -1 && replace.params.ride_uuid !== undefined && replace.params.user_uuid !== undefined)))) {
|
|| (!isFunction(replace) && (replace.location.pathname === '/login' || replace.location.pathname === '/sign-up' || nextState.location.pathname === '/selfRegister' || (replace.location.pathname.indexOf('/ride') > -1 && replace.params.ride_uuid !== undefined && replace.params.user_uuid !== undefined)))) {
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,6 @@ const rootRoute = {
|
|||||||
require('./routes/500'),
|
require('./routes/500'),
|
||||||
require('./routes/confirmEmail'),
|
require('./routes/confirmEmail'),
|
||||||
require('./routes/forgotPassword'),
|
require('./routes/forgotPassword'),
|
||||||
require('./routes/resetPassword'),
|
|
||||||
require('./routes/lockScreen'),
|
require('./routes/lockScreen'),
|
||||||
require('./routes/login'),
|
require('./routes/login'),
|
||||||
require('./routes/signUp'),
|
require('./routes/signUp'),
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import FlatButton from 'material-ui/FlatButton';
|
import FlatButton from 'material-ui/FlatButton';
|
||||||
import MaterialDialog from 'material-ui/Dialog';
|
|
||||||
import Dialog from './draggable-dialog';
|
import Dialog from './draggable-dialog';
|
||||||
|
|
||||||
import './draggable-dialog/css/index.css';
|
import './draggable-dialog/css/index.css';
|
||||||
@@ -46,49 +45,30 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
/>,
|
/>,
|
||||||
];
|
];
|
||||||
|
|
||||||
const dialogContent = (
|
|
||||||
this.props.errorMessages.map(errorMessage => {
|
|
||||||
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>);
|
|
||||||
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
|
||||||
|
|
||||||
if (errorMessage.field_name === "password-tab") {
|
|
||||||
return oneValidationMessageWithTab;
|
|
||||||
} else {
|
|
||||||
return oneValidationMessage;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
const draggableDialog =
|
|
||||||
(<Dialog
|
|
||||||
title={this.props.title ? this.props.title : 'Error'}
|
|
||||||
isDraggable={true}
|
|
||||||
buttons={actions}
|
|
||||||
hasCloseIcon={false}
|
|
||||||
modal={this.props.modal ? this.props.modal : false}
|
|
||||||
height={defaultDialogHeight + this.props.errorMessages.length * dialogHeightPerLine}>
|
|
||||||
|
|
||||||
{dialogContent}
|
|
||||||
|
|
||||||
</Dialog>
|
|
||||||
)
|
|
||||||
|
|
||||||
const normalDialog =
|
|
||||||
(<MaterialDialog
|
|
||||||
open={this.state.open}
|
|
||||||
title={this.props.title ? this.props.title : 'Error'}
|
|
||||||
onBackdropClick={()=>{console.log("Backdrop")}}
|
|
||||||
actions={actions}>
|
|
||||||
|
|
||||||
{dialogContent}
|
|
||||||
|
|
||||||
</MaterialDialog>
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
{this.state.open && this.props.draggable && draggableDialog }
|
{
|
||||||
{this.state.open && !this.props.draggable && normalDialog}
|
this.state.open &&
|
||||||
|
<Dialog
|
||||||
|
title={this.props.title ? this.props.title : 'Error'}
|
||||||
|
isDraggable={this.props.draggable ? this.props.draggable : false}
|
||||||
|
buttons={actions}
|
||||||
|
hasCloseIcon={false}
|
||||||
|
modal={this.props.modal ? this.props.modal : false}
|
||||||
|
height={defaultDialogHeight + this.props.errorMessages.length * dialogHeightPerLine}
|
||||||
|
>
|
||||||
|
{this.props.errorMessages.map(errorMessage => {
|
||||||
|
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>);
|
||||||
|
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
||||||
|
|
||||||
|
if (errorMessage.field_name === "password-tab") {
|
||||||
|
return oneValidationMessageWithTab;
|
||||||
|
} else {
|
||||||
|
return oneValidationMessage;
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</Dialog>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -664,7 +664,22 @@ class VerticalNonLinear extends React.Component {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const eligibility = {
|
const eligibility = {
|
||||||
"raw_provider": self.state.destination.raw,
|
"provider": {
|
||||||
|
"provider_npi": self.state.destination.raw.fivePartKeyGroups[0].providerNum,
|
||||||
|
"provider_name": self.state.destination.raw.providerName
|
||||||
|
},
|
||||||
|
"subscriber": {
|
||||||
|
"patient_type": self.state.user.type,
|
||||||
|
"subscriber_id": self.state.user.member,
|
||||||
|
"name": {
|
||||||
|
"first": self.state.user.first,
|
||||||
|
"last": self.state.user.last
|
||||||
|
},
|
||||||
|
"demographic_info": {
|
||||||
|
"date_of_birth": self.state.user.birthdate,
|
||||||
|
"gender": self.state.user.gender
|
||||||
|
}
|
||||||
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"name": `${self.state.user.first} ${self.state.user.last}`,
|
"name": `${self.state.user.first} ${self.state.user.last}`,
|
||||||
"first": self.state.user.first,
|
"first": self.state.user.first,
|
||||||
@@ -679,12 +694,13 @@ class VerticalNonLinear extends React.Component {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (self.state.user.phonenumber && self.state.user.phonenumber.length > 0) {
|
if(self.state.user.phonenumber && self.state.user.phonenumber.length > 0) {
|
||||||
eligibility.user.phonenumber = eligibility.user.phonenumber.replace('(', '').replace(')', '').replace('-', '').replace(' ', '').trim()
|
eligibility.user.phonenumber = eligibility.user.phonenumber.replace('(','').replace(')','').replace('-','').replace(' ','').trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
Instance.getRawConn().post('/v1/nemt/eligibility', eligibility).then(function (res) {
|
Instance.getRawConn().post('/v1/nemt/eligibility', eligibility).then(function (res) {
|
||||||
self.setState(Object.assign(self.state, { stepIndex: stepIndex + 1, message: '', open: false }));
|
res.data.agreedTerms = true;
|
||||||
|
self.setState(Object.assign(self.state, { stepIndex: stepIndex + 1, user: res.data, message: '', open: false }));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|
||||||
self.setState(Object.assign(self.state, {
|
self.setState(Object.assign(self.state, {
|
||||||
@@ -711,12 +727,6 @@ class VerticalNonLinear extends React.Component {
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
self.handleTouchTap();
|
self.handleTouchTap();
|
||||||
|
|
||||||
self.setState(Object.assign(self.state, {
|
|
||||||
message: 'Adding Visit',
|
|
||||||
open: true,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const visit = {
|
const visit = {
|
||||||
"user": {
|
"user": {
|
||||||
"name": `${self.state.user.first} ${self.state.user.last}`,
|
"name": `${self.state.user.first} ${self.state.user.last}`,
|
||||||
@@ -736,34 +746,29 @@ class VerticalNonLinear extends React.Component {
|
|||||||
"raw_provider": self.state.destination.raw
|
"raw_provider": self.state.destination.raw
|
||||||
};
|
};
|
||||||
|
|
||||||
if (self.state.user.phonenumber && self.state.user.phonenumber.length > 0) {
|
if(self.state.user.phonenumber && self.state.user.phonenumber.length > 0) {
|
||||||
visit.user.phonenumber = visit.user.phonenumber.replace('(', '').replace(')', '').replace('-', '').replace(' ', '').trim()
|
visit.user.phonenumber = visit.user.phonenumber.replace('(','').replace(')','').replace('-','').replace(' ','').trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
Instance.getRawConn().post('/v1/nemt/visits/', visit).then(function (res) {
|
Instance.getRawConn().post('/v1/nemt/visits/', visit).then(function (res) {
|
||||||
self.setState(Object.assign(self.state, {
|
|
||||||
message: '',
|
|
||||||
open: false,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const returnMessage = [
|
const returnMessage = [
|
||||||
{
|
{
|
||||||
message: `Member: ${visit.user.name} (${visit.user.member})`
|
message: `Member: ${res.data.user.name} (${res.data.user.member})`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: `Gender: ${visit.user.gender}`
|
message: `Gender: ${res.data.user.gender}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: `Birth date: ${visit.user.type}`
|
message: `Birth date: ${visit.user.type}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: `Member Type: ${visit.user.birthdate}`
|
message: `Member Type: ${res.data.user.birthdate}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: `Provider: ${visit.raw_provider.providerName}`
|
message: `Provider: ${res.data.provider.name}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: `Date: ${visit.visit_datetime}`
|
message: `Date: ${res.data.visit_datetime}`
|
||||||
}]
|
}]
|
||||||
|
|
||||||
self.setState(Object.assign(self.state, {
|
self.setState(Object.assign(self.state, {
|
||||||
@@ -1276,7 +1281,7 @@ class VerticalNonLinear extends React.Component {
|
|||||||
<div className="box-body padding-xs">
|
<div className="box-body padding-xs">
|
||||||
|
|
||||||
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
||||||
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} draggable={true} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
||||||
<Stepper
|
<Stepper
|
||||||
activeStep={this.state.stepIndex}
|
activeStep={this.state.stepIndex}
|
||||||
linear={false}
|
linear={false}
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ class VerticalNonLinear extends React.Component {
|
|||||||
<div className="box-body padding-xs">
|
<div className="box-body padding-xs">
|
||||||
|
|
||||||
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
||||||
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} draggable={true} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
||||||
|
|
||||||
<Stepper
|
<Stepper
|
||||||
activeStep={this.state.stepIndex}
|
activeStep={this.state.stepIndex}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -108,8 +108,7 @@ class DatatableComponent extends React.Component {
|
|||||||
},
|
},
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ targets: [-1, -3], className: 'dt-body-right mdl-data-table__cell--non-numeric' }
|
{ targets: [-1, -3], className: 'dt-body-right mdl-data-table__cell--non-numeric' }
|
||||||
],
|
]
|
||||||
order: [[0, 'desc']]
|
|
||||||
});
|
});
|
||||||
state.decorateButtons();
|
state.decorateButtons();
|
||||||
state.decorateSelect();
|
state.decorateSelect();
|
||||||
|
|||||||
@@ -2,33 +2,13 @@ import React from 'react';
|
|||||||
import APPCONFIG from 'constants/Config';
|
import APPCONFIG from 'constants/Config';
|
||||||
import TextField from 'material-ui/TextField';
|
import TextField from 'material-ui/TextField';
|
||||||
import QueueAnim from 'rc-queue-anim';
|
import QueueAnim from 'rc-queue-anim';
|
||||||
import RaisedButton from 'material-ui/RaisedButton';
|
|
||||||
import Instance from '../../../components/Connection';
|
|
||||||
|
|
||||||
class ForgotPassowrd extends React.Component {
|
class ForgotPassowrd extends React.Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.state = {
|
this.state = {
|
||||||
brand: APPCONFIG.brand,
|
brand: APPCONFIG.brand
|
||||||
email: '',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.handleEmail = this.handleEmail.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleEmail = (event) => {
|
|
||||||
this.setState(Object.assign(this.state, { email: event.target.value }));
|
|
||||||
};
|
|
||||||
|
|
||||||
clickEvent = (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
Instance.setToken(null).post('/v1/passwordreset/request/' + this.state.email).then(function (res) {
|
|
||||||
location.href = '/#/confirm-email';
|
|
||||||
}).catch(function (err) {
|
|
||||||
location.href = '/#/confirm-email';
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -44,7 +24,6 @@ class ForgotPassowrd extends React.Component {
|
|||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<TextField
|
<TextField
|
||||||
floatingLabelText="Email"
|
floatingLabelText="Email"
|
||||||
onChange={this.handleEmail}
|
|
||||||
type="email"
|
type="email"
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
@@ -57,12 +36,7 @@ class ForgotPassowrd extends React.Component {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-action no-border text-right">
|
<div className="card-action no-border text-right">
|
||||||
<RaisedButton
|
<a href="/#/confirm-password" className="color-primary">Reset</a>
|
||||||
label="Reset"
|
|
||||||
primary={true}
|
|
||||||
onClick={this.clickEvent}
|
|
||||||
disabled={this.state.email===''}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import TextField from 'material-ui/TextField';
|
|
||||||
import QueueAnim from 'rc-queue-anim';
|
|
||||||
import RaisedButton from 'material-ui/RaisedButton';
|
|
||||||
import Instance from '../../../components/Connection';
|
|
||||||
|
|
||||||
class ResetPassowrd extends React.Component {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.state = {
|
|
||||||
validated:false,
|
|
||||||
token:'',
|
|
||||||
pass:'',
|
|
||||||
passConfirmation:'',
|
|
||||||
password_validated:false,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.buttonValidated = this.buttonValidated.bind(this);
|
|
||||||
this.handlePass = this.handlePass.bind(this);
|
|
||||||
this.handleConfirmationPass = this.handleConfirmationPass.bind(this);
|
|
||||||
this.clickEvent = this.clickEvent.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonValidated = () => {
|
|
||||||
let validated = true;
|
|
||||||
if (!this.state.password_validated || !this.state.pass || this.state.pass === null || this.state.pass === "") validated = false;
|
|
||||||
|
|
||||||
this.setState(Object.assign(this.state, { validated: validated }));
|
|
||||||
}
|
|
||||||
|
|
||||||
handlePass = (event) => {
|
|
||||||
this.setState(Object.assign(this.state, { pass: btoa(event.target.value) }));
|
|
||||||
this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation }));
|
|
||||||
};
|
|
||||||
|
|
||||||
handleConfirmationPass = (event) => {
|
|
||||||
this.setState(Object.assign(this.state, { passConfirmation: btoa(event.target.value) }));
|
|
||||||
this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation }));
|
|
||||||
};
|
|
||||||
|
|
||||||
clickEvent = (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
const state = this;
|
|
||||||
|
|
||||||
let user = {
|
|
||||||
"pass": this.state.pass,
|
|
||||||
};
|
|
||||||
|
|
||||||
Instance.setToken(null).post('/v1/passwordreset/complete/' + state.state.token, user).then(function (res) {
|
|
||||||
localStorage.removeItem('loggedUser');
|
|
||||||
location.href = '/#/login';
|
|
||||||
}).catch(function (err) {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillMount(){
|
|
||||||
let urlParts = location.href.split('/');
|
|
||||||
let token = urlParts[urlParts.length - 1];
|
|
||||||
if (token.length < 1) {
|
|
||||||
token = urlParts[urlParts.length - 2]
|
|
||||||
}
|
|
||||||
|
|
||||||
let state = this;
|
|
||||||
|
|
||||||
|
|
||||||
Instance.setToken(null).post('/v1/passwordreset/open/' + token).then(res=>{
|
|
||||||
state.setState(Object.assign(state.state, {
|
|
||||||
token:token
|
|
||||||
}));
|
|
||||||
}).catch(err=>{
|
|
||||||
location.href = '/#/404';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<div className="body-inner">
|
|
||||||
<div className="card bg-white">
|
|
||||||
<div className="card-content">
|
|
||||||
<section className="logo text-center">
|
|
||||||
<h1><a href="#/">Reset Password</a></h1>
|
|
||||||
</section>
|
|
||||||
<form>
|
|
||||||
<fieldset>
|
|
||||||
<div className="form-group">
|
|
||||||
<TextField
|
|
||||||
floatingLabelText="Choose New Password"
|
|
||||||
type="password"
|
|
||||||
onChange={this.handlePass}
|
|
||||||
onBlur={this.buttonValidated}
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
floatingLabelText="Verify New Password"
|
|
||||||
type="password"
|
|
||||||
onChange={this.handleConfirmationPass}
|
|
||||||
onBlur={this.buttonValidated}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div className="card-action no-border text-right">
|
|
||||||
<RaisedButton
|
|
||||||
label="Reset"
|
|
||||||
primary={true}
|
|
||||||
onClick={this.clickEvent}
|
|
||||||
disabled={!this.state.validated}
|
|
||||||
/>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const Page = () => (
|
|
||||||
<div className="page-forgot">
|
|
||||||
<div className="main-body">
|
|
||||||
<QueueAnim type="bottom" className="ui-animate">
|
|
||||||
<div key="1">
|
|
||||||
<ResetPassowrd />
|
|
||||||
</div>
|
|
||||||
</QueueAnim>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
module.exports = Page;
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
path: 'reset-password/:token',
|
|
||||||
getComponent(nextState, cb) {
|
|
||||||
require.ensure([], (require) => {
|
|
||||||
cb(null, require('./components/ResetPassword'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -61,28 +61,15 @@ class SignUp extends React.Component {
|
|||||||
|
|
||||||
componentDidMount = () => { }
|
componentDidMount = () => { }
|
||||||
|
|
||||||
getFormattedPhoneNumber(){
|
|
||||||
if(this.state.phone_number && this.state.phone_number.length > 0) {
|
|
||||||
return this.state.phone_number.replace('+1','').replace('(','').replace(')','').replace('-','').replace(' ','').trim()
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
isPhoneNumberFormatValid() {
|
|
||||||
let formattedNumber = this.getFormattedPhoneNumber();
|
|
||||||
return !isNaN(formattedNumber) && (formattedNumber.toString().length === 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonValidated = () => {
|
buttonValidated = () => {
|
||||||
let validated = true;
|
let validated = true;
|
||||||
if (!this.state.provider_name || this.state.provider_name === null || this.state.provider_name === "") validated = false;
|
if (!this.state.provider_name || this.state.provider_name === null || this.state.provider_name === "") validated = false;
|
||||||
if (!this.state.provider_npi || this.state.provider_npi === null || this.state.provider_npi === "") validated = false;
|
if (!this.state.provider_npi || this.state.provider_npi === null || this.state.provider_npi === "") validated = false;
|
||||||
if (!this.state.email || this.state.email === null || this.state.email === "") validated = false;
|
if (!this.state.email || this.state.email === null || this.state.email === "") validated = false;
|
||||||
if (!this.state.phone_number || this.state.phone_number === null || this.state.phone_number === "" || !this.isPhoneNumberFormatValid()) validated = false;
|
if (!this.state.phone_number || this.state.phone_number === null || this.state.phone_number === "") validated = false;
|
||||||
if (!this.state.first || this.state.first === null || this.state.first === "") validated = false;
|
if (!this.state.first || this.state.first === null || this.state.first === "") validated = false;
|
||||||
if (!this.state.last || this.state.last === null || this.state.last === "") validated = false;
|
if (!this.state.last || this.state.last === null || this.state.last === "") validated = false;
|
||||||
if (!this.state.pass || this.state.pass === null || this.state.pass === "") validated = false;
|
if (!this.state.password_validated || !this.state.pass || this.state.pass === null || this.state.pass === "") validated = false;
|
||||||
if (!this.state.passConfirmation || this.state.passConfirmation === null || this.state.passConfirmation === "") validated = false;
|
|
||||||
if (!this.state.agreedTerms) validated = false;
|
if (!this.state.agreedTerms) validated = false;
|
||||||
this.setState(Object.assign(this.state, { validated: validated }));
|
this.setState(Object.assign(this.state, { validated: validated }));
|
||||||
}
|
}
|
||||||
@@ -119,10 +106,12 @@ class SignUp extends React.Component {
|
|||||||
|
|
||||||
handlePass = (event) => {
|
handlePass = (event) => {
|
||||||
this.setState(Object.assign(this.state, { pass: btoa(event.target.value) }));
|
this.setState(Object.assign(this.state, { pass: btoa(event.target.value) }));
|
||||||
|
this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation }));
|
||||||
};
|
};
|
||||||
|
|
||||||
handleConfirmationPass = (event) => {
|
handleConfirmationPass = (event) => {
|
||||||
this.setState(Object.assign(this.state, { passConfirmation: btoa(event.target.value) }));
|
this.setState(Object.assign(this.state, { passConfirmation: btoa(event.target.value) }));
|
||||||
|
this.setState(Object.assign(this.state, { password_validated: this.state.pass === this.state.passConfirmation }));
|
||||||
};
|
};
|
||||||
|
|
||||||
handleChecked = (event, checked) => {
|
handleChecked = (event, checked) => {
|
||||||
@@ -132,17 +121,6 @@ class SignUp extends React.Component {
|
|||||||
|
|
||||||
clickEvent = (event) => {
|
clickEvent = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (this.state.passConfirmation !== this.state.pass){
|
|
||||||
this.setState(Object.assign(this.state, {
|
|
||||||
showValidationErrors: true,
|
|
||||||
validationErrors: [{message:'Confirmed password does not match password'}]
|
|
||||||
}));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const state = this;
|
const state = this;
|
||||||
|
|
||||||
let user = {
|
let user = {
|
||||||
|
|||||||
Reference in New Issue
Block a user