From a62f511d7fdc2c13879a704f69e7925ff53e01a2 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 17 Feb 2026 14:13:25 +0100 Subject: [PATCH] Fix voting gate to use round status, make eval doc uploads toggleable Voting check now uses round.status === ROUND_ACTIVE instead of requiring windowOpenAt/windowCloseAt date range, fixing manual open/reopen scenarios. Added requireDocumentUpload toggle (default off) to evaluation round config so rounds reusing prior-round documents don't need file requirements. Co-Authored-By: Claude Opus 4.6 --- .../(admin)/admin/rounds/[roundId]/page.tsx | 62 ++++++++++--------- .../projects/[projectId]/evaluate/page.tsx | 12 +--- .../[roundId]/projects/[projectId]/page.tsx | 7 +-- src/app/(jury)/jury/page.tsx | 7 +-- .../admin/rounds/config/evaluation-config.tsx | 12 ++++ src/types/competition-configs.ts | 2 + 6 files changed, 53 insertions(+), 49 deletions(-) diff --git a/src/app/(admin)/admin/rounds/[roundId]/page.tsx b/src/app/(admin)/admin/rounds/[roundId]/page.tsx index ef50cbb..9c58348 100644 --- a/src/app/(admin)/admin/rounds/[roundId]/page.tsx +++ b/src/app/(admin)/admin/rounds/[roundId]/page.tsx @@ -468,16 +468,18 @@ export default function RoundDetailPage() { action: undefined as Route | undefined, actionLabel: undefined as string | undefined, }, - { - label: 'File requirements set', - ready: (fileRequirements?.length ?? 0) > 0, - detail: - (fileRequirements?.length ?? 0) > 0 - ? `${fileRequirements?.length} requirement(s)` - : 'No file requirements \u2014 configure in Config tab', - action: undefined as Route | undefined, - actionLabel: undefined as string | undefined, - }, + ...((isEvaluation && !(config.requireDocumentUpload as boolean)) + ? [] + : [{ + label: 'File requirements set', + ready: (fileRequirements?.length ?? 0) > 0, + detail: + (fileRequirements?.length ?? 0) > 0 + ? `${fileRequirements?.length} requirement(s)` + : 'No file requirements \u2014 configure in Config tab', + action: undefined as Route | undefined, + actionLabel: undefined as string | undefined, + }]), ] const readyCount = readinessItems.filter((i) => i.ready).length @@ -1738,25 +1740,27 @@ export default function RoundDetailPage() { {/* Evaluation Criteria Editor (EVALUATION rounds only) */} {isEvaluation && } - {/* Document Requirements */} - - - Document Requirements - - Files applicants must submit for this round - {round.windowCloseAt && ( - <> — due by {new Date(round.windowCloseAt).toLocaleDateString()} - )} - - - - - - + {/* Document Requirements — hidden for EVALUATION rounds unless requireDocumentUpload is on */} + {(!isEvaluation || !!(config.requireDocumentUpload as boolean)) && ( + + + Document Requirements + + Files applicants must submit for this round + {round.windowCloseAt && ( + <> — due by {new Date(round.windowCloseAt).toLocaleDateString()} + )} + + + + + + + )} {/* ═══════════ AWARDS TAB ═══════════ */} diff --git a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx index 0e969fa..18b761d 100644 --- a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx +++ b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx @@ -299,14 +299,10 @@ export default function JuryEvaluatePage({ params: paramsPromise }: PageProps) { ) } - // Check if round is active and voting window is open - const now = new Date() + // Check if round is active — round status is the primary gate for evaluations const isRoundActive = round.status === 'ROUND_ACTIVE' - const isWindowOpen = isRoundActive && - round.windowOpenAt && round.windowCloseAt && - new Date(round.windowOpenAt) <= now && new Date(round.windowCloseAt) >= now - if (!isWindowOpen) { + if (!isRoundActive) { return (
@@ -325,9 +321,7 @@ export default function JuryEvaluatePage({ params: paramsPromise }: PageProps) {

Evaluation Not Available

- {!isRoundActive - ? 'This round is not currently active. Evaluations can only be submitted during an active round.' - : 'The voting window for this round is not currently open. Please check back when the window opens.'} + This round is not currently active. Evaluations can only be submitted during an active round.