Fix project status badges to show counts across all pages
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
The status summary badges (Eligible, Rejected, Assigned, etc.) were computed from only the current page's projects. Now uses a groupBy query on the same filters to return statusCounts for all matching projects across all pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -711,13 +711,7 @@ export default function ProjectsPage() {
|
||||
{data && data.projects.length > 0 && (
|
||||
<div className="flex items-center justify-between gap-4">
|
||||
<div className="flex flex-wrap items-center gap-2 text-sm">
|
||||
{Object.entries(
|
||||
data.projects.reduce<Record<string, number>>((acc, p) => {
|
||||
const s = p.status ?? 'SUBMITTED'
|
||||
acc[s] = (acc[s] || 0) + 1
|
||||
return acc
|
||||
}, {})
|
||||
)
|
||||
{Object.entries(data.statusCounts ?? {})
|
||||
.sort(([a], [b]) => {
|
||||
const order = ['SUBMITTED', 'ELIGIBLE', 'ASSIGNED', 'SEMIFINALIST', 'FINALIST', 'WINNER', 'REJECTED', 'WITHDRAWN']
|
||||
return order.indexOf(a) - order.indexOf(b)
|
||||
|
||||
Reference in New Issue
Block a user