Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
import type { Route } from 'next'
|
|
|
|
|
import { trpc } from '@/lib/trpc/client'
|
|
|
|
|
import { Badge } from '@/components/ui/badge'
|
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardContent,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardTitle,
|
|
|
|
|
} from '@/components/ui/card'
|
|
|
|
|
import { Skeleton } from '@/components/ui/skeleton'
|
|
|
|
|
import {
|
|
|
|
|
Plus,
|
|
|
|
|
Layers,
|
|
|
|
|
GitBranch,
|
|
|
|
|
Calendar,
|
2026-02-14 01:54:56 +01:00
|
|
|
Workflow,
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
} from 'lucide-react'
|
|
|
|
|
import { cn } from '@/lib/utils'
|
2026-02-14 01:54:56 +01:00
|
|
|
import { formatDistanceToNow } from 'date-fns'
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
import { useEdition } from '@/contexts/edition-context'
|
|
|
|
|
|
2026-02-14 01:54:56 +01:00
|
|
|
const statusConfig = {
|
|
|
|
|
DRAFT: {
|
|
|
|
|
label: 'Draft',
|
|
|
|
|
bgClass: 'bg-gray-100 text-gray-700',
|
|
|
|
|
dotClass: 'bg-gray-500',
|
|
|
|
|
},
|
|
|
|
|
ACTIVE: {
|
|
|
|
|
label: 'Active',
|
|
|
|
|
bgClass: 'bg-emerald-100 text-emerald-700',
|
|
|
|
|
dotClass: 'bg-emerald-500',
|
|
|
|
|
},
|
|
|
|
|
CLOSED: {
|
|
|
|
|
label: 'Closed',
|
|
|
|
|
bgClass: 'bg-blue-100 text-blue-700',
|
|
|
|
|
dotClass: 'bg-blue-500',
|
|
|
|
|
},
|
|
|
|
|
ARCHIVED: {
|
|
|
|
|
label: 'Archived',
|
|
|
|
|
bgClass: 'bg-muted text-muted-foreground',
|
|
|
|
|
dotClass: 'bg-muted-foreground',
|
|
|
|
|
},
|
|
|
|
|
} as const
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
|
|
|
|
|
export default function PipelineListPage() {
|
|
|
|
|
const { currentEdition } = useEdition()
|
|
|
|
|
const programId = currentEdition?.id
|
|
|
|
|
|
|
|
|
|
const { data: pipelines, isLoading } = trpc.pipeline.list.useQuery(
|
|
|
|
|
{ programId: programId! },
|
|
|
|
|
{ enabled: !!programId }
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if (!programId) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<h1 className="text-xl font-bold">Pipelines</h1>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
Select an edition to view pipelines
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Card>
|
|
|
|
|
<CardContent className="flex flex-col items-center justify-center py-12 text-center">
|
|
|
|
|
<Calendar className="h-12 w-12 text-muted-foreground/50" />
|
|
|
|
|
<p className="mt-2 font-medium">No Edition Selected</p>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
Select an edition from the sidebar to view its pipelines
|
|
|
|
|
</p>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
{/* Header */}
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<div>
|
|
|
|
|
<h1 className="text-xl font-bold">Pipelines</h1>
|
|
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
Manage evaluation pipelines for {currentEdition?.name}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<Link href={`/admin/rounds/new-pipeline?programId=${programId}` as Route}>
|
|
|
|
|
<Button size="sm">
|
|
|
|
|
<Plus className="h-4 w-4 mr-1" />
|
|
|
|
|
Create Pipeline
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Loading */}
|
|
|
|
|
{isLoading && (
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
|
|
|
{[1, 2, 3].map((i) => (
|
|
|
|
|
<Card key={i}>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<Skeleton className="h-5 w-32" />
|
|
|
|
|
<Skeleton className="h-4 w-20 mt-1" />
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
|
|
|
|
<Skeleton className="h-4 w-full" />
|
|
|
|
|
<Skeleton className="h-4 w-3/4 mt-2" />
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Empty State */}
|
|
|
|
|
{!isLoading && (!pipelines || pipelines.length === 0) && (
|
2026-02-14 01:54:56 +01:00
|
|
|
<Card className="border-2 border-dashed">
|
|
|
|
|
<CardContent className="flex flex-col items-center justify-center py-16 text-center">
|
|
|
|
|
<div className="rounded-full bg-primary/10 p-4 mb-4">
|
|
|
|
|
<Workflow className="h-10 w-10 text-primary" />
|
|
|
|
|
</div>
|
|
|
|
|
<h3 className="text-lg font-semibold mb-2">No Pipelines Yet</h3>
|
|
|
|
|
<p className="text-sm text-muted-foreground max-w-md mb-6">
|
|
|
|
|
Pipelines organize your project evaluation workflow into tracks and stages.
|
|
|
|
|
Create your first pipeline to get started with managing project evaluations.
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
</p>
|
|
|
|
|
<Link href={`/admin/rounds/new-pipeline?programId=${programId}` as Route}>
|
2026-02-14 01:54:56 +01:00
|
|
|
<Button>
|
|
|
|
|
<Plus className="h-4 w-4 mr-2" />
|
|
|
|
|
Create Your First Pipeline
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Pipeline Cards */}
|
|
|
|
|
{pipelines && pipelines.length > 0 && (
|
|
|
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
2026-02-14 01:54:56 +01:00
|
|
|
{pipelines.map((pipeline) => {
|
|
|
|
|
const status = pipeline.status as keyof typeof statusConfig
|
|
|
|
|
const config = statusConfig[status] || statusConfig.DRAFT
|
|
|
|
|
const description = (pipeline.settingsJson as Record<string, unknown> | null)?.description as string | undefined
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Link
|
|
|
|
|
key={pipeline.id}
|
|
|
|
|
href={`/admin/rounds/pipeline/${pipeline.id}` as Route}
|
|
|
|
|
className="block"
|
|
|
|
|
>
|
|
|
|
|
<Card className="group hover:shadow-md transition-shadow cursor-pointer h-full flex flex-col">
|
|
|
|
|
<CardHeader className="pb-3">
|
|
|
|
|
<div className="flex items-start justify-between gap-3">
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<CardTitle className="text-base leading-tight mb-1">
|
|
|
|
|
{pipeline.name}
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<p className="font-mono text-xs text-muted-foreground truncate">
|
|
|
|
|
{pipeline.slug}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-02-13 20:50:22 +01:00
|
|
|
<Badge
|
|
|
|
|
variant="secondary"
|
|
|
|
|
className={cn(
|
2026-02-14 01:54:56 +01:00
|
|
|
'text-[10px] shrink-0 flex items-center gap-1.5',
|
|
|
|
|
config.bgClass
|
2026-02-13 20:50:22 +01:00
|
|
|
)}
|
|
|
|
|
>
|
2026-02-14 01:54:56 +01:00
|
|
|
<span className={cn('h-1.5 w-1.5 rounded-full', config.dotClass)} />
|
|
|
|
|
{config.label}
|
2026-02-13 20:50:22 +01:00
|
|
|
</Badge>
|
|
|
|
|
</div>
|
2026-02-14 01:54:56 +01:00
|
|
|
|
|
|
|
|
{/* Description */}
|
|
|
|
|
{description && (
|
|
|
|
|
<p className="text-xs text-muted-foreground line-clamp-2 mt-2">
|
|
|
|
|
{description}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</CardHeader>
|
|
|
|
|
|
|
|
|
|
<CardContent className="mt-auto">
|
|
|
|
|
{/* Track Indicator - Simplified visualization */}
|
|
|
|
|
<div className="mb-3 pb-3 border-b">
|
|
|
|
|
<div className="flex items-center gap-1.5 text-xs text-muted-foreground mb-1.5">
|
|
|
|
|
<Layers className="h-3.5 w-3.5" />
|
|
|
|
|
<span className="font-medium">
|
|
|
|
|
{pipeline._count.tracks === 0
|
|
|
|
|
? 'No tracks'
|
|
|
|
|
: pipeline._count.tracks === 1
|
|
|
|
|
? '1 track'
|
|
|
|
|
: `${pipeline._count.tracks} tracks`}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
{pipeline._count.tracks > 0 && (
|
|
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
{Array.from({ length: Math.min(pipeline._count.tracks, 5) }).map((_, i) => (
|
|
|
|
|
<div
|
|
|
|
|
key={i}
|
|
|
|
|
className="h-6 flex-1 rounded border border-border bg-muted/30 flex items-center justify-center"
|
|
|
|
|
>
|
|
|
|
|
<div className="h-1 w-1 rounded-full bg-muted-foreground/40" />
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
{pipeline._count.tracks > 5 && (
|
|
|
|
|
<span className="text-[10px] text-muted-foreground ml-1">
|
|
|
|
|
+{pipeline._count.tracks - 5}
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-02-13 20:50:22 +01:00
|
|
|
</div>
|
2026-02-14 01:54:56 +01:00
|
|
|
|
|
|
|
|
{/* Stats */}
|
|
|
|
|
<div className="space-y-1.5">
|
|
|
|
|
<div className="flex items-center justify-between text-xs">
|
|
|
|
|
<div className="flex items-center gap-1.5 text-muted-foreground">
|
|
|
|
|
<GitBranch className="h-3.5 w-3.5" />
|
|
|
|
|
<span>Routing rules</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span className="font-medium text-foreground">
|
|
|
|
|
{pipeline._count.routingRules}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
|
|
|
|
<span>Updated {formatDistanceToNow(new Date(pipeline.updatedAt))} ago</span>
|
|
|
|
|
</div>
|
2026-02-13 20:50:22 +01:00
|
|
|
</div>
|
2026-02-14 01:54:56 +01:00
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</Link>
|
|
|
|
|
)
|
|
|
|
|
})}
|
Round system redesign: Phases 1-7 complete
Full pipeline/track/stage architecture replacing the legacy round system.
Schema: 11 new models (Pipeline, Track, Stage, StageTransition,
ProjectStageState, RoutingRule, Cohort, CohortProject, LiveProgressCursor,
OverrideAction, AudienceVoter) + 8 new enums.
Backend: 9 new routers (pipeline, stage, routing, stageFiltering,
stageAssignment, cohort, live, decision, award) + 6 new services
(stage-engine, routing-engine, stage-filtering, stage-assignment,
stage-notifications, live-control).
Frontend: Pipeline wizard (17 components), jury stage pages (7),
applicant pipeline pages (3), public stage pages (2), admin pipeline
pages (5), shared stage components (3), SSE route, live hook.
Phase 6 refit: 23 routers/services migrated from roundId to stageId,
all frontend components refitted. Deleted round.ts (985 lines),
roundTemplate.ts, round-helpers.ts, round-settings.ts, round-type-settings.tsx,
10 legacy admin pages, 7 legacy jury pages, 3 legacy dialogs.
Phase 7 validation: 36 tests (10 unit + 8 integration files) all passing,
TypeScript 0 errors, Next.js build succeeds, 13 integrity checks,
legacy symbol sweep clean, auto-seed on first Docker startup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:57:09 +01:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|