From 43c3d5b8bafa51a2f3bf8ecf36a23be16d5d4a35 Mon Sep 17 00:00:00 2001 From: Pavel Bakulev Date: Fri, 18 Jan 2019 16:26:23 +0200 Subject: [PATCH] Updated removing notification channel by uid --- public/app/features/alerting/AlertTabCtrl.ts | 7 ++++--- public/app/features/alerting/partials/alert_tab.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts index ecde4aa0a4b..fe27f45e0f3 100644 --- a/public/app/features/alerting/AlertTabCtrl.ts +++ b/public/app/features/alerting/AlertTabCtrl.ts @@ -140,6 +140,7 @@ export class AlertTabCtrl { name: model.name, iconClass: this.getNotificationIcon(model.type), isDefault: false, + uid: model.uid }); if (!_.find(this.alert.notifications, { id: model.id})) { this.alert.notifications.push({ uid: model.uid }); @@ -151,9 +152,9 @@ export class AlertTabCtrl { this.addNotificationSegment.fake = true; } - removeNotification(index) { - this.alert.notifications.splice(index, 1); - this.alertNotifications.splice(index, 1); + removeNotification(deleteUid) { + _.remove(this.alert.notifications, { uid: deleteUid}); + _.remove(this.alertNotifications, { uid: deleteUid}); } initModel() { diff --git a/public/app/features/alerting/partials/alert_tab.html b/public/app/features/alerting/partials/alert_tab.html index 9dfd3da47f9..27518a1e44b 100644 --- a/public/app/features/alerting/partials/alert_tab.html +++ b/public/app/features/alerting/partials/alert_tab.html @@ -135,7 +135,7 @@
 {{nc.name}}  - +