Commit 38279131 by Lauren Muhlhauser Committed by Torkel Ödegaard

NotificationChannels: Add delete button to edit page (#19103)

* Add delete button to edit notification channel page

* Simplified code
parent 3d3bbb71
......@@ -100,6 +100,13 @@ export class AlertNotificationEditCtrl {
}
}
deleteNotification() {
this.backendSrv.delete(`/api/alert-notifications/${this.model.id}`).then((res: any) => {
this.model = res;
this.$location.path('alerting/notifications');
});
}
getNotifierTemplateId(type: string) {
return `notifier-options-${type}`;
}
......
......@@ -70,6 +70,7 @@
<div class="gf-form-group gf-form-button-row">
<button type="submit" ng-click="ctrl.save()" class="btn btn-primary width-7">Save</button>
<button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary width-7">Send Test</button>
<button type="delete" ng-if="!ctrl.isNew" ng-click="ctrl.deleteNotification()" class="btn btn-danger width-7">Delete</button>
<a href="alerting/notifications" class="btn btn-inverse">Back</a>
</div>
</form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment