Add user state filter
pending layout fix if decided where it should be the toolbar is getting crowded
This commit is contained in:
@@ -42,6 +42,17 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
$scope.pageItems = 15;
|
||||
$scope.userRefreshBusy = true;
|
||||
|
||||
$scope.userStates = [
|
||||
{ state: 'ALL', value: null, label: 'All users' },
|
||||
{ state: 'ACTIVE', value: true, label: 'Active users' },
|
||||
{ state: 'INACTIVE', value: false, label: 'Inactive users' }
|
||||
];
|
||||
$scope.userStateFilter = $scope.userStates[0];
|
||||
$scope.$watch('userStateFilter', function (newVal, oldVal) {
|
||||
if (newVal === oldVal) return;
|
||||
$scope.updateFilter();
|
||||
});
|
||||
|
||||
$scope.groupMembers = function (group) {
|
||||
return group.userIds.filter(function (uid) { return !!$scope.allUsersById[uid]; }).map(function (uid) { return $scope.allUsersById[uid].username || $scope.allUsersById[uid].email; }).join(' ');
|
||||
};
|
||||
@@ -1018,7 +1029,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
function getUsers(callback) {
|
||||
var users = [];
|
||||
|
||||
Client.getUsers($scope.userSearchString, $scope.currentPage, $scope.pageItems, function (error, results) {
|
||||
Client.getUsers($scope.userSearchString, $scope.userStateFilter.value, $scope.currentPage, $scope.pageItems, function (error, results) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
async.eachOf(results, function (result, index, iteratorDone) {
|
||||
|
||||
Reference in New Issue
Block a user