From 23c1f513e7f5bcf8ba9e8eb6f1dbf5ff687e328a Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Mon, 16 Jan 2017 09:55:08 -0500 Subject: [PATCH] KEYCLOAK-3953: Remove recalculation of time when units change --- .../admin/resources/js/controllers/clients.js | 3 --- .../admin/resources/js/controllers/realm.js | 21 ------------------- .../theme/base/admin/resources/js/services.js | 5 ----- 3 files changed, 29 deletions(-) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js index f8ec7feb67..d04c6603a3 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/clients.js @@ -1532,9 +1532,6 @@ module.controller('ClientClusteringCtrl', function($scope, client, Client, Clien $scope.client.nodeReRegistrationTimeoutUnit = TimeUnit.autoUnit(client.nodeReRegistrationTimeout); $scope.client.nodeReRegistrationTimeout = TimeUnit.toUnit(client.nodeReRegistrationTimeout, $scope.client.nodeReRegistrationTimeoutUnit); - $scope.$watch('client.nodeReRegistrationTimeoutUnit', function(to, from) { - $scope.client.nodeReRegistrationTimeout = TimeUnit.convert($scope.client.nodeReRegistrationTimeout, from, to); - }); $scope.save = function() { var clientCopy = angular.copy($scope.client); diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 471c4e51f2..b56bcc9a61 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -1482,11 +1482,6 @@ module.controller('RealmEventsConfigCtrl', function($scope, eventsConfig, RealmE $scope.eventsConfig.expirationUnit = TimeUnit.autoUnit(eventsConfig.eventsExpiration); $scope.eventsConfig.eventsExpiration = TimeUnit.toUnit(eventsConfig.eventsExpiration, $scope.eventsConfig.expirationUnit); - $scope.$watch('eventsConfig.expirationUnit', function(to, from) { - if ($scope.eventsConfig.eventsExpiration) { - $scope.eventsConfig.eventsExpiration = TimeUnit.convert($scope.eventsConfig.eventsExpiration, from, to); - } - }); $scope.eventListeners = Object.keys(serverInfo.providers.eventsListener.providers); @@ -1724,27 +1719,15 @@ module.controller('RealmBruteForceCtrl', function($scope, Realm, realm, $http, $ $scope.realm.waitIncrementUnit = TimeUnit.autoUnit(realm.waitIncrementSeconds); $scope.realm.waitIncrement = TimeUnit.toUnit(realm.waitIncrementSeconds, $scope.realm.waitIncrementUnit); - $scope.$watch('realm.waitIncrementUnit', function(to, from) { - $scope.realm.waitIncrement = TimeUnit.convert($scope.realm.waitIncrement, from, to); - }); $scope.realm.minimumQuickLoginWaitUnit = TimeUnit.autoUnit(realm.minimumQuickLoginWaitSeconds); $scope.realm.minimumQuickLoginWait = TimeUnit.toUnit(realm.minimumQuickLoginWaitSeconds, $scope.realm.minimumQuickLoginWaitUnit); - $scope.$watch('realm.minimumQuickLoginWaitUnit', function(to, from) { - $scope.realm.minimumQuickLoginWait = TimeUnit.convert($scope.realm.minimumQuickLoginWait, from, to); - }); $scope.realm.maxFailureWaitUnit = TimeUnit.autoUnit(realm.maxFailureWaitSeconds); $scope.realm.maxFailureWait = TimeUnit.toUnit(realm.maxFailureWaitSeconds, $scope.realm.maxFailureWaitUnit); - $scope.$watch('realm.maxFailureWaitUnit', function(to, from) { - $scope.realm.maxFailureWait = TimeUnit.convert($scope.realm.maxFailureWait, from, to); - }); $scope.realm.maxDeltaTimeUnit = TimeUnit.autoUnit(realm.maxDeltaTimeSeconds); $scope.realm.maxDeltaTime = TimeUnit.toUnit(realm.maxDeltaTimeSeconds, $scope.realm.maxDeltaTimeUnit); - $scope.$watch('realm.maxDeltaTimeUnit', function(to, from) { - $scope.realm.maxDeltaTime = TimeUnit.convert($scope.realm.maxDeltaTime, from, to); - }); var oldCopy = angular.copy($scope.realm); $scope.changed = false; @@ -2333,10 +2316,6 @@ module.controller('ClientInitialAccessCreateCtrl', function($scope, realm, Clien $scope.count = 1; $scope.realm = realm; - $scope.$watch('expirationUnit', function(to, from) { - $scope.expiration = TimeUnit.convert($scope.expiration, from, to); - }); - $scope.save = function() { var expiration = TimeUnit.toSeconds($scope.expiration, $scope.expirationUnit); ClientInitialAccess.save({ diff --git a/themes/src/main/resources/theme/base/admin/resources/js/services.js b/themes/src/main/resources/theme/base/admin/resources/js/services.js index b8cb2a3f8f..fe28afbf63 100755 --- a/themes/src/main/resources/theme/base/admin/resources/js/services.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/services.js @@ -1210,11 +1210,6 @@ module.factory('TimeUnit', function() { } } - t.convert = function(time, from, to) { - var seconds = t.toSeconds(time, from); - return t.toUnit(seconds, to); - } - return t; });