-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
66 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import React from "react"; | ||
import { Badge } from "antd"; | ||
import AntdErrorBoundary from "../framework/core/errorBoundries"; | ||
|
||
export default ({ content, color }) => { | ||
return ( | ||
<div> | ||
<Badge color={color}> | ||
{UniversalDashboard.renderComponent(content)} | ||
</Badge> | ||
</div> | ||
); | ||
<AntdErrorBoundary> | ||
<div> | ||
<Badge color={color}>{UniversalDashboard.renderComponent(content)}</Badge> | ||
</div> | ||
</AntdErrorBoundary> | ||
) | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import React from "react" | ||
import { Form } from "antd" | ||
import "antd/lib/form/style/index.css" | ||
import AntdErrorBoundary from "../framework/core/errorBoundries" | ||
|
||
export default ({ id, label, name, rules, content, ...rest }) => { | ||
return ( | ||
<Form.Item key={id} label={label} name={name} rules={rules && [rules]} {...rest}> | ||
{UniversalDashboard.renderComponent(content)} | ||
</Form.Item> | ||
<AntdErrorBoundary> | ||
<Form.Item key={id} label={label} name={name} rules={rules && [rules]} {...rest}> | ||
{UniversalDashboard.renderComponent(content)} | ||
</Form.Item> | ||
</AntdErrorBoundary> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react" | ||
import { useErrorBoundary } from "use-error-boundary" | ||
import { Alert } from "antd" | ||
|
||
const { ErrorBoundary } = Alert | ||
export default function AntdErrorBoundary({ children }) { | ||
const { | ||
didCatch, // boolean - Whether the ErrorBoundary catched something | ||
error, // null or the error | ||
errorInfo, // null or the error info as described in the react docs | ||
} = useErrorBoundary() | ||
|
||
return ( | ||
<ErrorBoundary message={`An Uncaught Error`} description={errorInfo}> | ||
{children} | ||
</ErrorBoundary> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters