Compare commits
1 Commits
ride-valid
...
round-up-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
591d7be308 |
@@ -2340,19 +2340,19 @@ html.static.boxed {
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/fonts/lato/lato-regular-webfont.woff2) format("woff2"), url(/fonts/lato/lato-regular-webfont.woff) format("woff");
|
||||
src: url(/assets/./fonts/646474e48f4c1ea783f43ac5e41fd111.woff2) format("woff2"), url(/assets/./fonts/374df2a818582454b6e6832804e52f86.woff) format("woff");
|
||||
font-weight: bold;
|
||||
font-style: normal; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/assets/./fonts/lato/lato-bolditalic-webfont.woff2) format("woff2"), url(/assets/./fonts/lato/lato-bolditalic-webfont.woff) format("woff");
|
||||
src: url(/assets/./fonts/5fa6d7ddc0a0d53311752343d7176d70.woff2) format("woff2"), url(/assets/./fonts/c53136193516ed2d4fac337d1dc6965a.woff) format("woff");
|
||||
font-weight: bold;
|
||||
font-style: italic; }
|
||||
|
||||
@font-face {
|
||||
font-family: 'Lato';
|
||||
src: url(/assets/./fonts/lato/lato-italic-webfont.woff2) format("woff2"), url(/assets/./fonts/lato/lato-italic-webfont.woff) format("woff");
|
||||
src: url(/assets/./fonts/9bcf055a732c0b22d2279ba79e20c577.woff2) format("woff2"), url(/assets/./fonts/c8eef482ac448a91ecca9d008634c044.woff) format("woff");
|
||||
font-weight: normal;
|
||||
font-style: italic; }
|
||||
|
||||
|
||||
@@ -33,12 +33,9 @@ import Instance from '../../../../../../../components/Connection';
|
||||
import Checkbox from 'material-ui/Checkbox';
|
||||
import Popover from 'material-ui/Popover';
|
||||
|
||||
const ADDRESS_TYPE_HOME = "home";
|
||||
|
||||
let DateTimeFormat;
|
||||
const roundingTime = 1000 * 60 * 5; //5 minutes
|
||||
|
||||
|
||||
DateTimeFormat = global.Intl.DateTimeFormat;
|
||||
|
||||
export class ValidationErrorsInfoDialog extends React.Component {
|
||||
@@ -47,8 +44,8 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
||||
open: this.props.open,
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps){
|
||||
this.setState({open: newProps.open});
|
||||
componentWillReceiveProps(newProps) {
|
||||
this.setState({ open: newProps.open });
|
||||
}
|
||||
|
||||
handleOpen = () => {
|
||||
@@ -79,13 +76,13 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
||||
modal={false}
|
||||
open={this.state.open}
|
||||
onRequestClose={this.handleClose}
|
||||
overlayStyle={{backgroundColor: 'transparent'}}
|
||||
overlayStyle={{ backgroundColor: 'transparent' }}
|
||||
>
|
||||
{this.props.errorMessages.map(errorMessage => {
|
||||
return (
|
||||
<div>
|
||||
<a>{errorMessage.message}</a>
|
||||
<br/>
|
||||
<br />
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
@@ -458,8 +455,8 @@ class VerticalNonLinear extends React.Component {
|
||||
},
|
||||
return_time: new Date(),
|
||||
pickupTimeHide: false,
|
||||
showValidationErrors:false,
|
||||
validationErrors:[],
|
||||
showValidationErrors: false,
|
||||
validationErrors: [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -474,16 +471,6 @@ class VerticalNonLinear extends React.Component {
|
||||
if (user.useruuid !== loggedUser.useruuid) {
|
||||
Instance.getRawConn().get(`/v1/nemt/users/member/${user.useruuid}`)
|
||||
.then(function (res) {
|
||||
let userHomeAddress = null;
|
||||
res.data.addresses.forEach(address => {
|
||||
if (address.address_type === ADDRESS_TYPE_HOME) {
|
||||
userHomeAddress = address;
|
||||
}
|
||||
});
|
||||
if (userHomeAddress != null) {
|
||||
userHomeAddress.name = "Home";
|
||||
state.handlePickupChanged(userHomeAddress, state);
|
||||
}
|
||||
state.setState(Object.assign(state.state, { user: res.data, showUserSelection: true, userSelectionText: `${res.data.member} - ${res.data.name}` }));
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -504,19 +491,17 @@ class VerticalNonLinear extends React.Component {
|
||||
}
|
||||
});
|
||||
|
||||
let date = new Date();
|
||||
let visitTime = new Date(Math.round((date.getTime() + (1 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let visitDate = date;
|
||||
let pickupTime = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let pickupTimeReturn = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
|
||||
let visitTime = new Date(Math.round((date.getTime() + (1 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let visitDate = date;
|
||||
let pickupTime = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
let pickupTimeReturn = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
||||
|
||||
this.setState(Object.assign(this.state, {
|
||||
visitDate: visitDate,
|
||||
visitTime: visitTime,
|
||||
pickupTime: pickupTime,
|
||||
pickupTimeReturn: pickupTimeReturn,
|
||||
}));
|
||||
this.setState(Object.assign(this.state, {
|
||||
visitDate: visitDate,
|
||||
visitTime: visitTime,
|
||||
pickupTime: pickupTime,
|
||||
pickupTimeReturn: pickupTimeReturn,
|
||||
}));
|
||||
}
|
||||
//for snackbar
|
||||
handleTouchTap() {
|
||||
@@ -540,8 +525,7 @@ class VerticalNonLinear extends React.Component {
|
||||
if (stepIndex === 3) {
|
||||
self.handleTouchTap();
|
||||
var requestRide = {
|
||||
user_uuid: state.state.user ? state.state.user.useruuid : '',
|
||||
user_consent: state.state.checked,
|
||||
user_uuid: state.state.user.useruuid,
|
||||
ride_type: "lyft",
|
||||
origin: state.state.origin,
|
||||
destination: state.state.destination,
|
||||
@@ -574,11 +558,11 @@ class VerticalNonLinear extends React.Component {
|
||||
self.handleRequestClose(self);
|
||||
window.location.href = '/#/app/page/map/' + res.data.ride_uuid;
|
||||
}).catch(error => {
|
||||
if (error.response.status === 422){
|
||||
if (error.response.status === 422) {
|
||||
//Unprocessable Entity (validation failed)
|
||||
self.setState(Object.assign(self.state, {
|
||||
showValidationErrors:true,
|
||||
validationErrors:error.response.data.data
|
||||
showValidationErrors: true,
|
||||
validationErrors: error.response.data.data
|
||||
}));
|
||||
}
|
||||
});
|
||||
@@ -822,7 +806,7 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
handlePickupChanged = (res, state) => {
|
||||
let origin = {
|
||||
id: res.address_uuid ? res.address_uuid : res.id,
|
||||
id: res.id,
|
||||
name: res.name,
|
||||
lat: res.lat,
|
||||
lng: res.lng,
|
||||
@@ -868,9 +852,9 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
}
|
||||
|
||||
handleValidationErrosDialogDismiss(){
|
||||
handleValidationErrosDialogDismiss() {
|
||||
this.setState(Object.assign(this.state, {
|
||||
showValidationErrors:false
|
||||
showValidationErrors: false
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -912,17 +896,7 @@ class VerticalNonLinear extends React.Component {
|
||||
|
||||
if (this.state.showUserSelection && this.state.users.length > 0) {
|
||||
const handleAutocomplete = (u) => {
|
||||
let userHomeAddress = null;
|
||||
u.addresses.forEach(address => {
|
||||
if (address.address_type === ADDRESS_TYPE_HOME) {
|
||||
userHomeAddress = address;
|
||||
}
|
||||
});
|
||||
if (userHomeAddress != null) {
|
||||
userHomeAddress.name = "Home";
|
||||
state.handlePickupChanged(userHomeAddress,state);
|
||||
}
|
||||
state.setState(Object.assign(state.state, { user: u, userSelectionText: u.userdata }));
|
||||
state.setState(Object.assign(state.state, { user: u, userSelectionText: u.userdata }));
|
||||
}
|
||||
const datasourceConfig = { text: 'userdata', value: 'useruuid' }
|
||||
userSelection = (
|
||||
@@ -947,8 +921,8 @@ class VerticalNonLinear extends React.Component {
|
||||
<div className="box-body padding-xs">
|
||||
|
||||
<div style={{ maxWidth: 380, margin: 'auto' }}>
|
||||
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
||||
|
||||
<ValidationErrorsInfoDialog open={this.state.showValidationErrors} errorMessages={this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)} />
|
||||
|
||||
<Stepper
|
||||
activeStep={this.state.stepIndex}
|
||||
linear={false}
|
||||
|
||||
@@ -47,9 +47,7 @@ class SignUp extends React.Component {
|
||||
"role": { name: "", key: "SP", desc: "" },
|
||||
"profiles": [],
|
||||
"types": [],
|
||||
"organizations": [],
|
||||
showValidationErrors : false,
|
||||
validationErrors: []
|
||||
"organizations": []
|
||||
}
|
||||
|
||||
this.buttonValidated = this.buttonValidated.bind(this);
|
||||
@@ -228,42 +226,12 @@ class SignUp extends React.Component {
|
||||
localStorage.removeItem('loggedUser');
|
||||
location.href = '/#/login';
|
||||
}).catch(function (err) {
|
||||
if (err.response.status === 422){
|
||||
//Unprocessable Entity (validation failed)
|
||||
state.setState(Object.assign(state.state, {
|
||||
showValidationErrors:true,
|
||||
validationErrors:err.response.data.data
|
||||
}));
|
||||
}else{
|
||||
alert('Error to log in: ' + err.message);
|
||||
}
|
||||
alert('Error to log in: ' + err.message);
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
handleDismiss(){
|
||||
this.setState(Object.assign(this.state, { showErrorMessage: false }));
|
||||
}
|
||||
|
||||
render() {
|
||||
let validationErrors = null;
|
||||
if (this.state.showValidationErrors){
|
||||
validationErrors = (
|
||||
<ul>
|
||||
{this.state.validationErrors.map(errorMessage=>{
|
||||
const oneValidationMessage = (<li>{errorMessage.message}</li>);
|
||||
const oneValidationMessageWithTab = (<span><li style={{marginLeft:2 + "em"}}>{errorMessage.message}</li></span>);
|
||||
|
||||
if (errorMessage.field_name === "password-tab"){
|
||||
return oneValidationMessageWithTab;
|
||||
} else{
|
||||
return oneValidationMessage;
|
||||
}
|
||||
})}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="body-inner">
|
||||
|
||||
@@ -366,10 +334,6 @@ class SignUp extends React.Component {
|
||||
<div className="form-group">
|
||||
<p className="text-small">By clicking on sign up, you agree to <a href="javascript:;"><i>terms</i></a> and <a href="javascript:;"><i>privacy policy</i></a></p>
|
||||
</div>
|
||||
<div className="divider" />
|
||||
<div className="form-group">
|
||||
{validationErrors}
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user