Skip to content

Commit

Permalink
Only select BOMs for which at least 1 group has data. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkw31 authored Oct 28, 2024
1 parent a39a716 commit 0add142
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/static/wrstat/src/GroupUserFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const stringSort = new Intl.Collator().compare,
}: GroupUserFilterParams & { num: number }) => {
const selectedGroups = groups.map(gid => groupIDToNameMap.get(gid) ?? "").sort(stringSort).filter(g => g),
selectedUsers = users.map(uid => userIDToNameMap.get(uid) ?? "").sort(stringSort).filter(u => u),
selectedBOMs = Object.entries(areas).map(([bom, groups]) => groups.every(g => groupNameToIDMap.get(g) === undefined || selectedGroups.includes(g)) ? bom : "").filter(b => b).sort(stringSort);
selectedBOMs = Object.entries(areas).map(([bom, groups]) => groups.every(g => groupNameToIDMap.get(g) === undefined || selectedGroups.includes(g)) && groups.some(g => groupNameToIDMap.get(g)) ? bom : "").filter(b => b).sort(stringSort);

return <>
<label htmlFor={`bom_${num}`}>Group Areas</label>
Expand Down

0 comments on commit 0add142

Please sign in to comment.