diff --git a/public/app/features/dashboard/components/PanelEditor/AngularPanelPluginWarning.tsx b/public/app/features/dashboard/components/PanelEditor/AngularPanelPluginWarning.tsx new file mode 100644 index 00000000000..7351b628f19 --- /dev/null +++ b/public/app/features/dashboard/components/PanelEditor/AngularPanelPluginWarning.tsx @@ -0,0 +1,48 @@ +import { css } from '@emotion/css'; +import React from 'react'; + +import { GrafanaTheme2, PanelPlugin } from '@grafana/data'; +import { Alert, useStyles2 } from '@grafana/ui'; + +export interface Props { + plugin: PanelPlugin; +} + +export function AngularPanelPluginWarning({ plugin }: Props) { + const styles = useStyles2(getStyles); + + return ( +
+ +
+

The selected panel plugin is using deprecated plugin APIs.

+ +
+
+
+ ); +} + +export function getStyles(theme: GrafanaTheme2) { + return { + wrapper: css({ + padding: theme.spacing(1), + }), + }; +} diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.tsx index 5c2eb9e7189..8fec5bc3feb 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.tsx @@ -7,6 +7,7 @@ import { CustomScrollbar, FilterInput, RadioButtonGroup, useStyles2 } from '@gra import { isPanelModelLibraryPanel } from '../../../library-panels/guard'; import { AngularPanelOptions } from './AngularPanelOptions'; +import { AngularPanelPluginWarning } from './AngularPanelPluginWarning'; import { OptionsPaneCategory } from './OptionsPaneCategory'; import { OptionsPaneCategoryDescriptor } from './OptionsPaneCategoryDescriptor'; import { getFieldOverrideCategories } from './getFieldOverrideElements'; @@ -100,6 +101,7 @@ export const OptionsPaneOptions = (props: OptionPaneRenderProps) => { return (
+ {panel.isAngularPlugin() && }
diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx index 772301165aa..4a5b75a58ff 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx @@ -538,6 +538,11 @@ export const getStyles = stylesFactory((theme: GrafanaTheme2, props: Props) => { justify-content: space-between; flex-wrap: wrap; `, + angularWarning: css` + display: flex; + height: theme.spacing(4); + align-items: center; + `, toolbarLeft: css` padding-left: ${theme.spacing(1)}; `,