Skip to content

Commit

Permalink
UIPFU-77 - add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Jan 10, 2024
1 parent a7bba68 commit 5ad35b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,20 @@ const filterUsersList = (filterString, initialSelectedUsers, users, filterCheck)
if (filterString === `${ASSIGNED}`) {
const assignedUsers = Object.values(initialSelectedUsers);
if (filterCheck) {
// "Assigned" filter along with one or more other filters from other filter groups are selected
usersList = assignedUsers.filter(u => filterCheck(u));
} else {
// when ONLY "Assigned" filter is selected
usersList = assignedUsers;
}
} else if (filterString === `${UNASSIGNED}`) {
// when ONLY "Unassigned" filter is selected
const assignedUserIds = Object.keys(initialSelectedUsers);
if (filterCheck) {
// "Unassigned" filter along with one or more other filters from other filter groups are selected
usersList = users.filter(u => !assignedUserIds.includes(u.id) && (filterCheck(u)));
} else {
// when ONLY "Unassigned" filter is selected
usersList = users.filter(u => !assignedUserIds.includes(u.id));
}
}
Expand Down

0 comments on commit 5ad35b6

Please sign in to comment.