use draggable dialog
This commit is contained in:
@@ -28,30 +28,39 @@ export class ValidationErrorsInfoDialog extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
const actions = [
|
||||||
<div>
|
<FlatButton
|
||||||
<Dialog
|
label="Dismiss"
|
||||||
title="Errors"
|
primary={true}
|
||||||
actions={actions}
|
onClick={this.handleClose}
|
||||||
modal={this.props.modal ? this.props.modal : false}
|
/>,
|
||||||
open={this.state.open}
|
];
|
||||||
onRequestClose={this.handleClose}
|
|
||||||
overlayStyle={{ backgroundColor: 'transparent' }}
|
|
||||||
>
|
|
||||||
{this.props.errorMessages.map(errorMessage => {
|
|
||||||
const oneValidationMessage = (<span><a>{errorMessage.message}</a><br /></span>);
|
|
||||||
const oneValidationMessageWithTab = (<span><li style={{ marginLeft: 2 + "em" }}>{errorMessage.message}</li></span>);
|
|
||||||
|
|
||||||
if (errorMessage.field_name === "password-tab") {
|
return (
|
||||||
return oneValidationMessageWithTab;
|
<div className="container">
|
||||||
} else {
|
{
|
||||||
return oneValidationMessage;
|
this.state.open &&
|
||||||
|
<Dialog
|
||||||
|
title={this.props.title ? this.props.title : 'Error'}
|
||||||
|
isDraggable={this.props.draggable ? this.props.draggable : false}
|
||||||
|
buttons={actions}
|
||||||
|
hasCloseIcon={false}
|
||||||
|
modal={this.props.modal ? this.props.modal : false}
|
||||||
|
height={defaultDialogHeight + this.props.errorMessages.length * dialogHeightPerLine}
|
||||||
|
>
|
||||||
|
{this.props.errorMessages.map(errorMessage => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<a>{errorMessage.message}</a>
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
);})
|
||||||
|
}
|
||||||
|
</Dialog>
|
||||||
}
|
}
|
||||||
})}
|
</div>
|
||||||
</Dialog>
|
);
|
||||||
</div>
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = ValidationErrorsInfoDialog;
|
module.exports = ValidationErrorsInfoDialog;
|
||||||
|
|||||||
Reference in New Issue
Block a user