mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix unified alerting enabled checks (#40693)
This commit is contained in:
parent
6dbb6408d4
commit
51a152456f
@ -4,7 +4,7 @@ import { PanelModel } from 'app/features/dashboard/state';
|
||||
export const hiddenReducerTypes = ['percent_diff', 'percent_diff_abs'];
|
||||
export class ThresholdMapper {
|
||||
static alertToGraphThresholds(panel: PanelModel) {
|
||||
if (!panel.alert || config.featureToggles.ngalert) {
|
||||
if (!panel.alert || config.unifiedAlertingEnabled) {
|
||||
return false; // no update when no alerts
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ export const DeleteDashboardModal: React.FC<DeleteDashboardModalProps> = ({ hide
|
||||
|
||||
const getModalBody = (panels: PanelModel[], title: string) => {
|
||||
const totalAlerts = sumBy(panels, (panel) => (panel.alert ? 1 : 0));
|
||||
return totalAlerts > 0 && !config.featureToggles.ngalert ? (
|
||||
return totalAlerts > 0 && !config.unifiedAlertingEnabled ? (
|
||||
<>
|
||||
<p>Do you want to delete this dashboard?</p>
|
||||
<p>
|
||||
|
@ -26,7 +26,7 @@ export const removePanel = (dashboard: DashboardModel, panel: PanelModel, ask: b
|
||||
// confirm deletion
|
||||
if (ask !== false) {
|
||||
const text2 =
|
||||
panel.alert && !config.featureToggles.ngalert
|
||||
panel.alert && !config.unifiedAlertingEnabled
|
||||
? 'Panel includes an alert rule. removing the panel will also remove the alert rule'
|
||||
: undefined;
|
||||
const confirmText = panel.alert ? 'YES' : undefined;
|
||||
|
@ -31,7 +31,7 @@ class DashboardQueryRunnerImpl implements DashboardQueryRunner {
|
||||
private readonly dashboard: DashboardModel,
|
||||
private readonly timeSrv: TimeSrv = getTimeSrv(),
|
||||
private readonly workers: DashboardQueryRunnerWorker[] = [
|
||||
config.featureToggles.ngalert ? new UnifiedAlertStatesWorker() : new AlertStatesWorker(),
|
||||
config.unifiedAlertingEnabled ? new UnifiedAlertStatesWorker() : new AlertStatesWorker(),
|
||||
new SnapshotWorker(),
|
||||
new AnnotationsWorker(),
|
||||
]
|
||||
|
@ -12,7 +12,7 @@ export class ThresholdFormCtrl {
|
||||
$onInit() {
|
||||
this.panel = this.panelCtrl.panel;
|
||||
|
||||
if (this.panel.alert && !config.featureToggles.ngalert) {
|
||||
if (this.panel.alert && !config.unifiedAlertingEnabled) {
|
||||
this.disabled = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user