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}
+ />
+ >
);
};