From 2b97d61d6cf840e2f79023e38258b03d87bf00d7 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 9 Oct 2015 10:59:36 -0700 Subject: [PATCH] Further integration work --- .../general/res/templates/message-banner.html | 22 +++++++++------- .../src/controllers/BannerController.js | 3 +++ .../notification/src/MessageSeverity.js | 3 ++- .../notification/src/NotificationService.js | 3 ++- .../src/NotificationLaunchController.js | 26 +++++++++++++++++-- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/platform/commonUI/general/res/templates/message-banner.html b/platform/commonUI/general/res/templates/message-banner.html index 2e53c2c94b..a896b08702 100644 --- a/platform/commonUI/general/res/templates/message-banner.html +++ b/platform/commonUI/general/res/templates/message-banner.html @@ -3,16 +3,18 @@ class="l-message-banner s-message-banner"> - - + \ No newline at end of file diff --git a/platform/commonUI/general/src/controllers/BannerController.js b/platform/commonUI/general/src/controllers/BannerController.js index b1f26eddce..214283633c 100644 --- a/platform/commonUI/general/src/controllers/BannerController.js +++ b/platform/commonUI/general/src/controllers/BannerController.js @@ -27,6 +27,9 @@ define( "use strict"; function BannerController($scope, notificationService){ $scope.active = notificationService.active; + $scope.dismiss = function(notification){ + notificationService.dismissOrMinimize(notification); + } } return BannerController; }); \ No newline at end of file diff --git a/platform/commonUI/notification/src/MessageSeverity.js b/platform/commonUI/notification/src/MessageSeverity.js index 39e8e6d8d0..5708dd9554 100644 --- a/platform/commonUI/notification/src/MessageSeverity.js +++ b/platform/commonUI/notification/src/MessageSeverity.js @@ -5,6 +5,7 @@ define(function(){ return { SUCCESS: 0, - ERROR: 1 + INFO: 1, + ERROR: 2 }; }); \ No newline at end of file diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index 8ecf2ad0b4..078dde51d5 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -112,6 +112,7 @@ define( */ NotificationService.prototype.success = function (notification) { notification.autoDismiss = notification.autoDismiss || true; + notification.severity = MessageSeverity.SUCCESS; this.notify(notification); }; @@ -206,7 +207,7 @@ define( notification = this.notifications[i]; if (!notification.minimized - && notification!== this.activeNotification) { + && notification!== this.active.notification) { return notification; } diff --git a/testing/dialogTest/src/NotificationLaunchController.js b/testing/dialogTest/src/NotificationLaunchController.js index d475df08cb..0c1aaed657 100644 --- a/testing/dialogTest/src/NotificationLaunchController.js +++ b/testing/dialogTest/src/NotificationLaunchController.js @@ -22,8 +22,8 @@ /*global define*/ define( - [], - function () { + ['../../../platform/commonUI/notification/src/MessageSeverity'], + function (MessageSeverity) { "use strict"; function NotificationLaunchController($scope, notificationService) { @@ -38,6 +38,28 @@ define( title: "Success notification!" }) }; + + $scope.newError = function(){ + + notificationService.notify({ + title: "Error notification!", + severity: MessageSeverity.ERROR + }) + }; + + $scope.newProgress = function(){ + + var notification = { + title: "Progress notification!", + severity: MessageSeverity.INFO, + progress: 0, + progressUnknown: true + + }; + + notificationService.notify(notification) + }; + } return NotificationLaunchController; }