@@ -3598,7 +3598,7 @@ var t = e.status.total || e.status;
3598
3598
_.each(t.hard, function(e, s) {
3599
3599
var c = m(e), l = _.get(t, [ "used", s ]), d = m(l);
3600
3600
"resourcequotas" !== s && c && d && c <= d && i.push({
3601
- id: " quota-limit-reached-" + s,
3601
+ id: o + "- quota-limit-reached-" + s,
3602
3602
namespace: o,
3603
3603
type: c < d ? "warning" : "info",
3604
3604
message: I(0, d, e, c, s),
@@ -4217,7 +4217,7 @@ return a && u(t, n, a, "warning"), r && u(t, n, r, "error"), o && u(t, n, o, "er
4217
4217
setQuotaNotifications: function(e, t, n) {
4218
4218
var a = o.getQuotaNotifications(e, t, n);
4219
4219
_.each(a, function(e) {
4220
- r.isNotificationPermanentlyHidden (e) || r.addNotification(e);
4220
+ r.isNotificationHidden (e) || r.addNotification(e);
4221
4221
});
4222
4222
}
4223
4223
};
@@ -14389,37 +14389,37 @@ u(), d();
14389
14389
}(), function() {
14390
14390
angular.module("openshiftConsole").component("notificationDrawerWrapper", {
14391
14391
templateUrl: "views/directives/notifications/notification-drawer-wrapper.html",
14392
- controller: [ "$filter", "$interval", "$location", "$timeout", "$routeParams", "$rootScope", "Constants", "DataService", "EventsService", "NotificationsService", function(e, t, n, a, r, o, i, s, c) {
14393
- var l, u, d = _.get(i, "DISABLE_GLOBAL_EVENT_WATCH"), m = e("isIE")() || e("isEdge")(), p = this, f = [], g = {}, h = {}, v = {}, y = function(e) {
14394
- e || (p .drawerHidden = !0);
14395
- }, b = function(e, t) {
14392
+ controller: [ "$filter", "$interval", "$location", "$timeout", "$routeParams", "$rootScope", "Constants", "DataService", "EventsService", "NotificationsService", function(e, t, n, a, r, o, i, s, c, l ) {
14393
+ var u, d, m = _.get(i, "DISABLE_GLOBAL_EVENT_WATCH"), p = e("isIE")() || e("isEdge")(), f = this, g = [], h = {}, v = {}, y = {}, b = function(e) {
14394
+ e || (f .drawerHidden = !0);
14395
+ }, C = function(e, t) {
14396
14396
return _.get(e, "params.project") !== _.get(t, "params.project");
14397
- }, C = function(e) {
14397
+ }, S = function(e) {
14398
14398
return s.get("projects", e, {}, {
14399
14399
errorNotification: !1
14400
14400
}).then(function(e) {
14401
- return v [e.metadata.name] = e, e;
14401
+ return y [e.metadata.name] = e, e;
14402
14402
});
14403
- }, S = function(t, n) {
14403
+ }, w = function(t, n) {
14404
14404
return {
14405
- heading: e("displayName")(v [t]),
14406
- project: v [t],
14405
+ heading: e("displayName")(y [t]),
14406
+ project: y [t],
14407
14407
notifications: n
14408
14408
};
14409
- }, w = function(e) {
14409
+ }, k = function(e) {
14410
14410
return _.filter(e, "unread");
14411
- }, k = function() {
14412
- _.each(p .notificationGroups, function(e) {
14413
- e.totalUnread = w (e.notifications).length, e.hasUnread = !!e.totalUnread, o.$emit("NotificationDrawerWrapper.onUnreadNotifications", e.totalUnread);
14411
+ }, j = function() {
14412
+ _.each(f .notificationGroups, function(e) {
14413
+ e.totalUnread = k (e.notifications).length, e.hasUnread = !!e.totalUnread, o.$emit("NotificationDrawerWrapper.onUnreadNotifications", e.totalUnread);
14414
14414
});
14415
- }, j = function(e) {
14416
- _.each(p .notificationGroups, function(t) {
14415
+ }, P = function(e) {
14416
+ _.each(f .notificationGroups, function(t) {
14417
14417
_.remove(t.notifications, {
14418
14418
uid: e.uid,
14419
14419
namespace: e.namespace
14420
14420
});
14421
- });
14422
- }, P = function(e) {
14421
+ }), delete v[r.project][e.uid] ;
14422
+ }, R = function(e) {
14423
14423
return _.map(e, function(e) {
14424
14424
return {
14425
14425
actions: null,
@@ -14432,33 +14432,33 @@ firstTimestamp: e.firstTimestamp,
14432
14432
event: e
14433
14433
};
14434
14434
});
14435
- }, R = function(e) {
14435
+ }, I = function(e) {
14436
14436
return _.reduce(e, function(e, t) {
14437
14437
return c.isImportantAPIEvent(t) && !c.isCleared(t.metadata.uid) && (e[t.metadata.uid] = t), e;
14438
14438
}, {});
14439
- }, I = function(e, t) {
14439
+ }, E = function(e, t) {
14440
14440
var n = r.project;
14441
14441
return _.assign({}, e[n], t[n]);
14442
- }, E = function(e) {
14442
+ }, T = function(e) {
14443
14443
return _.orderBy(e, [ "event.lastTimestamp", "event.firstTimestamp" ], [ "desc", "desc" ]);
14444
- }, T = function() {
14444
+ }, N = function() {
14445
14445
o.$evalAsync(function() {
14446
- p .notificationGroups = [ S (r.project, E(I(g, h ))) ], k ();
14446
+ f .notificationGroups = [ w (r.project, T(E(h, v ))) ], j ();
14447
14447
});
14448
- }, N = function() {
14449
- _.each(f, function(e) {
14450
- e();
14451
- }), f = [];
14452
14448
}, D = function() {
14453
- u && (s.unwatch(u), u = null);
14449
+ _.each(g, function(e) {
14450
+ e();
14451
+ }), g = [];
14454
14452
}, A = function() {
14455
- l && l(), l = null;
14456
- }, $ = function(e) {
14457
- g[r.project] = P(R(e.by("metadata.name"))), T();
14458
- }, B = function(e, t) {
14453
+ d && (s.unwatch(d), d = null);
14454
+ }, $ = function() {
14455
+ u && u(), u = null;
14456
+ }, B = function(e) {
14457
+ h[r.project] = R(I(e.by("metadata.name"))), N();
14458
+ }, L = function(e, t) {
14459
14459
if (t.showInDrawer) {
14460
14460
var n = t.namespace || r.project, a = t.id || _.uniqueId("notification_") + Date.now();
14461
- h [n] = h [n] || {}, h [n][a] = {
14461
+ v [n] = v [n] || {}, v [n][a] = {
14462
14462
actions: t.actions,
14463
14463
unread: !c.isRead(a),
14464
14464
trackByID: t.trackByID,
@@ -14470,22 +14470,22 @@ isHTML: t.isHTML,
14470
14470
details: t.details,
14471
14471
namespace: n,
14472
14472
links: t.links
14473
- }, T ();
14473
+ }, N ();
14474
14474
}
14475
- }, L = function(e, t) {
14476
- D (), e && (u = s.watch("events", {
14475
+ }, U = function(e, t) {
14476
+ A (), e && (d = s.watch("events", {
14477
14477
namespace: e
14478
14478
}, _.debounce(t, 400), {
14479
14479
skipDigest: !0
14480
14480
}));
14481
- }, U = _.once(function(e, t) {
14482
- A (), l = o.$on("NotificationsService.onNotificationAdded", t);
14483
- }), O = function() {
14484
- C (r.project).then(function() {
14485
- L (r.project, $ ), U (r.project, B ), y (r.project), T ();
14481
+ }, O = _.once(function(e, t) {
14482
+ $ (), u = o.$on("NotificationsService.onNotificationAdded", t);
14483
+ }), F = function() {
14484
+ S (r.project).then(function() {
14485
+ U (r.project, B ), O (r.project, L ), b (r.project), N ();
14486
14486
});
14487
14487
};
14488
- angular.extend(p , {
14488
+ angular.extend(f , {
14489
14489
drawerHidden: !0,
14490
14490
allowExpand: !0,
14491
14491
drawerExpanded: !1,
@@ -14494,52 +14494,52 @@ hasUnread: !1,
14494
14494
showClearAll: !0,
14495
14495
showMarkAllRead: !0,
14496
14496
onClose: function() {
14497
- p .drawerHidden = !0;
14497
+ f .drawerHidden = !0;
14498
14498
},
14499
14499
onMarkAllRead: function(e) {
14500
14500
_.each(e.notifications, function(e) {
14501
14501
e.unread = !1, c.markRead(e.uid);
14502
- }), T (), o.$emit("NotificationDrawerWrapper.onMarkAllRead");
14502
+ }), N (), o.$emit("NotificationDrawerWrapper.onMarkAllRead");
14503
14503
},
14504
14504
onClearAll: function(e) {
14505
14505
_.each(e.notifications, function(e) {
14506
- e.unread = !1, c.markRead(e.uid), c.markCleared(e.uid);
14507
- }), g [r.project] = {}, h [r.project] = {}, T (), o.$emit("NotificationDrawerWrapper.onMarkAllRead");
14506
+ e.unread = !1, l.hideNotification(e.uid), c.markRead(e.uid), c.markCleared(e.uid);
14507
+ }), h [r.project] = {}, v [r.project] = {}, N (), o.$emit("NotificationDrawerWrapper.onMarkAllRead");
14508
14508
},
14509
14509
notificationGroups: [],
14510
14510
headingInclude: "views/directives/notifications/header.html",
14511
14511
notificationBodyInclude: "views/directives/notifications/notification-body.html",
14512
14512
customScope: {
14513
14513
clear: function(e, t, n) {
14514
- c.markCleared(e.uid), n.notifications.splice(t, 1), k ();
14514
+ c.markCleared(e.uid), n.notifications.splice(t, 1), j ();
14515
14515
},
14516
14516
markRead: function(e) {
14517
- e.unread = !1, c.markRead(e.uid), k ();
14517
+ e.unread = !1, c.markRead(e.uid), j ();
14518
14518
},
14519
14519
close: function() {
14520
- p .drawerHidden = !0;
14520
+ f .drawerHidden = !0;
14521
14521
},
14522
14522
onLinkClick: function(e) {
14523
- e.onClick(), p .drawerHidden = !0;
14523
+ e.onClick(), f .drawerHidden = !0;
14524
14524
},
14525
- countUnreadNotifications: k
14525
+ countUnreadNotifications: j
14526
14526
}
14527
14527
});
14528
- var F = function() {
14529
- r.project && O (), f .push(o.$on("$routeChangeSuccess", function(e, t, n) {
14530
- b (t, n) && (p .customScope.projectName = r.project, O ());
14531
- })), f .push(o.$on("NotificationDrawerWrapper.toggle", function() {
14532
- p .drawerHidden = !p .drawerHidden;
14533
- })), f .push(o.$on("NotificationDrawerWrapper.hide", function() {
14534
- p .drawerHidden = !0;
14535
- })), f .push(o.$on("NotificationDrawerWrapper.clear", function(e, t) {
14536
- c.markCleared(t.uid), j(t ), p.countUnreadNotifications ();
14528
+ var x = function() {
14529
+ r.project && F (), g .push(o.$on("$routeChangeSuccess", function(e, t, n) {
14530
+ C (t, n) && (f .customScope.projectName = r.project, F ());
14531
+ })), g .push(o.$on("NotificationDrawerWrapper.toggle", function() {
14532
+ f .drawerHidden = !f .drawerHidden;
14533
+ })), g .push(o.$on("NotificationDrawerWrapper.hide", function() {
14534
+ f .drawerHidden = !0;
14535
+ })), g .push(o.$on("NotificationDrawerWrapper.clear", function(e, t) {
14536
+ c.markCleared(t.uid), l.hideNotification(t.uid ), P(t), j ();
14537
14537
}));
14538
14538
};
14539
- p .$onInit = function() {
14540
- d || m || F ();
14541
- }, p .$onDestroy = function() {
14542
- A (), D (), N ();
14539
+ f .$onInit = function() {
14540
+ m || p || x ();
14541
+ }, f .$onDestroy = function() {
14542
+ $ (), A (), D ();
14543
14543
};
14544
14544
} ]
14545
14545
});
0 commit comments