Admin dashboard & round management UX overhaul
- Extract round detail monolith (2900→600 lines) into 13 standalone components
- Add shared round/status config (round-config.ts) replacing 4 local copies
- Delete 12 legacy competition-scoped pages, merge project pool into projects page
- Add round-type-specific dashboard stat panels (submission, mentoring, live final, deliberation, summary)
- Add contextual header quick actions based on active round type
- Improve pipeline visualization: progress bars, checkmarks, chevron connectors, overflow fix
- Add config tab completion dots (green/amber/red) and inline validation warnings
- Enhance juries page with round assignments, member avatars, and cap mode badges
- Add context-aware project list (recent submissions vs active evaluations)
- Move competition settings into Manage Editions page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:14:00 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import { trpc } from '@/lib/trpc/client'
|
|
|
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
|
|
|
import { Skeleton } from '@/components/ui/skeleton'
|
|
|
|
|
import { Badge } from '@/components/ui/badge'
|
2026-02-24 17:44:55 +01:00
|
|
|
import { History } from 'lucide-react'
|
Admin dashboard & round management UX overhaul
- Extract round detail monolith (2900→600 lines) into 13 standalone components
- Add shared round/status config (round-config.ts) replacing 4 local copies
- Delete 12 legacy competition-scoped pages, merge project pool into projects page
- Add round-type-specific dashboard stat panels (submission, mentoring, live final, deliberation, summary)
- Add contextual header quick actions based on active round type
- Improve pipeline visualization: progress bars, checkmarks, chevron connectors, overflow fix
- Add config tab completion dots (green/amber/red) and inline validation warnings
- Enhance juries page with round assignments, member avatars, and cap mode badges
- Add context-aware project list (recent submissions vs active evaluations)
- Move competition settings into Manage Editions page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:14:00 +01:00
|
|
|
|
|
|
|
|
export type ReassignmentHistoryProps = {
|
|
|
|
|
roundId: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function ReassignmentHistory({ roundId }: ReassignmentHistoryProps) {
|
|
|
|
|
const { data: events, isLoading } = trpc.assignment.getReassignmentHistory.useQuery(
|
|
|
|
|
{ roundId },
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Card>
|
2026-02-24 17:44:55 +01:00
|
|
|
<CardHeader>
|
Admin dashboard & round management UX overhaul
- Extract round detail monolith (2900→600 lines) into 13 standalone components
- Add shared round/status config (round-config.ts) replacing 4 local copies
- Delete 12 legacy competition-scoped pages, merge project pool into projects page
- Add round-type-specific dashboard stat panels (submission, mentoring, live final, deliberation, summary)
- Add contextual header quick actions based on active round type
- Improve pipeline visualization: progress bars, checkmarks, chevron connectors, overflow fix
- Add config tab completion dots (green/amber/red) and inline validation warnings
- Enhance juries page with round assignments, member avatars, and cap mode badges
- Add context-aware project list (recent submissions vs active evaluations)
- Move competition settings into Manage Editions page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:14:00 +01:00
|
|
|
<CardTitle className="text-base flex items-center gap-2">
|
|
|
|
|
<History className="h-4 w-4" />
|
|
|
|
|
Reassignment History
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<CardDescription>Juror dropout, COI, transfer, and cap redistribution audit trail</CardDescription>
|
|
|
|
|
</CardHeader>
|
2026-02-24 17:44:55 +01:00
|
|
|
<CardContent>
|
Admin dashboard & round management UX overhaul
- Extract round detail monolith (2900→600 lines) into 13 standalone components
- Add shared round/status config (round-config.ts) replacing 4 local copies
- Delete 12 legacy competition-scoped pages, merge project pool into projects page
- Add round-type-specific dashboard stat panels (submission, mentoring, live final, deliberation, summary)
- Add contextual header quick actions based on active round type
- Improve pipeline visualization: progress bars, checkmarks, chevron connectors, overflow fix
- Add config tab completion dots (green/amber/red) and inline validation warnings
- Enhance juries page with round assignments, member avatars, and cap mode badges
- Add context-aware project list (recent submissions vs active evaluations)
- Move competition settings into Manage Editions page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:14:00 +01:00
|
|
|
{isLoading ? (
|
|
|
|
|
<div className="space-y-3">
|
|
|
|
|
{[1, 2].map((i) => <Skeleton key={i} className="h-16 w-full" />)}
|
|
|
|
|
</div>
|
|
|
|
|
) : !events || events.length === 0 ? (
|
|
|
|
|
<p className="text-sm text-muted-foreground text-center py-6">
|
|
|
|
|
No reassignment events for this round
|
|
|
|
|
</p>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="space-y-4 max-h-[500px] overflow-y-auto">
|
|
|
|
|
{events.map((event) => (
|
|
|
|
|
<div key={event.id} className="border rounded-lg p-3 space-y-2">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<Badge variant={event.type === 'DROPOUT' ? 'destructive' : 'secondary'}>
|
|
|
|
|
{event.type === 'DROPOUT' ? 'Juror Dropout' : event.type === 'COI' ? 'COI Reassignment' : event.type === 'TRANSFER' ? 'Assignment Transfer' : 'Cap Redistribution'}
|
|
|
|
|
</Badge>
|
|
|
|
|
<span className="text-sm font-medium">
|
|
|
|
|
{event.droppedJuror.name}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span className="text-xs text-muted-foreground">
|
|
|
|
|
{new Date(event.timestamp).toLocaleString()}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
By {event.performedBy.name || event.performedBy.email} — {event.movedCount} project(s) reassigned
|
|
|
|
|
{event.failedCount > 0 && `, ${event.failedCount} failed`}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{event.moves.length > 0 && (
|
|
|
|
|
<div className="mt-2">
|
|
|
|
|
<table className="w-full text-xs">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr className="text-muted-foreground border-b">
|
|
|
|
|
<th className="text-left py-1 font-medium">Project</th>
|
|
|
|
|
<th className="text-left py-1 font-medium">Reassigned To</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{event.moves.map((move, i) => (
|
|
|
|
|
<tr key={i} className="border-b last:border-0">
|
|
|
|
|
<td className="py-1.5 pr-2 max-w-[250px] truncate">
|
|
|
|
|
{move.projectTitle}
|
|
|
|
|
</td>
|
|
|
|
|
<td className="py-1.5 font-medium">
|
|
|
|
|
{move.newJurorName}
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
))}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{event.failedProjects.length > 0 && (
|
|
|
|
|
<div className="mt-1">
|
|
|
|
|
<p className="text-xs font-medium text-destructive">Could not reassign:</p>
|
|
|
|
|
<ul className="text-xs text-muted-foreground list-disc list-inside">
|
|
|
|
|
{event.failedProjects.map((p, i) => (
|
|
|
|
|
<li key={i}>{p}</li>
|
|
|
|
|
))}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)
|
|
|
|
|
}
|