Add Reviews column to Projects tab showing evaluation submission progress
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m36s

Backend: getProjectRoundStates now includes assignment counts and submitted
evaluation counts per project. Frontend: new Reviews column shows X/Y
(submitted/total) with green highlight when all reviews are complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 20:38:43 +01:00
parent 5ece50268b
commit 91563f3f47
2 changed files with 42 additions and 3 deletions

View File

@@ -703,7 +703,7 @@ export async function getProjectRoundStates(
roundId: string,
prisma: PrismaClient | any,
) {
return prisma.projectRoundState.findMany({
const states = await prisma.projectRoundState.findMany({
where: { roundId },
include: {
project: {
@@ -714,11 +714,37 @@ export async function getProjectRoundStates(
competitionCategory: true,
country: true,
status: true,
assignments: {
where: { roundId },
select: {
id: true,
isCompleted: true,
evaluation: { select: { status: true } },
},
},
},
},
},
orderBy: { enteredAt: 'desc' },
})
// Compute evaluation progress per project
return states.map((ps: any) => {
const assignments = ps.project?.assignments ?? []
const totalAssignments = assignments.length
const submittedCount = assignments.filter(
(a: any) => a.evaluation?.status === 'SUBMITTED'
).length
return {
...ps,
totalAssignments,
submittedCount,
project: {
...ps.project,
assignments: undefined, // strip raw assignments from response
},
}
})
}
export async function getProjectRoundState(