From eb5a5023c6c30e161d8363856702be801caff9ce Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Wed, 23 Aug 2017 09:55:19 -0400 Subject: [PATCH] KEYCLOAK-5266: Component numberOfPages in clients view is missing (#4411) --- .../base/admin/resources/js/controllers/clients.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 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 33cb93be30..e3d03b5526 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 @@ -730,12 +730,17 @@ module.controller('ClientImportCtrl', function($scope, $location, $upload, realm module.controller('ClientListCtrl', function($scope, realm, Client, serverInfo, $route, Dialog, Notifications, filterFilter) { $scope.realm = realm; - $scope.clients = Client.query({realm: realm.realm, viewableOnly: true}); + $scope.clients = []; $scope.currentPage = 1; $scope.currentPageInput = 1; + $scope.numberOfPages = 1; $scope.pageSize = 20; - $scope.numberOfPages = Math.ceil($scope.clients.length/$scope.pageSize); - + + Client.query({realm: realm.realm, viewableOnly: true}).$promise.then(function(clients) { + $scope.numberOfPages = Math.ceil(clients.length/$scope.pageSize); + $scope.clients = clients; + }); + $scope.$watch('search', function (newVal, oldVal) { $scope.filtered = filterFilter($scope.clients, newVal); $scope.totalItems = $scope.filtered.length; @@ -743,7 +748,7 @@ module.controller('ClientListCtrl', function($scope, realm, Client, serverInfo, $scope.currentPage = 1; $scope.currentPageInput = 1; }, true); - + $scope.removeClient = function(client) { Dialog.confirmDelete(client.clientId, 'client', function() { Client.remove({