Skip to content

Commit 5d62c84

Browse files
committed
feat(alerting): adds default checkbox to ui
1 parent f5297db commit 5d62c84

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

pkg/services/sqlstore/alert_notification.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,18 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
155155
return err
156156
}
157157

158-
alertNotification := &m.AlertNotification{}
159-
alertNotification.Id = cmd.Id
160-
alertNotification.OrgId = cmd.OrgID
161-
alertNotification.Name = cmd.Name
162-
alertNotification.Type = cmd.Type
163-
alertNotification.Settings = cmd.Settings
164-
alertNotification.Updated = time.Now()
165-
alertNotification.Created = current.Created
166-
alertNotification.AlwaysExecute = cmd.AlwaysExecute
158+
alertNotification := &m.AlertNotification{
159+
Id: cmd.Id,
160+
OrgId: cmd.OrgID,
161+
Name: cmd.Name,
162+
Type: cmd.Type,
163+
Settings: cmd.Settings,
164+
Updated: time.Now(),
165+
Created: current.Created,
166+
AlwaysExecute: cmd.AlwaysExecute,
167+
}
168+
169+
sess.UseBool("always_execute")
167170

168171
var affected int64
169172
affected, err = sess.Id(alertNotification.Id).Update(alertNotification)

public/app/features/alerting/partials/notification_edit.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ <h1>Alert notification</h1>
2121
</select>
2222
</div>
2323
</div>
24+
<div class="gf-form">
25+
<gf-form-switch class="gf-form" label-class="width-8" label="Always execute" checked="ctrl.notification.alwaysExecute" on-change=""></gf-form-switch>
26+
</div>
2427
</div>
2528
<div class="gf-form-group section" ng-show="ctrl.notification.type === 'webhook'">
2629
<div class="gf-form">

0 commit comments

Comments
 (0)