This is an automated email from the ASF dual-hosted git repository.
skylark17 pushed a commit to branch 2_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/2_0_X by this push:
new 91c8a83 Improvements in handling messages from URL query strings
91c8a83 is described below
commit 91c8a83a7a56fb34251c23e6c2822d7fbb02a240
Author: Matteo Alessandroni <[email protected]>
AuthorDate: Fri Nov 29 14:59:32 2019 +0100
Improvements in handling messages from URL query strings
---
.../src/main/resources/META-INF/resources/app/js/app.js | 13 ++++++-------
.../META-INF/resources/app/js/controllers/UserController.js | 6 ++++--
2 files changed, 10 insertions(+), 9 deletions(-)
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 7ac4de0..41f6c21 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
@@ -68,7 +68,7 @@ app.config(['$stateProvider', '$urlRouterProvider',
'$httpProvider', '$translate
'ja_*': 'ja',
'*': 'en'
}).fallbackLanguage('en').
- determinePreferredLanguage();
+ determinePreferredLanguage();
/*
* State provider
*/
@@ -403,7 +403,7 @@ app.controller('ApplicationController', ['$scope',
'$rootScope', '$translate', '
{id: '4', name: '日本語', code: 'ja', format: 'yyyy/MM/dd HH:mm'}
]
};
- $rootScope.languages.selectedLanguage =
$rootScope.languages.availableLanguages.filter(function(obj) {
+ $rootScope.languages.selectedLanguage =
$rootScope.languages.availableLanguages.filter(function (obj) {
return obj.code === $translate.preferredLanguage();
})[0];
/*
@@ -565,7 +565,6 @@ app.controller('ApplicationController', ['$scope',
'$rootScope', '$translate', '
|--------------------------------------------------------------------------
*/
$scope.notificationSuccessTimeout = 4000;
-// $scope.notification =
$('#notifications').kendoNotification().data("kendoNotification");
$scope.notification = $("#notifications").kendoNotification({
stacking: "down",
hideOnClick: true,
@@ -574,18 +573,18 @@ app.controller('ApplicationController', ['$scope',
'$rootScope', '$translate', '
$scope.notification.options.position["top"] = 20;
$scope.showSuccess = function (message, component) {
if (!$scope.notificationExists(message)) {
- //forcing scrollTo since kendo doesn't disable scrollTop if pinned
is true
+ // forcing scrollTo since kendo doesn't disable scrollTop if pinned
is true
window.scrollTo(0, 0);
component.options.autoHideAfter = $scope.notificationSuccessTimeout;
- component.show(message, "success");
+ component.show(String(message).replace(/<[^>]+>/gm, ''), "success");
}
};
$scope.showError = function (message, component) {
if (!$scope.notificationExists(message)) {
- //forcing scrollTo since kendo doesn't disable scrollTop if pinned
is true
+ // forcing scrollTo since kendo doesn't disable scrollTop if pinned
is true
window.scrollTo(0, 0);
component.options.autoHideAfter = 0;
- component.show(message, "error");
+ component.show(String(message).replace(/<[^>]+>/gm, ''), "error");
}
};
$scope.hideError = function (message, component) {
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 f919b08..c0e127d 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
@@ -643,7 +643,8 @@ angular.module("self").controller("UserController",
['$scope', '$rootScope', '$l
$translate.use($scope.languages.selectedLanguage.code);
$rootScope.endReached = false;
var destination = params && params.successMessage
- ?
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout?successMessage='
+ params.successMessage
+ ?
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout?successMessage='
+
+ params.successMessage
:
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.Logout';
window.location.href = destination;
};
@@ -651,7 +652,8 @@ angular.module("self").controller("UserController",
['$scope', '$rootScope', '$l
$scope.success = function (params) {
$rootScope.endReached = false;
var destination = params && params.successMessage
- ?
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage?successMessage='
+ params.successMessage
+ ?
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage?successMessage='
+
+ params.successMessage
:
'../wicket/bookmarkable/org.apache.syncope.client.enduser.pages.HomePage';
window.location.href = destination;
};