Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 15247185D9 for ; Thu, 7 Jan 2016 15:19:32 +0000 (UTC) Received: (qmail 66294 invoked by uid 500); 7 Jan 2016 15:19:31 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 66260 invoked by uid 500); 7 Jan 2016 15:19:31 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 66251 invoked by uid 99); 7 Jan 2016 15:19:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2016 15:19:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 771F3E2C81; Thu, 7 Jan 2016 15:19:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: giacomolm@apache.org To: commits@syncope.apache.org Message-Id: <217eeb68fc1a4f6fbcbdd3a18ce989f3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: syncope git commit: [SYNCOPE-719] Enduser notifications now are similar to console notifications Date: Thu, 7 Jan 2016 15:19:31 +0000 (UTC) Repository: syncope Updated Branches: refs/heads/master ee590ed7c -> 861457d4f [SYNCOPE-719] Enduser notifications now are similar to console notifications Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/861457d4 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/861457d4 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/861457d4 Branch: refs/heads/master Commit: 861457d4f47a282181a60542937282361d5418be Parents: ee590ed Author: giacomolm Authored: Thu Jan 7 16:19:07 2016 +0100 Committer: giacomolm Committed: Thu Jan 7 16:19:07 2016 +0100 ---------------------------------------------------------------------- client/enduser/pom.xml | 2 +- .../META-INF/resources/app/css/app.css | 8 ++++ .../META-INF/resources/app/css/login.css | 2 +- .../resources/META-INF/resources/app/index.html | 15 ++++--- .../resources/META-INF/resources/app/js/app.js | 41 +++++++++++++------- .../app/js/controllers/LoginController.js | 4 +- .../app/js/controllers/UserController.js | 18 ++++----- .../META-INF/resources/app/views/self.html | 3 +- pom.xml | 6 +-- 9 files changed, 62 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/pom.xml ---------------------------------------------------------------------- diff --git a/client/enduser/pom.xml b/client/enduser/pom.xml index b1c49ec..eea3e87 100644 --- a/client/enduser/pom.xml +++ b/client/enduser/pom.xml @@ -96,7 +96,7 @@ under the License. org.webjars - angular-growl-2 + kendo-ui-core http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/css/app.css ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/css/app.css b/client/enduser/src/main/resources/META-INF/resources/app/css/app.css index e5ae8e5..a4ae15d 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/css/app.css +++ b/client/enduser/src/main/resources/META-INF/resources/app/css/app.css @@ -25,4 +25,12 @@ under the License. -moz-transition:1s linear all; -o-transition:1s linear all; transition:1s linear all; +} + +.k-notification-wrap{ + white-space: normal !important; +} + +.k-notification{ + width : 320px; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/css/login.css ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/css/login.css b/client/enduser/src/main/resources/META-INF/resources/app/css/login.css index 7b0192e..461ad21 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/css/login.css +++ b/client/enduser/src/main/resources/META-INF/resources/app/css/login.css @@ -19,7 +19,7 @@ body, html { /*margin: 45px 0;*/ - height: 100%; + //height: 100%; background-repeat: no-repeat; /*background-image: linear-gradient(rgb(104, 145, 162), #00a65a);*/ /*background-color: #00A65A; http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/index.html ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/index.html b/client/enduser/src/main/resources/META-INF/resources/app/index.html index b684455..eb9b50a 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/index.html +++ b/client/enduser/src/main/resources/META-INF/resources/app/index.html @@ -41,7 +41,10 @@ under the License. -
+
+
+ + - - - @@ -70,7 +70,9 @@ under the License. - + + + @@ -113,7 +115,8 @@ under the License. - + + http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/js/app.js ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js index da0e46f..4d791dc 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js +++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js @@ -34,7 +34,7 @@ var app = angular.module('SyncopeEnduserApp', [ 'ngAnimate', 'ngResource', 'ngCookies', - 'angular-growl', + 'kendo.directives', 'home', 'login', 'language', @@ -42,8 +42,8 @@ var app = angular.module('SyncopeEnduserApp', [ 'info' ]); -app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'growlProvider', - function ($stateProvider, $urlRouterProvider, $httpProvider, growlProvider) { +app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', + function ($stateProvider, $urlRouterProvider, $httpProvider) { // route configuration $stateProvider .state('home', { @@ -229,12 +229,6 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', 'growlProvi }; }); - growlProvider.globalTimeToLive(10000); - growlProvider.globalPosition('bottom-left'); - growlProvider.globalInlineMessages(true); - growlProvider.globalDisableIcons(true); - //to enable html in growl -// growlProvider.globalEnableHtml(true); }]); app.run(['$rootScope', '$location', '$cookies', '$state', @@ -300,10 +294,31 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService', $rootScope.getVersion = function () { return $rootScope.version; }; -// $scope.$on('success', function (event, args) { -// console.log("IN CONFIG EVENTO: ", event) -// $scope.$broadcast("error", "success"); -// }); + + //Intercepting location change event + $rootScope.$on("$locationChangeStart", function (event, next, current) { + //When a location changes, old notifications should be removed + if ($scope.notification != null) { + var pendingNotifications = $scope.notification.getNotifications(); + setTimeout(function () { + pendingNotifications.each(function (idx, element) { + var popup = $(element).data("kendoPopup"); + if (popup) { + popup.close(); + } + }); + }, 3000); + } + }); + + $scope.showSuccess = function (message, component) { + component.options.autoHideAfter = 3000; + component.show(message, "success"); + } + $scope.showError = function (message, component) { + component.options.autoHideAfter = 0; + component.show(message, "error"); + } } }]); app.factory('AuthenticationHelper', ['$q', '$rootScope', http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js index 46ac8ea..40794a3 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js +++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js @@ -20,7 +20,7 @@ 'use strict'; angular.module("login").controller("LoginController", ['$scope', '$rootScope', '$http', '$location', '$cookies', - 'AuthService', 'growl', function ($scope, $rootScope, $http, $location, $cookies, AuthService, growl) { + 'AuthService', function ($scope, $rootScope, $http, $location, $cookies, AuthService) { $scope.credentials = { username: '', @@ -45,7 +45,7 @@ angular.module("login").controller("LoginController", ['$scope', '$rootScope', ' errorMessage = errorMessage.split("}}")[0]; } $scope.credentials.errorMessage = "Login failed: " + errorMessage; - growl.error($scope.credentials.errorMessage, {referenceId: 1}); + $scope.showError($scope.credentials.errorMessage, $scope.notification); }); }; http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js index cb1689a..89eccae 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js +++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/UserController.js @@ -21,8 +21,8 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$location', '$compile', 'AuthService', 'UserSelfService', 'SchemaService', 'RealmService', 'ResourceService', 'SecurityQuestionService', 'CaptchaService', - 'growl', function ($scope, $rootScope, $location, $compile, AuthService, UserSelfService, SchemaService, RealmService, - ResourceService, SecurityQuestionService, CaptchaService, growl) { + function ($scope, $rootScope, $location, $compile, AuthService, UserSelfService, SchemaService, RealmService, + ResourceService, SecurityQuestionService, CaptchaService) { $scope.user = {}; $scope.confirmPassword = { @@ -219,15 +219,15 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l // validate captcha and then save user CaptchaService.validate($scope.captchaInput).then(function (response) { if (!(response === 'true')) { - growl.error("Captcha inserted is not valid, please digit the correct captcha", {referenceId: 2}); + $scope.showError("Captcha inserted is not valid, please digit the correct captcha", $scope.notification); return; } if ($scope.createMode) { UserSelfService.create(user).then(function (response) { - console.log("Created user: ", response); - growl.success("User " + $scope.user.username + " successfully created", {referenceId: 1}); + console.log("Created user: ", response); + $scope.showSuccess("User " + $scope.user.username + " successfully created", $scope.notification); $location.path('/self'); }, function (response) { console.log("Error during user creation: ", response); @@ -237,7 +237,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l errorMessage = response.split("ErrorMessage{{")[1]; errorMessage = errorMessage.split("}}")[0]; } - growl.error("Error: " + (errorMessage || response), {referenceId: 2}); + $scope.showError("Error: " + (errorMessage || response), $scope.notification); }); } else { @@ -247,7 +247,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l AuthService.logout().then(function (response) { console.log("LOGOUT SUCCESS: ", response); $location.path('/self'); - growl.success("User " + $scope.user.username + " successfully updated", {referenceId: 1}); + $scope.showSuccess("User " + $scope.user.username + " successfully updated", $scope.notification); }, function () { console.log("LOGOUT FAILED"); }); @@ -259,7 +259,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l errorMessage = response.split("ErrorMessage{{")[1]; errorMessage = errorMessage.split("}}")[0]; } - growl.error("Error: " + (errorMessage || response), {referenceId: 2}); + $scope.showError("Error: " + (errorMessage || response), $scope.notification); }); } }, function (response) { @@ -270,7 +270,7 @@ angular.module("self").controller("UserController", ['$scope', '$rootScope', '$l errorMessage = response.split("ErrorMessage{{")[1]; errorMessage = errorMessage.split("}}")[0]; } - growl.error("Error: " + (errorMessage || response), {referenceId: 2}); + $scope.showError("Error: " + (errorMessage || response), $scope.notification); return; }); }; http://git-wip-us.apache.org/repos/asf/syncope/blob/861457d4/client/enduser/src/main/resources/META-INF/resources/app/views/self.html ---------------------------------------------------------------------- diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/self.html b/client/enduser/src/main/resources/META-INF/resources/app/views/self.html index a684ec6..895a4db 100644 --- a/client/enduser/src/main/resources/META-INF/resources/app/views/self.html +++ b/client/enduser/src/main/resources/META-INF/resources/app/views/self.html @@ -55,8 +55,7 @@ under the License. -
-
+