Fix voting gate to use round status, make eval doc uploads toggleable
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m26s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m26s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 (
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center gap-4">
|
||||
@@ -325,9 +321,7 @@ export default function JuryEvaluatePage({ params: paramsPromise }: PageProps) {
|
||||
<div>
|
||||
<h2 className="text-lg font-semibold">Evaluation Not Available</h2>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
{!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.
|
||||
</p>
|
||||
<Button variant="outline" size="sm" className="mt-4" asChild>
|
||||
<Link href={`/jury/competitions/${roundId}/projects/${projectId}` as Route}>
|
||||
|
||||
@@ -27,11 +27,8 @@ export default function JuryProjectDetailPage() {
|
||||
{ enabled: !!roundId }
|
||||
)
|
||||
|
||||
// Determine if voting is currently open
|
||||
const now = new Date()
|
||||
const isVotingOpen = round?.status === 'ROUND_ACTIVE' &&
|
||||
round?.windowOpenAt && round?.windowCloseAt &&
|
||||
new Date(round.windowOpenAt) <= now && new Date(round.windowCloseAt) >= now
|
||||
// Round status is the primary gate for evaluations
|
||||
const isVotingOpen = round?.status === 'ROUND_ACTIVE'
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user