fix: backfill binaryDecision, fix boolean criterion lookup, add assign buttons
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m9s

- Backfilled 166 evaluations' binaryDecision from criterionScoresJson on production DB
- Fixed roundEvaluationScores and ai-ranking to look in EvaluationForm.criteriaJson
  instead of round.configJson for the boolean "Move to the Next Stage?" criterion
- Added advanceMode (count/threshold) toggle to round config Advancement Targets
- Added "Assign to Jurors" button on Unassigned Projects section and Projects tab bulk bar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 12:48:08 +01:00
parent 19b58e4434
commit 2df9c54de2
6 changed files with 142 additions and 70 deletions

View File

@@ -1434,7 +1434,10 @@ export default function RoundDetailPage() {
{/* ═══════════ PROJECTS TAB ═══════════ */}
<TabsContent value="projects" className="space-y-4">
<ProjectStatesTable competitionId={competitionId} roundId={roundId} />
<ProjectStatesTable competitionId={competitionId} roundId={roundId} onAssignProjects={() => {
setActiveTab('assignments')
setTimeout(() => setPreviewSheetOpen(true), 100)
}} />
</TabsContent>
{/* ═══════════ FILTERING TAB ═══════════ */}
@@ -1797,7 +1800,7 @@ export default function RoundDetailPage() {
</CardHeader>
<CardContent className="space-y-6">
<COIReviewSection roundId={roundId} />
<RoundUnassignedQueue roundId={roundId} requiredReviews={(config.requiredReviewsPerProject as number) || 3} />
<RoundUnassignedQueue roundId={roundId} requiredReviews={(config.requiredReviewsPerProject as number) || 3} onAssignUnassigned={() => setPreviewSheetOpen(true)} />
</CardContent>
</Card>
@@ -2157,50 +2160,103 @@ export default function RoundDetailPage() {
<div className="border-t mt-2 pt-4 px-4 pb-2 bg-[#053d57]/[0.03] rounded-b-lg -mx-6 -mb-6 p-6">
<Label className="text-sm font-medium">Advancement Targets</Label>
{isEvaluation && !(config.startupAdvanceCount as number) && !(config.conceptAdvanceCount as number) && (
<div className="mt-2 mb-1 rounded-md border border-amber-200 bg-amber-50 px-3 py-2">
<p className="text-xs text-amber-700">Advancement targets not configured all passed projects will be eligible to advance.</p>
</div>
)}
<p className="text-xs text-muted-foreground mb-3">
Target number of projects per category to advance from this round
How to determine which projects advance from this round
</p>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-1.5">
<Label htmlFor="startup-advance-count" className="text-xs text-muted-foreground">
Startup Projects
</Label>
<Input
id="startup-advance-count"
type="number"
min={0}
className="h-9"
placeholder="No limit"
value={(config.startupAdvanceCount as number) ?? ''}
onChange={(e) => {
const val = e.target.value ? parseInt(e.target.value, 10) : undefined
handleConfigChange({ ...config, startupAdvanceCount: val })
}}
/>
</div>
<div className="space-y-1.5">
<Label htmlFor="concept-advance-count" className="text-xs text-muted-foreground">
Concept Projects
</Label>
<Input
id="concept-advance-count"
type="number"
min={0}
className="h-9"
placeholder="No limit"
value={(config.conceptAdvanceCount as number) ?? ''}
onChange={(e) => {
const val = e.target.value ? parseInt(e.target.value, 10) : undefined
handleConfigChange({ ...config, conceptAdvanceCount: val })
}}
/>
</div>
{/* Mode toggle */}
<div className="flex gap-2 mb-4">
<Button
type="button"
size="sm"
variant={(config.advanceMode as string) === 'threshold' ? 'outline' : 'default'}
className="h-8 text-xs"
onClick={() => handleConfigChange({ ...config, advanceMode: 'count' })}
>
Fixed Count
</Button>
<Button
type="button"
size="sm"
variant={(config.advanceMode as string) === 'threshold' ? 'default' : 'outline'}
className="h-8 text-xs"
onClick={() => handleConfigChange({ ...config, advanceMode: 'threshold' })}
>
Score Threshold
</Button>
</div>
{(config.advanceMode as string) === 'threshold' ? (
<div className="space-y-2">
<Label htmlFor="advance-threshold" className="text-xs text-muted-foreground">
Minimum Average Score to Advance
</Label>
<p className="text-xs text-muted-foreground">
All projects scoring at or above this threshold will advance (both categories)
</p>
<Input
id="advance-threshold"
type="number"
min={0}
max={10}
step={0.1}
className="h-9 w-32"
placeholder="e.g. 6.5"
value={(config.advanceScoreThreshold as number) ?? ''}
onChange={(e) => {
const val = e.target.value ? parseFloat(e.target.value) : undefined
handleConfigChange({ ...config, advanceScoreThreshold: val })
}}
/>
</div>
) : (
<>
{isEvaluation && !(config.startupAdvanceCount as number) && !(config.conceptAdvanceCount as number) && (
<div className="mb-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2">
<p className="text-xs text-amber-700">Advancement targets not configured all passed projects will be eligible to advance.</p>
</div>
)}
<p className="text-xs text-muted-foreground mb-2">
Target number of projects per category to advance
</p>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-1.5">
<Label htmlFor="startup-advance-count" className="text-xs text-muted-foreground">
Startup Projects
</Label>
<Input
id="startup-advance-count"
type="number"
min={0}
className="h-9"
placeholder="No limit"
value={(config.startupAdvanceCount as number) ?? ''}
onChange={(e) => {
const val = e.target.value ? parseInt(e.target.value, 10) : undefined
handleConfigChange({ ...config, startupAdvanceCount: val })
}}
/>
</div>
<div className="space-y-1.5">
<Label htmlFor="concept-advance-count" className="text-xs text-muted-foreground">
Concept Projects
</Label>
<Input
id="concept-advance-count"
type="number"
min={0}
className="h-9"
placeholder="No limit"
value={(config.conceptAdvanceCount as number) ?? ''}
onChange={(e) => {
const val = e.target.value ? parseInt(e.target.value, 10) : undefined
handleConfigChange({ ...config, conceptAdvanceCount: val })
}}
/>
</div>
</div>
</>
)}
</div>
</CardContent>
</Card>