Integrated notifications list

This commit is contained in:
Henry
2015-10-09 14:17:55 -07:00
parent 85300d3743
commit 82ae9e72c1
8 changed files with 66 additions and 41 deletions

View File

@@ -1,16 +1,5 @@
{
"extensions": {
"constants": [
{
"key": "messageSeverity",
"value": {
"ALERT": "alert",
"ERROR": "error",
"INFO": "info",
"SUCCESS": "success"
}
}
],
"services": [
{
"key": "dialogService",

View File

@@ -1,4 +1,9 @@
<div class="l-message message-severity-{{ngModel.severity}}">
<div ng-controller="MessageController"
class="l-message"
title="{{MessageSeverity}}"
ng-class="{'message-severity-info': ngModel.severity===MessageSeverity.INFO,
'message-severity-error': ngModel.severity===MessageSeverity.ERROR,
'message-severity-alert': ngModel.severity===MessageSeverity.ALERT}">
<div class="ui-symbol type-icon message-type"></div>
<div class="message-contents">
<div class="top-bar">

View File

@@ -6,6 +6,13 @@
"value": 3000
}
],
"controllers": [
{
"key": "MessageController",
"implementation": "MessageController.js",
"depends": ["$scope"]
}
],
"services": [
{
"key": "notificationService",

View File

@@ -0,0 +1,34 @@
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT Web includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define*/
define(
['./MessageSeverity'],
function (MessageSeverity) {
"use strict";
function MessageController($scope) {
$scope.MessageSeverity = MessageSeverity;
}
return MessageController;
}
);

View File

@@ -4,8 +4,8 @@
/*global define*/
define(function(){
return {
SUCCESS: 0,
INFO: 1,
INFO: 0,
ALERT: 1,
ERROR: 2
};
});

View File

@@ -112,7 +112,7 @@ define(
*/
NotificationService.prototype.success = function (notification) {
notification.autoDismiss = notification.autoDismiss || true;
notification.severity = MessageSeverity.SUCCESS;
notification.severity = MessageSeverity.INFO;
this.notify(notification);
};
@@ -260,7 +260,7 @@ define(
* @param notification
*/
NotificationService.prototype.dismissOrMinimize = function (notification){
if (notification.severity > MessageSeverity.SUCCESS){
if (notification.severity > MessageSeverity.INFO){
this.minimize(notification);
} else {
this.dismiss(notification);