Skip to content

Commit e6b55cf

Browse files
authored
fix: Dashboard plugin crashing UI on throw (#2080)
Resolves #1771 **Changes Implemented:** - Wrap `ErrorBoundary` around cloning of Dashboard Plugin in DashboardLayout
1 parent a91e4f3 commit e6b55cf

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

packages/dashboard/src/DashboardLayout.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import type {
1515
} from '@deephaven/golden-layout';
1616
import Log from '@deephaven/log';
1717
import { usePrevious, useThrottledCallback } from '@deephaven/react-hooks';
18+
import { ErrorBoundary } from '@deephaven/components';
1819
import { RootState } from '@deephaven/redux';
1920
import { useDispatch, useSelector } from 'react-redux';
2021
import PanelManager, { ClosedPanels } from './PanelManager';
@@ -343,14 +344,18 @@ export function DashboardLayout({
343344
{isDashboardEmpty && emptyDashboard}
344345
{layoutChildren}
345346
{React.Children.map(children, child =>
346-
child != null
347-
? React.cloneElement(child as ReactElement, {
347+
child != null ? (
348+
// Have fallback be an empty array so that we don't show the error message over entire app
349+
// Look into using toast message in the future
350+
<ErrorBoundary fallback={[]}>
351+
{React.cloneElement(child as ReactElement, {
348352
id,
349353
layout,
350354
panelManager,
351355
registerComponent,
352-
})
353-
: null
356+
})}
357+
</ErrorBoundary>
358+
) : null
354359
)}
355360
</>
356361
);

tests/docker-scripts/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
services:
42
dhc-server:
53
container_name: dhc-server

0 commit comments

Comments
 (0)