Add user state filter

pending layout fix if decided where it should be
the toolbar is getting crowded
This commit is contained in:
Johannes Zellner
2022-02-07 16:56:44 +01:00
parent f55c22bdb9
commit b9a76aa6b8
3 changed files with 15 additions and 2 deletions

View File

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