Alerting: Fix saving advanced mode toggle state in the alert rule editor (#95924)
This commit is contained in:
@@ -313,13 +313,16 @@ func ValidateRuleGroup(
|
||||
uids[rule.UID] = idx
|
||||
}
|
||||
|
||||
var hasPause, isPaused bool
|
||||
var hasPause, isPaused, hasMetadata bool
|
||||
original := ruleGroupConfig.Rules[idx]
|
||||
if alert := original.GrafanaManagedAlert; alert != nil {
|
||||
if alert.IsPaused != nil {
|
||||
isPaused = *alert.IsPaused
|
||||
hasPause = true
|
||||
}
|
||||
if alert.Metadata != nil {
|
||||
hasMetadata = true
|
||||
}
|
||||
}
|
||||
|
||||
ruleWithOptionals := ngmodels.AlertRuleWithOptionals{}
|
||||
@@ -327,6 +330,7 @@ func ValidateRuleGroup(
|
||||
rule.RuleGroupIndex = idx + 1
|
||||
ruleWithOptionals.AlertRule = *rule
|
||||
ruleWithOptionals.HasPause = hasPause
|
||||
ruleWithOptionals.HasMetadata = hasMetadata
|
||||
|
||||
result = append(result, &ruleWithOptionals)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user