apply material design ; make whole dialog draggable
This commit is contained in:
@@ -4,6 +4,9 @@ import Dialog from './draggable-dialog';
|
|||||||
|
|
||||||
import './draggable-dialog/css/index.css';
|
import './draggable-dialog/css/index.css';
|
||||||
|
|
||||||
|
const defaultDialogHeight = 100; //px
|
||||||
|
const dialogHeightPerLine = 25; //px
|
||||||
|
|
||||||
export class ValidationErrorsInfoDialog extends React.Component {
|
export class ValidationErrorsInfoDialog extends React.Component {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@@ -29,7 +32,6 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
<FlatButton
|
<FlatButton
|
||||||
label="Dismiss"
|
label="Dismiss"
|
||||||
primary={true}
|
primary={true}
|
||||||
keyboardFocused={true}
|
|
||||||
onClick={this.handleClose}
|
onClick={this.handleClose}
|
||||||
/>,
|
/>,
|
||||||
];
|
];
|
||||||
@@ -43,6 +45,8 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
isDraggable={this.props.draggable ? this.props.draggable : false}
|
isDraggable={this.props.draggable ? this.props.draggable : false}
|
||||||
buttons={actions}
|
buttons={actions}
|
||||||
hasCloseIcon={false}
|
hasCloseIcon={false}
|
||||||
|
modal={this.props.modal ? this.props.modal : false}
|
||||||
|
height={defaultDialogHeight + this.props.errorMessages.length * dialogHeightPerLine}
|
||||||
>
|
>
|
||||||
{this.props.errorMessages.map(errorMessage => {
|
{this.props.errorMessages.map(errorMessage => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -51,13 +51,17 @@ a {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
border-bottom: 1px solid #f6f6f6;
|
/*border-bottom: 1px solid #f6f6f6;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog.react-draggable .ui-dialog-titlebar {
|
.ui-dialog.react-draggable .ui-dialog-titlebar {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-dialog.react-draggable .ui-dialog-content {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
.ui-dialog .ui-dialog-titlebar .action-items {
|
.ui-dialog .ui-dialog-titlebar .action-items {
|
||||||
float: right;
|
float: right;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -66,8 +70,11 @@ a {
|
|||||||
.ui-dialog .ui-dialog-titlebar .title {
|
.ui-dialog .ui-dialog-titlebar .title {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: .5em;
|
margin-right: .5em;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
|
||||||
font-size: 1.5em;
|
font-size: 1.3125em;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 0.2em;
|
||||||
|
padding : 24px 0px 0px 19px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
@@ -103,7 +110,12 @@ a {
|
|||||||
border: 0 none;
|
border: 0 none;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0.5em;
|
font-size: 1rem;
|
||||||
|
font-weight: 400;
|
||||||
|
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
|
||||||
|
line-height: 1.5em;
|
||||||
|
color:rgba(0, 0, 0, 0.54);
|
||||||
|
padding : 24px 24px 24px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog .ui-dialog-buttonpane {
|
.ui-dialog .ui-dialog-buttonpane {
|
||||||
@@ -112,7 +124,7 @@ a {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
border-width: 1px 0 0 0;
|
border-width: 1px 0 0 0;
|
||||||
border-top: 1px solid #f6f6f6;
|
/*border-top: 1px solid #f6f6f6;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{
|
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class Dialog extends React.Component {
|
|||||||
|
|
||||||
if (!isMinimized && !isMaximized && isDraggable !== false) {
|
if (!isMinimized && !isMaximized && isDraggable !== false) {
|
||||||
dialog = (
|
dialog = (
|
||||||
<Draggable handle=".ui-dialog-titlebar" bounds="body" defaultPosition={{ x, y }}>
|
<Draggable handle=".ui-dialog" bounds="body" defaultPosition={{ x, y }}>
|
||||||
{dialog}
|
{dialog}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
);
|
);
|
||||||
@@ -153,8 +153,8 @@ Dialog.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Dialog.defaultProps = {
|
Dialog.defaultProps = {
|
||||||
height: 300,
|
height: 200,
|
||||||
width: 500,
|
width: 600,
|
||||||
modal: false,
|
modal: false,
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
isDraggable: false,
|
isDraggable: false,
|
||||||
|
|||||||
@@ -406,8 +406,7 @@ 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
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,8 +525,7 @@ class VerticalNonLinear extends React.Component {
|
|||||||
//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,
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -898,7 +896,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 title={'Errors'} open = {this.state.showValidationErrors} draggable={this.state.draggableDialog} errorMessages = {this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
<ValidationErrorsInfoDialog title={'Errors'} open = {this.state.showValidationErrors} draggable={true} modal={false} errorMessages = {this.state.validationErrors} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
||||||
|
|
||||||
<Stepper
|
<Stepper
|
||||||
activeStep={this.state.stepIndex}
|
activeStep={this.state.stepIndex}
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ class SignUp extends React.Component {
|
|||||||
validated: false,
|
validated: false,
|
||||||
memberType:"S",
|
memberType:"S",
|
||||||
showValidationErrors: false,
|
showValidationErrors: false,
|
||||||
validationErrors:[],
|
validationErrors:[]
|
||||||
draggableDialog: false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
@@ -108,7 +107,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, draggableDialog:false}))
|
state.setState(Object.assign(state.state, {showValidationErrors:true, validationErrors:err.response.data.data}))
|
||||||
}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');
|
||||||
@@ -193,7 +192,7 @@ class SignUp extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<form className="">
|
<form className="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} draggable={this.state.draggableDialog} onDismiss={this.handleValidationErrosDialogDismiss.bind(this)}/>
|
<ValidationErrorsInfoDialog open = {this.state.showValidationErrors} errorMessages = {this.state.validationErrors} draggable={false} modal={true} 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