feat(core): add notification feedback with angular-ui-notification (#1532)

Added visual notification for user/article updates
angular-ui-notification config added to core client config
Notification idea from #369
This commit is contained in:
Sujeeth
2016-10-10 17:51:44 -04:00
committed by Michael Leanos
parent 5725c449c7
commit 607ed061e3
26 changed files with 122 additions and 137 deletions

View File

@@ -5,9 +5,9 @@
.module('users.admin')
.controller('UserController', UserController);
UserController.$inject = ['$scope', '$state', '$window', 'Authentication', 'userResolve'];
UserController.$inject = ['$scope', '$state', '$window', 'Authentication', 'userResolve', 'Notification'];
function UserController($scope, $state, $window, Authentication, user) {
function UserController($scope, $state, $window, Authentication, user, Notification) {
var vm = this;
vm.authentication = Authentication;
@@ -22,9 +22,11 @@
user.$remove();
vm.users.splice(vm.users.indexOf(user), 1);
Notification.success('User deleted successfully!');
} else {
vm.user.$remove(function () {
$state.go('admin.users');
Notification.success({ message: '<i class="glyphicon glyphicon-ok"></i> User deleted successfully!' });
});
}
}
@@ -43,8 +45,9 @@
$state.go('admin.user', {
userId: user._id
});
Notification.success({ message: '<i class="glyphicon glyphicon-ok"></i> User saved successfully!' });
}, function (errorResponse) {
vm.error = errorResponse.data.message;
Notification.error({ message: errorResponse.data.message, title: '<i class="glyphicon glyphicon-remove"></i> User update error!' });
});
}