diff --git a/src/app/(admin)/admin/rounds/[roundId]/page.tsx b/src/app/(admin)/admin/rounds/[roundId]/page.tsx index 37e6852..fcc4513 100644 --- a/src/app/(admin)/admin/rounds/[roundId]/page.tsx +++ b/src/app/(admin)/admin/rounds/[roundId]/page.tsx @@ -2376,11 +2376,12 @@ function JuryProgressTable({ roundId }: { roundId: string }) { utils.assignment.listByStage.invalidate({ roundId }) utils.roundEngine.getProjectStates.invalidate({ roundId }) utils.analytics.getJurorWorkload.invalidate({ roundId }) + utils.roundAssignment.unassignedQueue.invalidate({ roundId }) if (data.failedCount > 0) { - toast.warning(`Reassigned ${data.movedCount} project(s). ${data.failedCount} could not be reassigned (all remaining jurors at cap/blocked).`) + toast.warning(`Dropped juror and reassigned ${data.movedCount} project(s). ${data.failedCount} could not be reassigned (all remaining jurors at cap/blocked).`) } else { - toast.success(`Reassigned ${data.movedCount} project(s) evenly across available jurors.`) + toast.success(`Dropped juror and reassigned ${data.movedCount} project(s) evenly across available jurors.`) } }, onError: (err) => toast.error(err.message), @@ -2452,7 +2453,7 @@ function JuryProgressTable({ roundId }: { roundId: string }) { disabled={reshuffleMutation.isPending} onClick={() => { const ok = window.confirm( - `Reassign all unsubmitted projects from ${juror.name} to other jurors within their caps? Submitted and locked evaluations will be preserved. This cannot be undone.` + `Remove ${juror.name} from this jury pool and reassign all their unsubmitted projects to other jurors within their caps? Submitted evaluations will be preserved. This cannot be undone.` ) if (!ok) return reshuffleMutation.mutate({ roundId, jurorId: juror.id }) diff --git a/src/server/routers/assignment.ts b/src/server/routers/assignment.ts index 4956b4b..891a3ec 100644 --- a/src/server/routers/assignment.ts +++ b/src/server/routers/assignment.ts @@ -433,6 +433,19 @@ async function reassignDroppedJurorAssignments(params: { }) } + // Remove the dropped juror from the jury group so they can't be re-assigned + // in future assignment runs for this round's competition. + let removedFromGroup = false + if (round.juryGroupId) { + const deleted = await prisma.juryGroupMember.deleteMany({ + where: { + juryGroupId: round.juryGroupId, + userId: params.droppedJurorId, + }, + }) + removedFromGroup = deleted.count > 0 + } + if (params.auditUserId) { await logAudit({ prisma, @@ -448,6 +461,7 @@ async function reassignDroppedJurorAssignments(params: { failedProjects, skippedProjects, reassignedTo, + removedFromGroup, }, ipAddress: params.auditIp, userAgent: params.auditUserAgent,