From 9b90ac0f25787022dab84d936305689e1efe169d Mon Sep 17 00:00:00 2001 From: laurenashleigh Date: Mon, 8 Dec 2025 15:27:00 +0000 Subject: [PATCH] temporarily remove feature toggle --- .../NewRuleFromPanelButton.tsx | 63 +++++++------------ .../PanelDataPane/NewAlertRuleButton.tsx | 51 ++++++--------- 2 files changed, 41 insertions(+), 73 deletions(-) diff --git a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx index f944e352c67..4c1e2eaf91b 100644 --- a/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx +++ b/public/app/features/alerting/unified/components/panel-alerts-tab/NewRuleFromPanelButton.tsx @@ -2,10 +2,8 @@ import { useState } from 'react'; import { useLocation } from 'react-router-dom-v5-compat'; import { useAsync } from 'react-use'; -import { urlUtil } from '@grafana/data'; import { Trans, t } from '@grafana/i18n'; -import { config } from '@grafana/runtime'; -import { Alert, Button, LinkButton } from '@grafana/ui'; +import { Alert, Button } from '@grafana/ui'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { useSelector } from 'app/types/store'; @@ -59,49 +57,30 @@ export const NewRuleFromPanelButton = ({ dashboard, panel, className }: Props) = ); } - const { onContinueInAlertingFromDrawer, onButtonClick: onContinueInAlertingButton } = createPanelAlertRuleNavigation( + const { onContinueInAlertingFromDrawer } = createPanelAlertRuleNavigation( () => panelToRuleFormValues(panel, dashboard), location ); - const shouldUseDrawer = config.featureToggles.createAlertRuleFromPanel; - - if (shouldUseDrawer) { - return ( - <> - - setIsOpen(false)} - onContinueInAlerting={onContinueInAlertingFromDrawer} - prefill={formValues ?? undefined} - /> - - ); - } - return ( - - New alert rule - + <> + + setIsOpen(false)} + onContinueInAlerting={onContinueInAlertingFromDrawer} + prefill={formValues ?? undefined} + /> + ); }; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/NewAlertRuleButton.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/NewAlertRuleButton.tsx index 80853a5d685..8d988264122 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/NewAlertRuleButton.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/NewAlertRuleButton.tsx @@ -3,7 +3,6 @@ import { useLocation } from 'react-router-dom-v5-compat'; import { useAsync } from 'react-use'; import { Trans, t } from '@grafana/i18n'; -import { config } from '@grafana/runtime'; import { VizPanel } from '@grafana/scenes'; import { Alert, Button } from '@grafana/ui'; import { LogMessages, logInfo } from 'app/features/alerting/unified/Analytics'; @@ -45,40 +44,30 @@ export const ScenesNewRuleFromPanelButton = ({ panel, className }: ScenesNewRule ); } - const { onContinueInAlertingFromDrawer, onButtonClick } = createPanelAlertRuleNavigation( + const { onContinueInAlertingFromDrawer } = createPanelAlertRuleNavigation( () => scenesPanelToRuleFormValues(panel), location ); - const shouldUseDrawer = config.featureToggles.createAlertRuleFromPanel; - - if (shouldUseDrawer) { - return ( - <> - - setIsOpen(false)} - onContinueInAlerting={onContinueInAlertingFromDrawer} - prefill={formValues ?? undefined} - /> - - ); - } - return ( - + <> + + setIsOpen(false)} + onContinueInAlerting={onContinueInAlertingFromDrawer} + prefill={formValues ?? undefined} + /> + ); };