mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 18:39:26 +08:00
Extension Sidebar: Prevent plugin errors from breaking Grafana (#104983)
feat(extensionsidebar): add an errorboundary to prevent crashing entire app if plugin goes pop
This commit is contained in:
@ -2,7 +2,7 @@ import { css } from '@emotion/css';
|
|||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
import { usePluginComponents } from '@grafana/runtime';
|
import { usePluginComponents } from '@grafana/runtime';
|
||||||
import { useTheme2 } from '@grafana/ui';
|
import { ErrorBoundaryAlert, useTheme2 } from '@grafana/ui';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
EXTENSION_SIDEBAR_EXTENSION_POINT_ID,
|
EXTENSION_SIDEBAR_EXTENSION_POINT_ID,
|
||||||
@ -45,7 +45,9 @@ export function ExtensionSidebar() {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.sidebarWrapper}>
|
<div className={styles.sidebarWrapper}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<ExtensionComponent {...props} />
|
<ErrorBoundaryAlert>
|
||||||
|
<ExtensionComponent {...props} />
|
||||||
|
</ErrorBoundaryAlert>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user