From 28af21bc3770628afdb90cac9ab3390ce3c4e5f5 Mon Sep 17 00:00:00 2001 From: Martin Hradil Date: Tue, 17 Oct 2017 15:27:21 +0000 Subject: [PATCH] Merge pull request #2426 from skateman/error-danger-notifications Notification type error should be rendered in patternfly as danger (cherry picked from commit e0b0998ea2411981252b0a39d18ad498f5de345f) https://bugzilla.redhat.com/show_bug.cgi?id=1503611 --- .../services/event_notifications_service.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/services/event_notifications_service.js b/app/assets/javascripts/services/event_notifications_service.js index 28e7d3d92ae..d73dde38742 100644 --- a/app/assets/javascripts/services/event_notifications_service.js +++ b/app/assets/javascripts/services/event_notifications_service.js @@ -47,6 +47,13 @@ function eventNotifications($timeout, API) { }); }; + var levelToType = function(level) { + if (level === 'error') { + return 'danger'; + } + return level; + }; + this.doReset = function(seed) { state.groups.splice(0, state.groups.length); var events = { @@ -117,7 +124,7 @@ function eventNotifications($timeout, API) { id: id, notificationType: notificationType, unread: true, - type: type, + type: levelToType(type), message: message, data: notificationData, href: id ? '/api/notifications/' + id : undefined, @@ -154,7 +161,7 @@ function eventNotifications($timeout, API) { if (showToast) { notification.unread = true; } - notification.type = type; + notification.type = levelToType(type); notification.message = message; notification.data = notificationData; notification.timeStamp = (new Date()).getTime();