KEYCLOAK-5266: Component numberOfPages in clients view is missing (#4411)

This commit is contained in:
Stan Silvert 2017-08-23 09:55:19 -04:00 committed by GitHub
parent 8e5752c9db
commit eb5a5023c6

View file

@ -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({