Skip to content

Commit

Permalink
fix: Dashboard plugin crashing UI on throw (#2080)
Browse files Browse the repository at this point in the history
Resolves #1771

**Changes Implemented:** 
- Wrap `ErrorBoundary` around cloning of Dashboard Plugin in
DashboardLayout
  • Loading branch information
AkshatJawne authored Jun 17, 2024
1 parent a91e4f3 commit e6b55cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 9 additions & 4 deletions packages/dashboard/src/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
} from '@deephaven/golden-layout';
import Log from '@deephaven/log';
import { usePrevious, useThrottledCallback } from '@deephaven/react-hooks';
import { ErrorBoundary } from '@deephaven/components';
import { RootState } from '@deephaven/redux';
import { useDispatch, useSelector } from 'react-redux';
import PanelManager, { ClosedPanels } from './PanelManager';
Expand Down Expand Up @@ -343,14 +344,18 @@ export function DashboardLayout({
{isDashboardEmpty && emptyDashboard}
{layoutChildren}
{React.Children.map(children, child =>
child != null
? React.cloneElement(child as ReactElement, {
child != null ? (
// Have fallback be an empty array so that we don't show the error message over entire app
// Look into using toast message in the future
<ErrorBoundary fallback={[]}>
{React.cloneElement(child as ReactElement, {
id,
layout,
panelManager,
registerComponent,
})
: null
})}
</ErrorBoundary>
) : null
)}
</>
);
Expand Down
2 changes: 0 additions & 2 deletions tests/docker-scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
dhc-server:
container_name: dhc-server
Expand Down

0 comments on commit e6b55cf

Please sign in to comment.