From e37dde00363972fb6efc80bf9a5673f6168f4e62 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 3 Feb 2022 14:08:57 +0100 Subject: [PATCH] Alerting: load correct unified alerting tab (#44794) (#44832) (cherry picked from commit 29b97361f70e8991069601a88842080d686dce9f) Co-authored-by: Gilles De Mey --- .../components/PanelEditor/PanelEditorTabs.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx index 1c04cfc2473..8c903e3fbfa 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx @@ -41,7 +41,7 @@ export const PanelEditorTabs: FC = React.memo(({ panel, da {tabs.map((tab) => { if (tab.id === PanelEditorTabId.Alert) { - renderAlertTab(tab, panel, dashboard, onChangeTab); + return renderAlertTab(tab, panel, dashboard, onChangeTab); } return ( void ) { - if (!config.alertingEnabled || !config.unifiedAlertingEnabled) { + const alertingDisabled = !config.alertingEnabled && !config.unifiedAlertingEnabled; + + if (alertingDisabled) { return null; - } else if (config.unifiedAlertingEnabled) { + } + + if (config.unifiedAlertingEnabled) { return ( ); - } else if (config.alertingEnabled) { + } + + if (config.alertingEnabled) { return (