fix: don't mark next round as current before advancement is declared
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m48s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m48s
The applicant timeline sidebar was treating any previous round with status ROUND_CLOSED as "advanced past", which caused the Grand Finale to show "You are here" as soon as the semi-final round closed — before admins declared which teams actually advanced. Require explicit PASSED/COMPLETED project state on every prior round before marking the next one as current. A closed-but-unresolved round now correctly keeps the applicant anchored to it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -202,15 +202,16 @@ export function CompetitionTimelineSidebar() {
|
|||||||
// Is this entry after the elimination point?
|
// Is this entry after the elimination point?
|
||||||
const isAfterElimination = eliminationIndex >= 0 && index > eliminationIndex
|
const isAfterElimination = eliminationIndex >= 0 && index > eliminationIndex
|
||||||
|
|
||||||
// Is this the current round? Either has an active project state,
|
// Is this the current round? Either the project has an active state
|
||||||
// or is the first round the project hasn't passed yet (for seed data
|
// here, or every previous round has an explicit advancement outcome
|
||||||
// where project states may be missing).
|
// (PASSED/COMPLETED). A closed round alone isn't enough — a round can
|
||||||
|
// close before admins declare advancement, and until they do, the
|
||||||
|
// applicant has NOT moved on to the next round.
|
||||||
const hasActiveProjectState = !!entry.projectState && entry.projectState !== 'PASSED' && entry.projectState !== 'COMPLETED' && entry.projectState !== 'REJECTED'
|
const hasActiveProjectState = !!entry.projectState && entry.projectState !== 'PASSED' && entry.projectState !== 'COMPLETED' && entry.projectState !== 'REJECTED'
|
||||||
const isCurrent = !isAfterElimination && (hasActiveProjectState || (
|
const isCurrent = !isAfterElimination && (hasActiveProjectState || (
|
||||||
!isPassed && !isRejected && !isCompleted &&
|
!isPassed && !isRejected && !isCompleted &&
|
||||||
data.entries.slice(0, index).every((prev) =>
|
data.entries.slice(0, index).every((prev) =>
|
||||||
prev.projectState === 'PASSED' || prev.projectState === 'COMPLETED' ||
|
prev.projectState === 'PASSED' || prev.projectState === 'COMPLETED'
|
||||||
prev.status === 'ROUND_CLOSED' || prev.status === 'ROUND_ARCHIVED'
|
|
||||||
) && index > 0
|
) && index > 0
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user