GUAC-1120: Move notifications into own service.

This commit is contained in:
Michael Jumper
2015-03-12 15:57:53 -07:00
parent 0d83f0e83d
commit 4475fcb7fb
13 changed files with 219 additions and 145 deletions

View File

@@ -52,6 +52,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
var $document = $injector.get("$document");
var $location = $injector.get("$location");
var authenticationService = $injector.get("authenticationService");
var guacNotification = $injector.get('guacNotification');
var userService = $injector.get("userService");
/**
@@ -62,7 +63,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
name : "USER_MENU.ACTION_ACKNOWLEDGE",
// Handle action
callback : function acknowledgeCallback() {
$scope.showStatus(false);
guacNotification.showStatus(false);
}
};
@@ -234,7 +235,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
// Verify passwords match
if ($scope.newPasswordMatch !== $scope.newPassword) {
$scope.showStatus({
guacNotification.showStatus({
className : 'error',
title : 'USER_MENU.DIALOG_HEADER_ERROR',
text : 'USER_MENU.ERROR_PASSWORD_MISMATCH',
@@ -245,7 +246,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
// Verify that the new password is not blank
if (!$scope.newPassword) {
$scope.showStatus({
guacNotification.showStatus({
className : 'error',
title : 'USER_MENU.DIALOG_HEADER_ERROR',
text : 'USER_MENU.ERROR_PASSWORD_BLANK',
@@ -262,7 +263,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
$scope.closePasswordUpdate();
// Indicate that the password has been changed
$scope.showStatus({
guacNotification.showStatus({
text : 'USER_MENU.PASSWORD_CHANGED',
actions : [ ACKNOWLEDGE_ACTION ]
});
@@ -270,7 +271,7 @@ angular.module('userMenu').directive('guacUserMenu', [function guacUserMenu() {
// Notify of any errors
.error(function passwordUpdateFailed(error) {
$scope.showStatus({
guacNotification.showStatus({
className : 'error',
title : 'USER_MENU.DIALOG_HEADER_ERROR',
'text' : error.message,

View File

@@ -24,4 +24,4 @@
* Module for displaying a user-oriented menu, containing the current username
* and options for navigation, changing the user's password, logging out, etc.
*/
angular.module('userMenu', []);
angular.module('userMenu', ['notification']);