Skip to content

Commit ec0a953

Browse files
author
OpenShift Bot
authored
Merge pull request #2222 from dtaylor113/master
Merged by openshift-bot
2 parents b642a34 + 033fe62 commit ec0a953

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

app/scripts/directives/notifications/notificationDrawerWrapper.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
_.each(drawer.notificationGroups, function(group) {
100100
_.remove(group.notifications, { uid: notification.uid, namespace: notification.namespace });
101101
});
102+
delete notificationsMap[$routeParams.project][notification.uid];
102103
};
103104

104105
var formatAPIEvents = function(apiEvents) {
@@ -172,11 +173,13 @@
172173
};
173174

174175
var notificationWatchCallback = function(event, notification) {
175-
if(!notification.showInDrawer) {
176+
var project = notification.namespace || $routeParams.project;
177+
var id = notification.id ? project + "/" + notification.id : _.uniqueId('notification_') + Date.now();
178+
179+
if(!notification.showInDrawer || EventsService.isCleared(id)) {
176180
return;
177181
}
178-
var project = notification.namespace || $routeParams.project;
179-
var id = notification.id || _.uniqueId('notification_') + Date.now();
182+
180183
notificationsMap[project] = notificationsMap[project] || {};
181184
notificationsMap[project][id] = {
182185
actions: notification.actions,

app/scripts/services/quota.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ angular.module("openshiftConsole")
317317

318318
if(hardValue <= usedValue) {
319319
notifications.push({
320-
id: "quota-limit-reached-" + quotaKey,
320+
id: projectName + "/quota-limit-reached-" + quotaKey,
321321
namespace: projectName,
322322
type: (hardValue < usedValue ? 'warning' : 'info'),
323323
message: getNotificaitonMessage(used, usedValue, hard, hardValue, quotaKey),

dist/scripts/scripts.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -3598,7 +3598,7 @@ var t = e.status.total || e.status;
35983598
_.each(t.hard, function(e, s) {
35993599
var c = m(e), l = _.get(t, [ "used", s ]), d = m(l);
36003600
"resourcequotas" !== s && c && d && c <= d && i.push({
3601-
id: "quota-limit-reached-" + s,
3601+
id: o + "/quota-limit-reached-" + s,
36023602
namespace: o,
36033603
type: c < d ? "warning" : "info",
36043604
message: I(0, d, e, c, s),
@@ -14418,7 +14418,7 @@ _.remove(t.notifications, {
1441814418
uid: e.uid,
1441914419
namespace: e.namespace
1442014420
});
14421-
});
14421+
}), delete h[r.project][e.uid];
1442214422
}, P = function(e) {
1442314423
return _.map(e, function(e) {
1442414424
return {
@@ -14456,9 +14456,8 @@ l && l(), l = null;
1445614456
}, $ = function(e) {
1445714457
g[r.project] = P(R(e.by("metadata.name"))), T();
1445814458
}, B = function(e, t) {
14459-
if (t.showInDrawer) {
14460-
var n = t.namespace || r.project, a = t.id || _.uniqueId("notification_") + Date.now();
14461-
h[n] = h[n] || {}, h[n][a] = {
14459+
var n = t.namespace || r.project, a = t.id ? n + "/" + t.id : _.uniqueId("notification_") + Date.now();
14460+
t.showInDrawer && !c.isCleared(a) && (h[n] = h[n] || {}, h[n][a] = {
1446214461
actions: t.actions,
1446314462
unread: !c.isRead(a),
1446414463
trackByID: t.trackByID,
@@ -14470,8 +14469,7 @@ isHTML: t.isHTML,
1447014469
details: t.details,
1447114470
namespace: n,
1447214471
links: t.links
14473-
}, T();
14474-
}
14472+
}, T());
1447514473
}, L = function(e, t) {
1447614474
D(), e && (u = s.watch("events", {
1447714475
namespace: e

0 commit comments

Comments
 (0)