2026-01-30 13:41:32 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import { Suspense, use, useState, useEffect } from 'react'
|
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
import { useRouter } from 'next/navigation'
|
|
|
|
|
import { useForm } from 'react-hook-form'
|
|
|
|
|
import { zodResolver } from '@hookform/resolvers/zod'
|
|
|
|
|
import { z } from 'zod'
|
|
|
|
|
import { trpc } from '@/lib/trpc/client'
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardContent,
|
|
|
|
|
CardDescription,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardTitle,
|
|
|
|
|
} from '@/components/ui/card'
|
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
|
import { Input } from '@/components/ui/input'
|
|
|
|
|
import { Skeleton } from '@/components/ui/skeleton'
|
|
|
|
|
import { Badge } from '@/components/ui/badge'
|
|
|
|
|
import {
|
|
|
|
|
Form,
|
|
|
|
|
FormControl,
|
|
|
|
|
FormDescription,
|
|
|
|
|
FormField,
|
|
|
|
|
FormItem,
|
|
|
|
|
FormLabel,
|
|
|
|
|
FormMessage,
|
|
|
|
|
} from '@/components/ui/form'
|
|
|
|
|
import {
|
|
|
|
|
EvaluationFormBuilder,
|
|
|
|
|
type Criterion,
|
|
|
|
|
} from '@/components/forms/evaluation-form-builder'
|
|
|
|
|
import { RoundTypeSettings } from '@/components/forms/round-type-settings'
|
Implement 15 platform features: digest, availability, templates, comparison, live voting SSE, file versioning, mentorship, messaging, analytics, drafts, webhooks, peer review, audit enhancements, i18n
Features implemented:
- F1: Email digest notifications with cron endpoint and per-user frequency
- F2: Jury availability windows and workload preferences in smart assignment
- F3: Round templates with save-from-round and CRUD management
- F4: Side-by-side project comparison view for jury members
- F5: Real-time voting dashboard with Server-Sent Events (SSE)
- F6: Live voting UX: QR codes, audience voting, tie-breaking, score animations
- F7: File versioning, inline preview, bulk download with presigned URLs
- F8: Mentor dashboard: milestones, private notes, activity tracking
- F9: Communication hub with broadcasts, templates, and recipient targeting
- F10: Advanced analytics: cross-round comparison, juror consistency, diversity metrics, PDF export
- F11: Applicant draft saving with magic link resume and cron cleanup
- F12: Webhook integration layer with HMAC signing, retry, and delivery logs
- F13: Peer review discussions with anonymized scores and threaded comments
- F14: Audit log enhancements: before/after diffs, session grouping, anomaly detection, retention
- F15: i18n foundation with next-intl (EN/FR), cookie-based locale, language switcher
Schema: 12 new models, field additions to User, Project, ProjectFile, LiveVotingSession, LiveVote, MentorAssignment, AuditLog, Program
New routers: roundTemplate, message, webhook (registered in _app.ts)
New services: email-digest, webhook-dispatcher
New cron endpoints: /api/cron/digest, /api/cron/draft-cleanup, /api/cron/audit-cleanup
New API routes: /api/live-voting/stream (SSE), /api/files/bulk-download
All features are admin-configurable via SystemSettings or per-model settingsJson fields.
Docker build verified successfully.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 23:31:41 +01:00
|
|
|
import { ArrowLeft, Loader2, AlertCircle, AlertTriangle, Bell, GitCompare, MessageSquare, FileText, Calendar } from 'lucide-react'
|
|
|
|
|
import { Switch } from '@/components/ui/switch'
|
|
|
|
|
import { Slider } from '@/components/ui/slider'
|
|
|
|
|
import { Label } from '@/components/ui/label'
|
2026-02-03 19:48:41 +01:00
|
|
|
import { DateTimePicker } from '@/components/ui/datetime-picker'
|
2026-02-04 00:10:51 +01:00
|
|
|
import {
|
|
|
|
|
Select,
|
|
|
|
|
SelectContent,
|
|
|
|
|
SelectItem,
|
|
|
|
|
SelectTrigger,
|
|
|
|
|
SelectValue,
|
|
|
|
|
} from '@/components/ui/select'
|
|
|
|
|
|
|
|
|
|
// Available notification types for teams entering a round
|
|
|
|
|
const TEAM_NOTIFICATION_OPTIONS = [
|
|
|
|
|
{ value: '', label: 'No automatic notification', description: 'Teams will not receive a notification when entering this round' },
|
|
|
|
|
{ value: 'ADVANCED_SEMIFINAL', label: 'Advanced to Semi-Finals', description: 'Congratulates team for advancing to semi-finals' },
|
|
|
|
|
{ value: 'ADVANCED_FINAL', label: 'Selected as Finalist', description: 'Congratulates team for being selected as finalist' },
|
|
|
|
|
{ value: 'NOT_SELECTED', label: 'Not Selected', description: 'Informs team they were not selected to continue' },
|
|
|
|
|
{ value: 'WINNER_ANNOUNCEMENT', label: 'Winner Announcement', description: 'Announces the team as a winner' },
|
|
|
|
|
]
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
interface PageProps {
|
|
|
|
|
params: Promise<{ id: string }>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const updateRoundSchema = z
|
|
|
|
|
.object({
|
|
|
|
|
name: z.string().min(1, 'Name is required').max(255),
|
|
|
|
|
requiredReviews: z.number().int().min(1).max(10),
|
2026-02-04 16:01:18 +01:00
|
|
|
minAssignmentsPerJuror: z.number().int().min(1).max(50),
|
|
|
|
|
maxAssignmentsPerJuror: z.number().int().min(1).max(100),
|
2026-02-03 19:48:41 +01:00
|
|
|
votingStartAt: z.date().nullable().optional(),
|
|
|
|
|
votingEndAt: z.date().nullable().optional(),
|
2026-01-30 13:41:32 +01:00
|
|
|
})
|
|
|
|
|
.refine(
|
|
|
|
|
(data) => {
|
|
|
|
|
if (data.votingStartAt && data.votingEndAt) {
|
2026-02-03 19:48:41 +01:00
|
|
|
return data.votingEndAt > data.votingStartAt
|
2026-01-30 13:41:32 +01:00
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
message: 'End date must be after start date',
|
|
|
|
|
path: ['votingEndAt'],
|
|
|
|
|
}
|
|
|
|
|
)
|
2026-02-04 16:01:18 +01:00
|
|
|
.refine(
|
|
|
|
|
(data) => data.minAssignmentsPerJuror <= data.maxAssignmentsPerJuror,
|
|
|
|
|
{
|
|
|
|
|
message: 'Min must be less than or equal to max',
|
|
|
|
|
path: ['minAssignmentsPerJuror'],
|
|
|
|
|
}
|
|
|
|
|
)
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
type UpdateRoundForm = z.infer<typeof updateRoundSchema>
|
|
|
|
|
|
|
|
|
|
function EditRoundContent({ roundId }: { roundId: string }) {
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const [criteria, setCriteria] = useState<Criterion[]>([])
|
|
|
|
|
const [criteriaInitialized, setCriteriaInitialized] = useState(false)
|
2026-02-03 19:48:41 +01:00
|
|
|
const [formInitialized, setFormInitialized] = useState(false)
|
2026-01-30 13:41:32 +01:00
|
|
|
const [roundType, setRoundType] = useState<'FILTERING' | 'EVALUATION' | 'LIVE_EVENT'>('EVALUATION')
|
|
|
|
|
const [roundSettings, setRoundSettings] = useState<Record<string, unknown>>({})
|
2026-02-04 14:15:06 +01:00
|
|
|
// entryNotificationType removed from schema
|
2026-01-30 13:41:32 +01:00
|
|
|
|
2026-02-03 19:48:41 +01:00
|
|
|
// Fetch round data - disable refetch on focus to prevent overwriting user's edits
|
|
|
|
|
const { data: round, isLoading: loadingRound } = trpc.round.get.useQuery(
|
|
|
|
|
{ id: roundId },
|
|
|
|
|
{ refetchOnWindowFocus: false }
|
|
|
|
|
)
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
// Fetch evaluation form
|
|
|
|
|
const { data: evaluationForm, isLoading: loadingForm } =
|
|
|
|
|
trpc.round.getEvaluationForm.useQuery({ roundId })
|
|
|
|
|
|
|
|
|
|
// Check if evaluations exist
|
|
|
|
|
const { data: hasEvaluations } = trpc.round.hasEvaluations.useQuery({
|
|
|
|
|
roundId,
|
|
|
|
|
})
|
|
|
|
|
|
2026-02-03 15:25:28 +01:00
|
|
|
const utils = trpc.useUtils()
|
|
|
|
|
|
2026-01-30 13:41:32 +01:00
|
|
|
// Mutations
|
|
|
|
|
const updateRound = trpc.round.update.useMutation({
|
|
|
|
|
onSuccess: () => {
|
2026-02-03 15:25:28 +01:00
|
|
|
// Invalidate cache to ensure fresh data
|
|
|
|
|
utils.round.get.invalidate({ id: roundId })
|
|
|
|
|
utils.round.list.invalidate()
|
2026-01-30 13:41:32 +01:00
|
|
|
router.push(`/admin/rounds/${roundId}`)
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const updateEvaluationForm = trpc.round.updateEvaluationForm.useMutation()
|
|
|
|
|
|
|
|
|
|
// Initialize form with existing data
|
|
|
|
|
const form = useForm<UpdateRoundForm>({
|
|
|
|
|
resolver: zodResolver(updateRoundSchema),
|
|
|
|
|
defaultValues: {
|
|
|
|
|
name: '',
|
|
|
|
|
requiredReviews: 3,
|
2026-02-04 16:01:18 +01:00
|
|
|
minAssignmentsPerJuror: 5,
|
|
|
|
|
maxAssignmentsPerJuror: 20,
|
2026-02-03 19:48:41 +01:00
|
|
|
votingStartAt: null,
|
|
|
|
|
votingEndAt: null,
|
2026-01-30 13:41:32 +01:00
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
2026-02-03 19:48:41 +01:00
|
|
|
// Update form when round data loads - only initialize once
|
2026-01-30 13:41:32 +01:00
|
|
|
useEffect(() => {
|
2026-02-03 19:48:41 +01:00
|
|
|
if (round && !formInitialized) {
|
2026-01-30 13:41:32 +01:00
|
|
|
form.reset({
|
|
|
|
|
name: round.name,
|
|
|
|
|
requiredReviews: round.requiredReviews,
|
2026-02-04 16:01:18 +01:00
|
|
|
minAssignmentsPerJuror: round.minAssignmentsPerJuror,
|
|
|
|
|
maxAssignmentsPerJuror: round.maxAssignmentsPerJuror,
|
2026-02-03 19:48:41 +01:00
|
|
|
votingStartAt: round.votingStartAt ? new Date(round.votingStartAt) : null,
|
|
|
|
|
votingEndAt: round.votingEndAt ? new Date(round.votingEndAt) : null,
|
2026-01-30 13:41:32 +01:00
|
|
|
})
|
2026-02-04 00:10:51 +01:00
|
|
|
// Set round type, settings, and notification type
|
2026-01-30 13:41:32 +01:00
|
|
|
setRoundType((round.roundType as typeof roundType) || 'EVALUATION')
|
|
|
|
|
setRoundSettings((round.settingsJson as Record<string, unknown>) || {})
|
2026-02-03 19:48:41 +01:00
|
|
|
setFormInitialized(true)
|
2026-01-30 13:41:32 +01:00
|
|
|
}
|
2026-02-03 19:48:41 +01:00
|
|
|
}, [round, form, formInitialized])
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
// Initialize criteria from evaluation form
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (evaluationForm && !criteriaInitialized) {
|
|
|
|
|
const existingCriteria = evaluationForm.criteriaJson as unknown as Criterion[]
|
|
|
|
|
if (Array.isArray(existingCriteria)) {
|
|
|
|
|
setCriteria(existingCriteria)
|
|
|
|
|
}
|
|
|
|
|
setCriteriaInitialized(true)
|
|
|
|
|
} else if (!loadingForm && !evaluationForm && !criteriaInitialized) {
|
|
|
|
|
setCriteriaInitialized(true)
|
|
|
|
|
}
|
|
|
|
|
}, [evaluationForm, loadingForm, criteriaInitialized])
|
|
|
|
|
|
|
|
|
|
const onSubmit = async (data: UpdateRoundForm) => {
|
2026-02-04 00:10:51 +01:00
|
|
|
// Update round with type, settings, and notification
|
2026-01-30 13:41:32 +01:00
|
|
|
await updateRound.mutateAsync({
|
|
|
|
|
id: roundId,
|
|
|
|
|
name: data.name,
|
|
|
|
|
requiredReviews: data.requiredReviews,
|
2026-02-04 16:01:18 +01:00
|
|
|
minAssignmentsPerJuror: data.minAssignmentsPerJuror,
|
|
|
|
|
maxAssignmentsPerJuror: data.maxAssignmentsPerJuror,
|
2026-01-30 13:41:32 +01:00
|
|
|
roundType,
|
|
|
|
|
settingsJson: roundSettings,
|
2026-02-03 19:48:41 +01:00
|
|
|
votingStartAt: data.votingStartAt ?? null,
|
|
|
|
|
votingEndAt: data.votingEndAt ?? null,
|
2026-01-30 13:41:32 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// Update evaluation form if criteria changed and no evaluations exist
|
|
|
|
|
if (!hasEvaluations && criteria.length > 0) {
|
|
|
|
|
await updateEvaluationForm.mutateAsync({
|
|
|
|
|
roundId,
|
|
|
|
|
criteria,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isLoading = loadingRound || loadingForm
|
|
|
|
|
|
|
|
|
|
if (isLoading) {
|
|
|
|
|
return <EditRoundSkeleton />
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!round) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
<Button variant="ghost" asChild className="-ml-4">
|
|
|
|
|
<Link href="/admin/rounds">
|
|
|
|
|
<ArrowLeft className="mr-2 h-4 w-4" />
|
|
|
|
|
Back to Rounds
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
<Card>
|
|
|
|
|
<CardContent className="flex flex-col items-center justify-center py-12 text-center">
|
|
|
|
|
<AlertCircle className="h-12 w-12 text-destructive/50" />
|
|
|
|
|
<p className="mt-2 font-medium">Round Not Found</p>
|
|
|
|
|
<Button asChild className="mt-4">
|
|
|
|
|
<Link href="/admin/rounds">Back to Rounds</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isPending = updateRound.isPending || updateEvaluationForm.isPending
|
|
|
|
|
const isActive = round.status === 'ACTIVE'
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
{/* Header */}
|
|
|
|
|
<div className="flex items-center gap-4">
|
|
|
|
|
<Button variant="ghost" asChild className="-ml-4">
|
|
|
|
|
<Link href={`/admin/rounds/${roundId}`}>
|
|
|
|
|
<ArrowLeft className="mr-2 h-4 w-4" />
|
|
|
|
|
Back to Round
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<h1 className="text-2xl font-semibold tracking-tight">Edit Round</h1>
|
|
|
|
|
<Badge variant={isActive ? 'default' : 'secondary'}>
|
|
|
|
|
{round.status}
|
|
|
|
|
</Badge>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Form */}
|
|
|
|
|
<Form {...form}>
|
|
|
|
|
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
|
|
|
|
|
{/* Basic Information */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg">Basic Information</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="name"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>Round Name</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="e.g., Round 1 - Semi-Finalists"
|
|
|
|
|
{...field}
|
|
|
|
|
/>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="requiredReviews"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>Required Reviews per Project</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
max={10}
|
|
|
|
|
{...field}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
field.onChange(parseInt(e.target.value) || 1)
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormDescription>
|
|
|
|
|
Minimum number of evaluations each project should receive
|
|
|
|
|
</FormDescription>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
2026-02-04 16:01:18 +01:00
|
|
|
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="minAssignmentsPerJuror"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>Min Projects per Judge</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
max={50}
|
|
|
|
|
{...field}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
field.onChange(parseInt(e.target.value) || 1)
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormDescription>
|
|
|
|
|
Target minimum projects each judge should receive
|
|
|
|
|
</FormDescription>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="maxAssignmentsPerJuror"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>Max Projects per Judge</FormLabel>
|
|
|
|
|
<FormControl>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
max={100}
|
|
|
|
|
{...field}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
field.onChange(parseInt(e.target.value) || 1)
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<FormDescription>
|
|
|
|
|
Maximum projects a judge can be assigned
|
|
|
|
|
</FormDescription>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-01-30 13:41:32 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
{/* Round Type & Settings */}
|
|
|
|
|
<RoundTypeSettings
|
|
|
|
|
roundType={roundType}
|
|
|
|
|
onRoundTypeChange={setRoundType}
|
|
|
|
|
settings={roundSettings}
|
|
|
|
|
onSettingsChange={setRoundSettings}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
{/* Voting Window */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg">Voting Window</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Set when jury members can submit their evaluations
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
{isActive && (
|
|
|
|
|
<div className="flex items-center gap-2 rounded-lg bg-amber-500/10 p-3 text-amber-700">
|
|
|
|
|
<AlertTriangle className="h-4 w-4 shrink-0" />
|
|
|
|
|
<p className="text-sm">
|
|
|
|
|
This round is active. Changing the voting window may affect
|
|
|
|
|
ongoing evaluations.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="votingStartAt"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>Start Date & Time</FormLabel>
|
|
|
|
|
<FormControl>
|
2026-02-03 19:48:41 +01:00
|
|
|
<DateTimePicker
|
|
|
|
|
value={field.value}
|
|
|
|
|
onChange={field.onChange}
|
|
|
|
|
placeholder="Select start date & time"
|
|
|
|
|
/>
|
2026-01-30 13:41:32 +01:00
|
|
|
</FormControl>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<FormField
|
|
|
|
|
control={form.control}
|
|
|
|
|
name="votingEndAt"
|
|
|
|
|
render={({ field }) => (
|
|
|
|
|
<FormItem>
|
|
|
|
|
<FormLabel>End Date & Time</FormLabel>
|
|
|
|
|
<FormControl>
|
2026-02-03 19:48:41 +01:00
|
|
|
<DateTimePicker
|
|
|
|
|
value={field.value}
|
|
|
|
|
onChange={field.onChange}
|
|
|
|
|
placeholder="Select end date & time"
|
|
|
|
|
/>
|
2026-01-30 13:41:32 +01:00
|
|
|
</FormControl>
|
|
|
|
|
<FormMessage />
|
|
|
|
|
</FormItem>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
2026-02-03 19:48:41 +01:00
|
|
|
Leave empty to disable the voting window enforcement. Past dates are allowed.
|
2026-01-30 13:41:32 +01:00
|
|
|
</p>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
Implement 10 platform features: evaluation UX, admin tools, AI summaries, applicant portal
Batch 1 - Quick Wins:
- F1: Evaluation progress indicator with touch tracking in sticky status bar
- F2: Export filtering results as CSV with dynamic AI column flattening
- F3: Observer access to analytics dashboards (8 procedures changed to observerProcedure)
Batch 2 - Jury Experience:
- F4: Countdown timer component with urgency colors + email reminder service with cron endpoint
- F5: Conflict of interest declaration system (dialog, admin management, review workflow)
Batch 3 - Admin & AI Enhancements:
- F6: Bulk status update UI with selection checkboxes, floating toolbar, status history recording
- F7: AI-powered evaluation summary with anonymized data, OpenAI integration, scoring patterns
- F8: Smart assignment improvements (geo diversity penalty, round familiarity bonus, COI blocking)
Batch 4 - Form Flexibility & Applicant Portal:
- F9: Evaluation form flexibility (text, boolean, section_header types, conditional visibility)
- F10: Applicant portal (status timeline, per-round documents, mentor messaging)
Schema: 5 new models (ReminderLog, ConflictOfInterest, EvaluationSummary, ProjectStatusHistory, MentorMessage), ProjectFile extended with roundId + isLate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 21:58:27 +01:00
|
|
|
{/* Upload Deadline Policy */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg">Upload Deadline Policy</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Control how file uploads are handled after the round starts
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<Select
|
|
|
|
|
value={(roundSettings.uploadDeadlinePolicy as string) || ''}
|
|
|
|
|
onValueChange={(value) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
uploadDeadlinePolicy: value || undefined,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger>
|
|
|
|
|
<SelectValue placeholder="Default (no restriction)" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="NONE">
|
|
|
|
|
Default - No restriction
|
|
|
|
|
</SelectItem>
|
|
|
|
|
<SelectItem value="BLOCK">
|
|
|
|
|
Block uploads after round starts
|
|
|
|
|
</SelectItem>
|
|
|
|
|
<SelectItem value="ALLOW_LATE">
|
|
|
|
|
Allow late uploads (marked as late)
|
|
|
|
|
</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
When set to “Block”, applicants cannot upload files after the voting start date.
|
|
|
|
|
When set to “Allow late”, uploads are accepted but flagged as late submissions.
|
|
|
|
|
</p>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-02-04 00:10:51 +01:00
|
|
|
|
Implement 15 platform features: digest, availability, templates, comparison, live voting SSE, file versioning, mentorship, messaging, analytics, drafts, webhooks, peer review, audit enhancements, i18n
Features implemented:
- F1: Email digest notifications with cron endpoint and per-user frequency
- F2: Jury availability windows and workload preferences in smart assignment
- F3: Round templates with save-from-round and CRUD management
- F4: Side-by-side project comparison view for jury members
- F5: Real-time voting dashboard with Server-Sent Events (SSE)
- F6: Live voting UX: QR codes, audience voting, tie-breaking, score animations
- F7: File versioning, inline preview, bulk download with presigned URLs
- F8: Mentor dashboard: milestones, private notes, activity tracking
- F9: Communication hub with broadcasts, templates, and recipient targeting
- F10: Advanced analytics: cross-round comparison, juror consistency, diversity metrics, PDF export
- F11: Applicant draft saving with magic link resume and cron cleanup
- F12: Webhook integration layer with HMAC signing, retry, and delivery logs
- F13: Peer review discussions with anonymized scores and threaded comments
- F14: Audit log enhancements: before/after diffs, session grouping, anomaly detection, retention
- F15: i18n foundation with next-intl (EN/FR), cookie-based locale, language switcher
Schema: 12 new models, field additions to User, Project, ProjectFile, LiveVotingSession, LiveVote, MentorAssignment, AuditLog, Program
New routers: roundTemplate, message, webhook (registered in _app.ts)
New services: email-digest, webhook-dispatcher
New cron endpoints: /api/cron/digest, /api/cron/draft-cleanup, /api/cron/audit-cleanup
New API routes: /api/live-voting/stream (SSE), /api/files/bulk-download
All features are admin-configurable via SystemSettings or per-model settingsJson fields.
Docker build verified successfully.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 23:31:41 +01:00
|
|
|
{/* Jury Features */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg flex items-center gap-2">
|
|
|
|
|
<GitCompare className="h-5 w-5" />
|
|
|
|
|
Jury Features
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Configure project comparison and peer review for jury members
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-6">
|
|
|
|
|
{/* Comparison settings */}
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
<Label className="text-sm font-medium">Enable Project Comparison</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Allow jury members to compare projects side by side
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Switch
|
|
|
|
|
checked={Boolean(roundSettings.enable_comparison)}
|
|
|
|
|
onCheckedChange={(checked) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
enable_comparison: checked,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{!!roundSettings.enable_comparison && (
|
|
|
|
|
<div className="space-y-2 pl-4 border-l-2 border-muted">
|
|
|
|
|
<Label className="text-sm">Max Projects to Compare</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={2}
|
|
|
|
|
max={5}
|
|
|
|
|
value={Number(roundSettings.comparison_max_projects || 3)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
comparison_max_projects: parseInt(e.target.value) || 3,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[120px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Peer review settings */}
|
|
|
|
|
<div className="border-t pt-4 space-y-4">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
<Label className="text-sm font-medium flex items-center gap-1">
|
|
|
|
|
<MessageSquare className="h-4 w-4" />
|
|
|
|
|
Enable Peer Review / Discussion
|
|
|
|
|
</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Allow jury members to discuss and see aggregated scores
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Switch
|
|
|
|
|
checked={Boolean(roundSettings.peer_review_enabled)}
|
|
|
|
|
onCheckedChange={(checked) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
peer_review_enabled: checked,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{!!roundSettings.peer_review_enabled && (
|
|
|
|
|
<div className="space-y-4 pl-4 border-l-2 border-muted">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Divergence Threshold</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Score divergence level that triggers a warning (0.0 - 1.0)
|
|
|
|
|
</p>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={0}
|
|
|
|
|
max={1}
|
|
|
|
|
step={0.05}
|
|
|
|
|
value={Number(roundSettings.divergence_threshold || 0.3)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
divergence_threshold: parseFloat(e.target.value) || 0.3,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[120px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Anonymization Level</Label>
|
|
|
|
|
<Select
|
|
|
|
|
value={String(roundSettings.anonymization_level || 'partial')}
|
|
|
|
|
onValueChange={(v) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
anonymization_level: v,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="max-w-[200px]">
|
|
|
|
|
<SelectValue />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="none">No anonymization</SelectItem>
|
|
|
|
|
<SelectItem value="partial">Partial (Juror 1, 2...)</SelectItem>
|
|
|
|
|
<SelectItem value="full">Full anonymization</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Discussion Window (hours)</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
max={720}
|
|
|
|
|
value={Number(roundSettings.discussion_window_hours || 48)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
discussion_window_hours: parseInt(e.target.value) || 48,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[120px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Max Comment Length</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={100}
|
|
|
|
|
max={5000}
|
|
|
|
|
value={Number(roundSettings.max_comment_length || 2000)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
max_comment_length: parseInt(e.target.value) || 2000,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[120px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
{/* File Settings */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg flex items-center gap-2">
|
|
|
|
|
<FileText className="h-5 w-5" />
|
|
|
|
|
File Settings
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Configure allowed file types and versioning for this round
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Allowed File Types</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Comma-separated MIME types or extensions
|
|
|
|
|
</p>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder="application/pdf, video/mp4, image/jpeg"
|
|
|
|
|
value={String(roundSettings.allowed_file_types || '')}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
allowed_file_types: e.target.value,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Max File Size (MB)</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
max={2048}
|
|
|
|
|
value={Number(roundSettings.max_file_size_mb || 500)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
max_file_size_mb: parseInt(e.target.value) || 500,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[150px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
<Label className="text-sm font-medium">Enable File Versioning</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Keep previous versions when files are replaced
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Switch
|
|
|
|
|
checked={Boolean(roundSettings.file_versioning)}
|
|
|
|
|
onCheckedChange={(checked) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
file_versioning: checked,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{!!roundSettings.file_versioning && (
|
|
|
|
|
<div className="space-y-2 pl-4 border-l-2 border-muted">
|
|
|
|
|
<Label className="text-sm">Max Versions per File</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={2}
|
|
|
|
|
max={20}
|
|
|
|
|
value={Number(roundSettings.max_file_versions || 5)}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
max_file_versions: parseInt(e.target.value) || 5,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-[120px]"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
{/* Availability Settings */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg flex items-center gap-2">
|
|
|
|
|
<Calendar className="h-5 w-5" />
|
|
|
|
|
Jury Availability Settings
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Configure how jury member availability affects assignments
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
<Label className="text-sm font-medium">Require Availability</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Jury members must set availability before receiving assignments
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<Switch
|
|
|
|
|
checked={Boolean(roundSettings.require_availability)}
|
|
|
|
|
onCheckedChange={(checked) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
require_availability: checked,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">Availability Mode</Label>
|
|
|
|
|
<Select
|
|
|
|
|
value={String(roundSettings.availability_mode || 'soft_penalty')}
|
|
|
|
|
onValueChange={(v) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
availability_mode: v,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger className="max-w-[250px]">
|
|
|
|
|
<SelectValue />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="hard_block">
|
|
|
|
|
Hard Block (unavailable jurors excluded)
|
|
|
|
|
</SelectItem>
|
|
|
|
|
<SelectItem value="soft_penalty">
|
|
|
|
|
Soft Penalty (reduce assignment priority)
|
|
|
|
|
</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Label className="text-sm">
|
|
|
|
|
Availability Weight ({Number(roundSettings.availability_weight || 50)}%)
|
|
|
|
|
</Label>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
How much weight to give availability when using soft penalty mode
|
|
|
|
|
</p>
|
|
|
|
|
<Slider
|
|
|
|
|
value={[Number(roundSettings.availability_weight || 50)]}
|
|
|
|
|
min={0}
|
|
|
|
|
max={100}
|
|
|
|
|
step={5}
|
|
|
|
|
onValueChange={([value]) =>
|
|
|
|
|
setRoundSettings((prev) => ({
|
|
|
|
|
...prev,
|
|
|
|
|
availability_weight: value,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
className="max-w-xs"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-01-30 13:41:32 +01:00
|
|
|
{/* Evaluation Criteria */}
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<CardTitle className="text-lg">Evaluation Criteria</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Define the criteria jurors will use to evaluate projects
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
{hasEvaluations ? (
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
<div className="flex items-center gap-2 rounded-lg bg-amber-500/10 p-3 text-amber-700">
|
|
|
|
|
<AlertTriangle className="h-4 w-4 shrink-0" />
|
|
|
|
|
<p className="text-sm">
|
|
|
|
|
Criteria cannot be modified after evaluations have been
|
|
|
|
|
submitted. {criteria.length} criteria defined.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<EvaluationFormBuilder
|
|
|
|
|
initialCriteria={criteria}
|
|
|
|
|
onChange={() => {}}
|
|
|
|
|
disabled={true}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
<EvaluationFormBuilder
|
|
|
|
|
initialCriteria={criteria}
|
|
|
|
|
onChange={setCriteria}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
{/* Error Display */}
|
|
|
|
|
{(updateRound.error || updateEvaluationForm.error) && (
|
|
|
|
|
<Card className="border-destructive">
|
|
|
|
|
<CardContent className="flex items-center gap-2 py-4">
|
|
|
|
|
<AlertCircle className="h-5 w-5 text-destructive" />
|
|
|
|
|
<p className="text-sm text-destructive">
|
|
|
|
|
{updateRound.error?.message ||
|
|
|
|
|
updateEvaluationForm.error?.message}
|
|
|
|
|
</p>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Actions */}
|
|
|
|
|
<div className="flex justify-end gap-3">
|
|
|
|
|
<Button type="button" variant="outline" asChild>
|
|
|
|
|
<Link href={`/admin/rounds/${roundId}`}>Cancel</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
<Button type="submit" disabled={isPending}>
|
|
|
|
|
{isPending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
|
|
|
|
|
Save Changes
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</Form>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function EditRoundSkeleton() {
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
<Skeleton className="h-9 w-36" />
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<Skeleton className="h-8 w-32" />
|
|
|
|
|
<Skeleton className="h-6 w-16" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<Skeleton className="h-5 w-40" />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Skeleton className="h-4 w-24" />
|
|
|
|
|
<Skeleton className="h-10 w-full" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<Skeleton className="h-4 w-40" />
|
|
|
|
|
<Skeleton className="h-10 w-32" />
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<Skeleton className="h-5 w-32" />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
|
|
|
<Skeleton className="h-10 w-full" />
|
|
|
|
|
<Skeleton className="h-10 w-full" />
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
<Card>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<Skeleton className="h-5 w-40" />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
<Skeleton className="h-32 w-full" />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function EditRoundPage({ params }: PageProps) {
|
|
|
|
|
const { id } = use(params)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Suspense fallback={<EditRoundSkeleton />}>
|
|
|
|
|
<EditRoundContent roundId={id} />
|
|
|
|
|
</Suspense>
|
|
|
|
|
)
|
|
|
|
|
}
|