Add Reviews column to Projects tab showing evaluation submission progress
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m36s
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user