Added dashboard framework. Components are not yet created nor is the query finalized. BOD-79
Missed in previous commit. BOD-79
This commit is contained in:
@@ -8,39 +8,45 @@ class ErrorBoundary extends React.Component {
|
||||
this.state = {
|
||||
hasErrored: false,
|
||||
error: null,
|
||||
info: null,
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromError(error) {
|
||||
return { hasErrored: true, error };
|
||||
console.log("ErrorBoundary -> getDerivedStateFromError -> error", error);
|
||||
return { hasErrored: true, error: error };
|
||||
}
|
||||
|
||||
componentDidCatch(error, info) {
|
||||
console.log("Exception Caught by Error Boundary.", error, info);
|
||||
this.setState({ ...this.state, error, info });
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log("this.state", this.state);
|
||||
const { t } = this.props;
|
||||
if (this.state.hasErrored === true) {
|
||||
return (
|
||||
<div>
|
||||
<Result
|
||||
status='500'
|
||||
status="500"
|
||||
title={t("general.labels.exceptiontitle")}
|
||||
subTitle={t("general.messages.exception")}
|
||||
extra={
|
||||
<Space>
|
||||
<Button
|
||||
type='primary'
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
window.location.reload();
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("general.actions.refresh")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
alert("Not implemented yet.");
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("general.actions.submitticket")}
|
||||
</Button>
|
||||
</Space>
|
||||
@@ -50,7 +56,10 @@ class ErrorBoundary extends React.Component {
|
||||
<Col offset={6} span={12}>
|
||||
<Collapse bordered={false}>
|
||||
<Collapse.Panel header={t("general.labels.errors")}>
|
||||
{JSON.stringify(this.state.error || "")}
|
||||
<div>
|
||||
<strong>{this.state.error.message}</strong>
|
||||
</div>
|
||||
<div>{this.state.error.stack}</div>
|
||||
</Collapse.Panel>
|
||||
</Collapse>
|
||||
</Col>
|
||||
|
||||
Reference in New Issue
Block a user