diff --git a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx index bc6a30ac454..1c04cfc2473 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelEditorTabs.tsx @@ -40,18 +40,8 @@ export const PanelEditorTabs: FC = React.memo(({ panel, da
{tabs.map((tab) => { - if (config.unifiedAlertingEnabled && tab.id === PanelEditorTabId.Alert) { - return ( - onChangeTab(tab)} - icon={tab.icon as IconName} - panel={panel} - dashboard={dashboard} - /> - ); + if (tab.id === PanelEditorTabId.Alert) { + renderAlertTab(tab, panel, dashboard, onChangeTab); } return ( void +) { + if (!config.alertingEnabled || !config.unifiedAlertingEnabled) { + return null; + } else if (config.unifiedAlertingEnabled) { + return ( + onChangeTab(tab)} + icon={tab.icon as IconName} + panel={panel} + dashboard={dashboard} + /> + ); + } else if (config.alertingEnabled) { + return ( + onChangeTab(tab)} + icon={tab.icon as IconName} + counter={getCounter(panel, tab)} + /> + ); + } + + return null; +} + const getStyles = (theme: GrafanaTheme2) => { return { wrapper: css`