From 0add142f16935e7f0c341c9002e2bf9d59db539e Mon Sep 17 00:00:00 2001 From: Michael Woolnough <130465766+mjkw31@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:24:07 +0000 Subject: [PATCH] Only select BOMs for which at least 1 group has data. (#3) --- server/static/wrstat/src/GroupUserFilter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/static/wrstat/src/GroupUserFilter.tsx b/server/static/wrstat/src/GroupUserFilter.tsx index ed3d090..7edfab3 100644 --- a/server/static/wrstat/src/GroupUserFilter.tsx +++ b/server/static/wrstat/src/GroupUserFilter.tsx @@ -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 <>