Improved error popup

pull/721/head
nchamo 2019-08-31 18:34:47 -03:00
rodzic aa48f8996c
commit d33124705e
3 zmienionych plików z 40 dodań i 2 usunięć

Wyświetl plik

@ -1,12 +1,12 @@
import React, { Component, Fragment } from "react";
import PropTypes from 'prop-types';
import ErrorMessage from "webodm/components/ErrorMessage";
import ResizeModes from 'webodm/classes/ResizeModes';
import PlatformSelectButton from "./components/PlatformSelectButton";
import PlatformDialog from "./components/PlatformDialog";
import LibraryDialog from "./components/LibraryDialog";
import ErrorDialog from "./components/ErrorDialog";
import ConfigureNewTaskDialog from "./components/ConfigureNewTaskDialog";
export default class TaskView extends Component {
@ -90,7 +90,7 @@ export default class TaskView extends Component {
return (
<Fragment>
{error ?
<ErrorMessage bind={[this, "error"]} />
<ErrorDialog errorMessage={error} />
: ""}
<PlatformSelectButton
platforms={platforms}

Wyświetl plik

@ -0,0 +1,35 @@
import PropTypes from 'prop-types';
import { Component } from "react";
import { Modal } from "react-bootstrap";
import "./ErrorDialog.scss";
export default class ErrorDialog extends Component {
static propTypes = {
errorMessage: PropTypes.string.isRequired,
}
constructor(props){
super(props);
this.state = { show: true };
}
handleOnHide = () => this.setState({show: false});
render() {
const { errorMessage } = this.props;
return (
<Modal show={this.state.show}>
<Modal.Header closeButton onHide={this.handleOnHide}>
<Modal.Title>
There was an error with Cloud Import :(
</Modal.Title>
</Modal.Header>
<Modal.Body>
{ errorMessage }
</Modal.Body>
</Modal>
);
}
}

Wyświetl plik

@ -0,0 +1,3 @@
.modal-backdrop {
z-index: 100000 !important;
}