From 382791310595d65af150cec38f5854ae56fc556a Mon Sep 17 00:00:00 2001 From: Lauren Muhlhauser Date: Sun, 15 Sep 2019 06:08:57 -0400 Subject: [PATCH] NotificationChannels: Add delete button to edit page (#19103) * Add delete button to edit notification channel page * Simplified code --- public/app/features/alerting/NotificationsEditCtrl.ts | 7 +++++++ .../app/features/alerting/partials/notification_edit.html | 1 + 2 files changed, 8 insertions(+) diff --git a/public/app/features/alerting/NotificationsEditCtrl.ts b/public/app/features/alerting/NotificationsEditCtrl.ts index f0f11fce606..d71c169e557 100644 --- a/public/app/features/alerting/NotificationsEditCtrl.ts +++ b/public/app/features/alerting/NotificationsEditCtrl.ts @@ -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}`; } diff --git a/public/app/features/alerting/partials/notification_edit.html b/public/app/features/alerting/partials/notification_edit.html index 176e29f8514..0135561f963 100644 --- a/public/app/features/alerting/partials/notification_edit.html +++ b/public/app/features/alerting/partials/notification_edit.html @@ -70,6 +70,7 @@
+ Back