mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 01:21:50 +08:00

* feat(grafana-data): expose PluginContext This is aimed to be used in the `PluginErrorBoundary` (which is a class component, and cannot use the hook.) * feat(PluginErrorBoundary): add an error boundary for plugins * feat(ExtensionsErrorBoundary): add an error boundary for extensions) * feat(Extensions/Utils): wrap components with error boundaries * feat(Plugins): wrap root plugin page with an error boundary * fix: Fallback component should always be visible for onClick() modals * review: use object arguments instead of positional ones for `renderWithPluginContext()` * review: update `wrapWithPluginContext()` to receive args as an object * refactor(AppChromeExtensionPoint): remove the error boundary We have an error boundary on the extensions-framework level now * refactor(ExtensionSidebar): remove the ErrorBoundary from the extensions This is handled on the extensions-framework level now. * test(ExtensionSidebar): add tests * chore: translation extraction * chore: prettier formatting * fix(PluginErrorBoundary): remove unnecessary type casting
21 lines
600 B
TypeScript
21 lines
600 B
TypeScript
import { t } from '@grafana/i18n';
|
|
import { Alert } from '@grafana/ui';
|
|
|
|
export const ExtensionErrorAlert = ({ pluginId, extensionTitle }: { pluginId: string; extensionTitle: string }) => {
|
|
return (
|
|
<Alert
|
|
title={t(
|
|
'plugins.extensions.extension-error-alert-title',
|
|
'Extension failed to load: "{{pluginId}}/{{extensionTitle}}"',
|
|
{
|
|
pluginId,
|
|
extensionTitle,
|
|
}
|
|
)}
|
|
severity="error"
|
|
>
|
|
{t('plugins.extensions.extension-error-alert-description', 'Check the console for more details on the error.')}
|
|
</Alert>
|
|
);
|
|
};
|