Compare commits
1 Commits
ride-valid
...
round-up-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
591d7be308 |
@@ -2340,19 +2340,19 @@ html.static.boxed {
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Lato';
|
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-weight: bold;
|
||||||
font-style: normal; }
|
font-style: normal; }
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Lato';
|
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-weight: bold;
|
||||||
font-style: italic; }
|
font-style: italic; }
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Lato';
|
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-weight: normal;
|
||||||
font-style: italic; }
|
font-style: italic; }
|
||||||
|
|
||||||
|
|||||||
@@ -33,12 +33,9 @@ import Instance from '../../../../../../../components/Connection';
|
|||||||
import Checkbox from 'material-ui/Checkbox';
|
import Checkbox from 'material-ui/Checkbox';
|
||||||
import Popover from 'material-ui/Popover';
|
import Popover from 'material-ui/Popover';
|
||||||
|
|
||||||
const ADDRESS_TYPE_HOME = "home";
|
|
||||||
|
|
||||||
let DateTimeFormat;
|
let DateTimeFormat;
|
||||||
const roundingTime = 1000 * 60 * 5; //5 minutes
|
const roundingTime = 1000 * 60 * 5; //5 minutes
|
||||||
|
|
||||||
|
|
||||||
DateTimeFormat = global.Intl.DateTimeFormat;
|
DateTimeFormat = global.Intl.DateTimeFormat;
|
||||||
|
|
||||||
export class ValidationErrorsInfoDialog extends React.Component {
|
export class ValidationErrorsInfoDialog extends React.Component {
|
||||||
@@ -47,8 +44,8 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
open: this.props.open,
|
open: this.props.open,
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps){
|
componentWillReceiveProps(newProps) {
|
||||||
this.setState({open: newProps.open});
|
this.setState({ open: newProps.open });
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOpen = () => {
|
handleOpen = () => {
|
||||||
@@ -79,13 +76,13 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
modal={false}
|
modal={false}
|
||||||
open={this.state.open}
|
open={this.state.open}
|
||||||
onRequestClose={this.handleClose}
|
onRequestClose={this.handleClose}
|
||||||
overlayStyle={{backgroundColor: 'transparent'}}
|
overlayStyle={{ backgroundColor: 'transparent' }}
|
||||||
>
|
>
|
||||||
{this.props.errorMessages.map(errorMessage => {
|
{this.props.errorMessages.map(errorMessage => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<a>{errorMessage.message}</a>
|
<a>{errorMessage.message}</a>
|
||||||
<br/>
|
<br />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -458,8 +455,8 @@ class VerticalNonLinear extends React.Component {
|
|||||||
},
|
},
|
||||||
return_time: new Date(),
|
return_time: new Date(),
|
||||||
pickupTimeHide: false,
|
pickupTimeHide: false,
|
||||||
showValidationErrors:false,
|
showValidationErrors: false,
|
||||||
validationErrors:[],
|
validationErrors: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,16 +471,6 @@ class VerticalNonLinear extends React.Component {
|
|||||||
if (user.useruuid !== loggedUser.useruuid) {
|
if (user.useruuid !== loggedUser.useruuid) {
|
||||||
Instance.getRawConn().get(`/v1/nemt/users/member/${user.useruuid}`)
|
Instance.getRawConn().get(`/v1/nemt/users/member/${user.useruuid}`)
|
||||||
.then(function (res) {
|
.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}` }));
|
state.setState(Object.assign(state.state, { user: res.data, showUserSelection: true, userSelectionText: `${res.data.member} - ${res.data.name}` }));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.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);
|
this.setState(Object.assign(this.state, {
|
||||||
let visitDate = date;
|
visitDate: visitDate,
|
||||||
let pickupTime = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
visitTime: visitTime,
|
||||||
let pickupTimeReturn = new Date(Math.round((visitTime.getTime() - (0.5 * 60 * 60 * 1000)) / roundingTime) * roundingTime);
|
pickupTime: pickupTime,
|
||||||
|
pickupTimeReturn: pickupTimeReturn,
|
||||||
this.setState(Object.assign(this.state, {
|
}));
|
||||||
visitDate: visitDate,
|
|
||||||
visitTime: visitTime,
|
|
||||||
pickupTime: pickupTime,
|
|
||||||
pickupTimeReturn: pickupTimeReturn,
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
//for snackbar
|
//for snackbar
|
||||||
handleTouchTap() {
|
handleTouchTap() {
|
||||||
@@ -540,8 +525,7 @@ class VerticalNonLinear extends React.Component {
|
|||||||
if (stepIndex === 3) {
|
if (stepIndex === 3) {
|
||||||
self.handleTouchTap();
|
self.handleTouchTap();
|
||||||
var requestRide = {
|
var requestRide = {
|
||||||
user_uuid: state.state.user ? state.state.user.useruuid : '',
|
user_uuid: state.state.user.useruuid,
|
||||||
user_consent: state.state.checked,
|
|
||||||
ride_type: "lyft",
|
ride_type: "lyft",
|
||||||
origin: state.state.origin,
|
origin: state.state.origin,
|
||||||
destination: state.state.destination,
|
destination: state.state.destination,
|
||||||
@@ -574,11 +558,11 @@ class VerticalNonLinear extends React.Component {
|
|||||||
self.handleRequestClose(self);
|
self.handleRequestClose(self);
|
||||||
window.location.href = '/#/app/page/map/' + res.data.ride_uuid;
|
window.location.href = '/#/app/page/map/' + res.data.ride_uuid;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error.response.status === 422){
|
if (error.response.status === 422) {
|
||||||
//Unprocessable Entity (validation failed)
|
//Unprocessable Entity (validation failed)
|
||||||
self.setState(Object.assign(self.state, {
|
self.setState(Object.assign(self.state, {
|
||||||
showValidationErrors:true,
|
showValidationErrors: true,
|
||||||
validationErrors:error.response.data.data
|
validationErrors: error.response.data.data
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -822,7 +806,7 @@ class VerticalNonLinear extends React.Component {
|
|||||||
|
|
||||||
handlePickupChanged = (res, state) => {
|
handlePickupChanged = (res, state) => {
|
||||||
let origin = {
|
let origin = {
|
||||||
id: res.address_uuid ? res.address_uuid : res.id,
|
id: res.id,
|
||||||
name: res.name,
|
name: res.name,
|
||||||
lat: res.lat,
|
lat: res.lat,
|
||||||
lng: res.lng,
|
lng: res.lng,
|
||||||
@@ -868,9 +852,9 @@ class VerticalNonLinear extends React.Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleValidationErrosDialogDismiss(){
|
handleValidationErrosDialogDismiss() {
|
||||||
this.setState(Object.assign(this.state, {
|
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) {
|
if (this.state.showUserSelection && this.state.users.length > 0) {
|
||||||
const handleAutocomplete = (u) => {
|
const handleAutocomplete = (u) => {
|
||||||
let userHomeAddress = null;
|
state.setState(Object.assign(state.state, { user: u, userSelectionText: u.userdata }));
|
||||||
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 }));
|
|
||||||
}
|
}
|
||||||
const datasourceConfig = { text: 'userdata', value: 'useruuid' }
|
const datasourceConfig = { text: 'userdata', value: 'useruuid' }
|
||||||
userSelection = (
|
userSelection = (
|
||||||
@@ -947,8 +921,8 @@ 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} 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}
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ class SignUp extends React.Component {
|
|||||||
"role": { name: "", key: "SP", desc: "" },
|
"role": { name: "", key: "SP", desc: "" },
|
||||||
"profiles": [],
|
"profiles": [],
|
||||||
"types": [],
|
"types": [],
|
||||||
"organizations": [],
|
"organizations": []
|
||||||
showValidationErrors : false,
|
|
||||||
validationErrors: []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buttonValidated = this.buttonValidated.bind(this);
|
this.buttonValidated = this.buttonValidated.bind(this);
|
||||||
@@ -228,42 +226,12 @@ class SignUp extends React.Component {
|
|||||||
localStorage.removeItem('loggedUser');
|
localStorage.removeItem('loggedUser');
|
||||||
location.href = '/#/login';
|
location.href = '/#/login';
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
if (err.response.status === 422){
|
alert('Error to log in: ' + err.message);
|
||||||
//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);
|
|
||||||
}
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDismiss(){
|
|
||||||
this.setState(Object.assign(this.state, { showErrorMessage: false }));
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
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 (
|
return (
|
||||||
<div className="body-inner">
|
<div className="body-inner">
|
||||||
|
|
||||||
@@ -366,10 +334,6 @@ class SignUp extends React.Component {
|
|||||||
<div className="form-group">
|
<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>
|
<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>
|
||||||
<div className="divider" />
|
|
||||||
<div className="form-group">
|
|
||||||
{validationErrors}
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user