From 57c2527668ca3ee9ad9865768b5c7f67b9fe6d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Hal=C3=A1sz?= Date: Tue, 17 Oct 2017 15:34:27 +0200 Subject: [PATCH] Notification type error should be rendered in patternfly as danger https://bugzilla.redhat.com/show_bug.cgi?id=1489798 --- .../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 8900d1e0c0f..eb9c66af123 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();