From 225da3f60eb90757370892338dc369e8efa2a77c Mon Sep 17 00:00:00 2001 From: Sonia Aguilar Date: Tue, 17 Oct 2023 13:11:43 +0200 Subject: [PATCH] Allow alert tab, heart icon in all panel types, and not show warning in DashobardPicker panels --- packages/grafana-data/src/panel/PanelPlugin.ts | 2 +- .../unified/components/rule-editor/DashboardPicker.tsx | 6 ------ .../dashboard/components/PanelEditor/state/selectors.ts | 5 +---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/grafana-data/src/panel/PanelPlugin.ts b/packages/grafana-data/src/panel/PanelPlugin.ts index c0860426f7d..87e0cbba9bb 100644 --- a/packages/grafana-data/src/panel/PanelPlugin.ts +++ b/packages/grafana-data/src/panel/PanelPlugin.ts @@ -117,7 +117,7 @@ export class PanelPlugin< noPadding?: boolean; dataSupport: PanelPluginDataSupport = { annotations: false, - alertStates: false, + alertStates: true, }; /** diff --git a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx index 444325c2535..5a9ee2fd672 100644 --- a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx @@ -146,7 +146,6 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis const panel = filteredPanels[index]; const panelTitle = panel.title || ''; const isSelected = panel.id && selectedPanelId === panel.id?.toString(); - const isAlertingCompatible = panel.type === 'graph' || panel.type === 'timeseries'; const disabled = !isValidPanelIdentifier(panel); return ( @@ -163,11 +162,6 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis
{panelTitle}
- {!isAlertingCompatible && !disabled && ( - - - - )} {disabled && ( diff --git a/public/app/features/dashboard/components/PanelEditor/state/selectors.ts b/public/app/features/dashboard/components/PanelEditor/state/selectors.ts index 02bde1dbaff..a3bf5153d06 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/selectors.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/selectors.ts @@ -43,10 +43,7 @@ export const getPanelEditorTabs = memoizeOne((tab?: string, plugin?: PanelPlugin const hasRuleReadPermissions = contextSrv.hasPermission(getRulesPermissions(GRAFANA_RULES_SOURCE_NAME).read); const isAlertingAvailable = alertingEnabled || (unifiedAlertingEnabled && hasRuleReadPermissions); - const isGraph = plugin.meta.id === 'graph'; - const isTimeseries = plugin.meta.id === 'timeseries'; - - if ((isAlertingAvailable && isGraph) || isTimeseries) { + if (isAlertingAvailable) { tabs.push({ id: PanelEditorTabId.Alert, text: 'Alert',