Compare commits
2 Commits
phone-mask
...
frontend-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8205d62a2 | ||
|
|
9802c23210 |
@@ -19,9 +19,10 @@ import Instance from '../../../components/Connection';
|
|||||||
|
|
||||||
import Checkbox from 'material-ui/Checkbox';
|
import Checkbox from 'material-ui/Checkbox';
|
||||||
|
|
||||||
import InputMask from 'react-input-mask';
|
|
||||||
import ValidationErrorsInfoDialog from '../../../components/Shared/ValidationErrorsInfoDialog';
|
import ValidationErrorsInfoDialog from '../../../components/Shared/ValidationErrorsInfoDialog';
|
||||||
|
|
||||||
|
import InputMask from 'react-input-mask';
|
||||||
|
|
||||||
class SignUp extends React.Component {
|
class SignUp extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -62,24 +63,12 @@ class SignUp extends React.Component {
|
|||||||
|
|
||||||
componentDidMount = () => { }
|
componentDidMount = () => { }
|
||||||
|
|
||||||
getFormattedPhoneNumber(phone){
|
|
||||||
if(phone && phone.length > 0) {
|
|
||||||
return phone.replace('+1','').replace('(','').replace(')','').replace('-','').replace(' ','').trim()
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
isPhoneNumberFormatValid() {
|
|
||||||
let formattedNumber = this.getFormattedPhoneNumber(this.state.phone_number);
|
|
||||||
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.pass || this.state.pass === null || this.state.pass === "") validated = false;
|
||||||
@@ -109,11 +98,7 @@ class SignUp extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
handlePhone = (event) => {
|
handlePhone = (event) => {
|
||||||
let phone = this.getFormattedPhoneNumber(event.target.value);
|
let phone = event.target.value;
|
||||||
if (phone.indexOf("+1") < 0 && phone.length == 10) {
|
|
||||||
phone = "+1" + phone;
|
|
||||||
phone = phone.substring(0, 12);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setState(Object.assign(this.state, { phone_number: phone }));
|
this.setState(Object.assign(this.state, { phone_number: phone }));
|
||||||
};
|
};
|
||||||
@@ -160,9 +145,6 @@ class SignUp extends React.Component {
|
|||||||
"pass": this.state.pass,
|
"pass": this.state.pass,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(user);
|
|
||||||
return;
|
|
||||||
|
|
||||||
Instance.setToken(null).post('/v1/selfregister/', user).then(function (res) {
|
Instance.setToken(null).post('/v1/selfregister/', user).then(function (res) {
|
||||||
localStorage.removeItem('loggedUser');
|
localStorage.removeItem('loggedUser');
|
||||||
location.href = '/#/login';
|
location.href = '/#/login';
|
||||||
|
|||||||
Reference in New Issue
Block a user