Skip to content

Commit 5389858

Browse files
committed
Correctly hide/show quota notifications per project
1 parent b642a34 commit 5389858

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

app/scripts/directives/notifications/notificationDrawerWrapper.js

Lines changed: 2 additions & 1 deletion
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,7 +173,7 @@
172173
};
173174

174175
var notificationWatchCallback = function(event, notification) {
175-
if(!notification.showInDrawer) {
176+
if(!notification.showInDrawer || EventsService.isCleared(notification.id)) {
176177
return;
177178
}
178179
var project = notification.namespace || $routeParams.project;

app/scripts/services/quota.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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,7 +14456,7 @@ 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) {
14459+
if (t.showInDrawer && !c.isCleared(t.id)) {
1446014460
var n = t.namespace || r.project, a = t.id || _.uniqueId("notification_") + Date.now();
1446114461
h[n] = h[n] || {}, h[n][a] = {
1446214462
actions: t.actions,

0 commit comments

Comments
 (0)