diff --git a/app/scripts/directives/notifications/notificationDrawerWrapper.js b/app/scripts/directives/notifications/notificationDrawerWrapper.js index cf6b387527..2342a2f62b 100644 --- a/app/scripts/directives/notifications/notificationDrawerWrapper.js +++ b/app/scripts/directives/notifications/notificationDrawerWrapper.js @@ -99,6 +99,7 @@ _.each(drawer.notificationGroups, function(group) { _.remove(group.notifications, { uid: notification.uid, namespace: notification.namespace }); }); + delete notificationsMap[$routeParams.project][notification.uid]; }; var formatAPIEvents = function(apiEvents) { @@ -172,11 +173,13 @@ }; var notificationWatchCallback = function(event, notification) { - if(!notification.showInDrawer) { + var project = notification.namespace || $routeParams.project; + var id = notification.id ? project + "/" + notification.id : _.uniqueId('notification_') + Date.now(); + + if(!notification.showInDrawer || EventsService.isCleared(id)) { return; } - var project = notification.namespace || $routeParams.project; - var id = notification.id || _.uniqueId('notification_') + Date.now(); + notificationsMap[project] = notificationsMap[project] || {}; notificationsMap[project][id] = { actions: notification.actions, diff --git a/app/scripts/services/quota.js b/app/scripts/services/quota.js index 843efb14fe..c7ad8455bc 100644 --- a/app/scripts/services/quota.js +++ b/app/scripts/services/quota.js @@ -317,7 +317,7 @@ angular.module("openshiftConsole") if(hardValue <= usedValue) { notifications.push({ - id: "quota-limit-reached-" + quotaKey, + id: projectName + "/quota-limit-reached-" + quotaKey, namespace: projectName, type: (hardValue < usedValue ? 'warning' : 'info'), message: getNotificaitonMessage(used, usedValue, hard, hardValue, quotaKey), diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index bbbe63c2a9..f7b4f2da69 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -3598,7 +3598,7 @@ var t = e.status.total || e.status; _.each(t.hard, function(e, s) { var c = m(e), l = _.get(t, [ "used", s ]), d = m(l); "resourcequotas" !== s && c && d && c <= d && i.push({ -id: "quota-limit-reached-" + s, +id: o + "/quota-limit-reached-" + s, namespace: o, type: c < d ? "warning" : "info", message: I(0, d, e, c, s), @@ -14418,7 +14418,7 @@ _.remove(t.notifications, { uid: e.uid, namespace: e.namespace }); -}); +}), delete h[r.project][e.uid]; }, P = function(e) { return _.map(e, function(e) { return { @@ -14456,9 +14456,8 @@ l && l(), l = null; }, $ = function(e) { g[r.project] = P(R(e.by("metadata.name"))), T(); }, B = function(e, t) { -if (t.showInDrawer) { -var n = t.namespace || r.project, a = t.id || _.uniqueId("notification_") + Date.now(); -h[n] = h[n] || {}, h[n][a] = { +var n = t.namespace || r.project, a = t.id ? n + "/" + t.id : _.uniqueId("notification_") + Date.now(); +t.showInDrawer && !c.isCleared(a) && (h[n] = h[n] || {}, h[n][a] = { actions: t.actions, unread: !c.isRead(a), trackByID: t.trackByID, @@ -14470,8 +14469,7 @@ isHTML: t.isHTML, details: t.details, namespace: n, links: t.links -}, T(); -} +}, T()); }, L = function(e, t) { D(), e && (u = s.watch("events", { namespace: e