integrate draggable dialog package
This commit is contained in:
@@ -57,8 +57,8 @@
|
|||||||
"react": "^15.5.4",
|
"react": "^15.5.4",
|
||||||
"react-cookie": "^2.1.2",
|
"react-cookie": "^2.1.2",
|
||||||
"react-data-components": "^1.1.1",
|
"react-data-components": "^1.1.1",
|
||||||
|
"react-dialog": "^1.0.2",
|
||||||
"react-dom": "^15.5.4",
|
"react-dom": "^15.5.4",
|
||||||
"react-draggable": "^3.0.5",
|
|
||||||
"react-geosuggest": "^2.5.0",
|
"react-geosuggest": "^2.5.0",
|
||||||
"react-geosuggest-sw": "^1.4.13",
|
"react-geosuggest-sw": "^1.4.13",
|
||||||
"react-google-maps": "^7.2.0",
|
"react-google-maps": "^7.2.0",
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Dialog from 'material-ui/Dialog';
|
|
||||||
import FlatButton from 'material-ui/FlatButton';
|
import FlatButton from 'material-ui/FlatButton';
|
||||||
import Draggable, { DraggableCore } from 'react-draggable'; // Both at the same time
|
import Dialog from 'react-dialog'
|
||||||
|
|
||||||
|
import 'react-dialog/css/index.css';
|
||||||
|
|
||||||
export class ValidationErrorsInfoDialog extends React.Component {
|
export class ValidationErrorsInfoDialog extends React.Component {
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
const actions = [
|
const actions = [
|
||||||
<FlatButton
|
<FlatButton
|
||||||
label="Dismiss"
|
label="Dismiss"
|
||||||
@@ -34,24 +35,25 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="container">
|
||||||
<Dialog
|
{
|
||||||
title="Erors"
|
this.state.open &&
|
||||||
actions={actions}
|
<Dialog
|
||||||
modal={this.props.modal ? this.props.modal : false}
|
title={this.props.title ? this.props.title : 'Error'}
|
||||||
open={this.state.open}
|
isDraggable={this.props.draggable ? this.props.draggable : false}
|
||||||
onRequestClose={this.handleClose}
|
buttons={actions}
|
||||||
overlayStyle={{backgroundColor: 'transparent'}}
|
hasCloseIcon={false}
|
||||||
>
|
>
|
||||||
{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>
|
||||||
);
|
);})
|
||||||
})}
|
}
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,8 +405,9 @@ class VerticalNonLinear extends React.Component {
|
|||||||
},
|
},
|
||||||
return_time: new Date(),
|
return_time: new Date(),
|
||||||
pickupTimeHide: false,
|
pickupTimeHide: false,
|
||||||
showValidationErrors: false,
|
showValidationErrors:false,
|
||||||
validationErrors: [],
|
validationErrors:[],
|
||||||
|
draggableDialog: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,8 +525,9 @@ class VerticalNonLinear extends React.Component {
|
|||||||
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,
|
||||||
|
draggableDialog:true,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -896,8 +898,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 title={'Errors'} open = {this.state.showValidationErrors} draggable={this.state.draggableDialog} errorMessages = {this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
||||||
|
|
||||||
<Stepper
|
<Stepper
|
||||||
activeStep={this.state.stepIndex}
|
activeStep={this.state.stepIndex}
|
||||||
linear={false}
|
linear={false}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ class SignUp extends React.Component {
|
|||||||
validated: false,
|
validated: false,
|
||||||
memberType:"S",
|
memberType:"S",
|
||||||
showValidationErrors: false,
|
showValidationErrors: false,
|
||||||
validationErrors:[]
|
validationErrors:[],
|
||||||
|
draggableDialog: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
@@ -107,7 +108,7 @@ class SignUp extends React.Component {
|
|||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
if (err.response.status === 422){
|
if (err.response.status === 422){
|
||||||
//Unprocessable Entity (validation failed)
|
//Unprocessable Entity (validation failed)
|
||||||
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:err.response.data.data}))
|
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:err.response.data.data, draggableDialog:false}))
|
||||||
}else{
|
}else{
|
||||||
console.log('Error to get eligibility: ', err);
|
console.log('Error to get eligibility: ', err);
|
||||||
alert('NO benefits found for this member');
|
alert('NO benefits found for this member');
|
||||||
@@ -192,7 +193,7 @@ class SignUp extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<form className="">
|
<form className="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} modal={true} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} draggable={this.state.draggableDialog} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<TextField
|
<TextField
|
||||||
floatingLabelText="First Name"
|
floatingLabelText="First Name"
|
||||||
|
|||||||
Reference in New Issue
Block a user