Alerting: Support for active time intervals in notification policies (#104252)
* add active_time_intervals to route model * update k8s compat layer * update notification policies service to validate active time intervals * update integration tests * update openapi * add active time interval to model * update route generator to include active time interval * Update storage list and rename methods to handle active intervals * update api model * update provisioning and export models * update ui to allow active timing config * update i18n * fix snapshots for ui tests * run prettier * Alerting: Active time intervals UI naming (#104402) * update naming in UI * update naming in the edit page title * update translations * update alerting module --------- Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com> Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
This commit is contained in:
co-authored by
Sonia Aguilar
Sonia Aguilar
parent
a8dee54aa4
commit
3e2296acd3
@@ -7,6 +7,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
prommodels "github.com/prometheus/common/model"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
. "github.com/grafana/grafana/pkg/services/ngalert/api/compat"
|
||||
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
||||
@@ -14,7 +16,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/store"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
prommodels "github.com/prometheus/common/model"
|
||||
)
|
||||
|
||||
type RuleLimits struct {
|
||||
@@ -392,12 +393,13 @@ func ValidateRuleGroup(
|
||||
|
||||
func validateNotificationSettings(n *apimodels.AlertRuleNotificationSettings) ([]ngmodels.NotificationSettings, error) {
|
||||
s := ngmodels.NotificationSettings{
|
||||
Receiver: n.Receiver,
|
||||
GroupBy: n.GroupBy,
|
||||
GroupWait: n.GroupWait,
|
||||
GroupInterval: n.GroupInterval,
|
||||
RepeatInterval: n.RepeatInterval,
|
||||
MuteTimeIntervals: n.MuteTimeIntervals,
|
||||
Receiver: n.Receiver,
|
||||
GroupBy: n.GroupBy,
|
||||
GroupWait: n.GroupWait,
|
||||
GroupInterval: n.GroupInterval,
|
||||
RepeatInterval: n.RepeatInterval,
|
||||
MuteTimeIntervals: n.MuteTimeIntervals,
|
||||
ActiveTimeIntervals: n.ActiveTimeIntervals,
|
||||
}
|
||||
|
||||
if err := s.Validate(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user