Show edition year instead of program name platform-wide
Build and Push Docker Image / build (push) Successful in 8m33s
Details
Build and Push Docker Image / build (push) Successful in 8m33s
Details
Change program selectors and display labels from full program name to "2026 Edition" format across admin, jury, mentor, observer, and public pages. Selector labels changed from "Program" to "Edition". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
86d38ba743
commit
e34cafebbf
|
|
@ -89,15 +89,15 @@ export default function CreateAwardPage() {
|
|||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="program">Program</Label>
|
||||
<Label htmlFor="program">Edition</Label>
|
||||
<Select value={programId} onValueChange={setProgramId}>
|
||||
<SelectTrigger id="program">
|
||||
<SelectValue placeholder="Select a program" />
|
||||
<SelectValue placeholder="Select an edition" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{programs?.map((p) => (
|
||||
<SelectItem key={p.id} value={p.id}>
|
||||
{p.name}
|
||||
{p.year} Edition
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ export default function EditLearningResourcePage() {
|
|||
<SelectItem value="global">Global (All Programs)</SelectItem>
|
||||
{programs?.map((program) => (
|
||||
<SelectItem key={program.id} value={program.id}>
|
||||
{program.name} {program.year}
|
||||
{program.year} Edition
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ export default function NewLearningResourcePage() {
|
|||
<SelectItem value="global">Global (All Programs)</SelectItem>
|
||||
{programs?.map((program) => (
|
||||
<SelectItem key={program.id} value={program.id}>
|
||||
{program.name} {program.year}
|
||||
{program.year} Edition
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function ImportPageContent() {
|
|||
const rounds = programs?.flatMap((p) =>
|
||||
(p.rounds || []).map((r) => ({
|
||||
...r,
|
||||
programName: p.name,
|
||||
programName: `${p.year} Edition`,
|
||||
}))
|
||||
) || []
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ function NewProjectPageContent() {
|
|||
const rounds = programs?.flatMap((p) =>
|
||||
(p.rounds || []).map((r) => ({
|
||||
...r,
|
||||
programName: p.name,
|
||||
programName: `${p.year} Edition`,
|
||||
}))
|
||||
) || []
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ export interface ProjectFilters {
|
|||
}
|
||||
|
||||
interface FilterOptions {
|
||||
rounds: Array<{ id: string; name: string; program: { name: string } }>
|
||||
rounds: Array<{ id: string; name: string; program: { name: string; year: number } }>
|
||||
countries: string[]
|
||||
categories: Array<{ value: string; count: number }>
|
||||
issues: Array<{ value: string; count: number }>
|
||||
|
|
@ -188,7 +188,7 @@ export function ProjectFiltersBar({
|
|||
<SelectItem value="_all">All rounds</SelectItem>
|
||||
{filterOptions?.rounds.map((r) => (
|
||||
<SelectItem key={r.id} value={r.id}>
|
||||
{r.name} ({r.program.name})
|
||||
{r.name} ({r.program.year} Edition)
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ function ReportsOverview() {
|
|||
const { data: programs, isLoading } = trpc.program.list.useQuery({ includeRounds: true })
|
||||
|
||||
// Flatten rounds from all programs
|
||||
const rounds = programs?.flatMap(p => p.rounds.map(r => ({ ...r, programId: p.id, programName: p.name }))) || []
|
||||
const rounds = programs?.flatMap(p => p.rounds.map(r => ({ ...r, programId: p.id, programName: `${p.year} Edition` }))) || []
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
|
|
@ -234,7 +234,7 @@ function RoundAnalytics() {
|
|||
const { data: programs, isLoading: roundsLoading } = trpc.program.list.useQuery({ includeRounds: true })
|
||||
|
||||
// Flatten rounds from all programs with program name
|
||||
const rounds = programs?.flatMap(p => p.rounds.map(r => ({ ...r, programName: p.name }))) || []
|
||||
const rounds = programs?.flatMap(p => p.rounds.map(r => ({ ...r, programName: `${p.year} Edition` }))) || []
|
||||
|
||||
// Set default selected round
|
||||
if (rounds.length && !selectedRoundId) {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ function RoundDetailContent({ roundId }: { roundId: string }) {
|
|||
<div className="space-y-1">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<Link href={`/admin/programs/${round.program.id}`} className="hover:underline">
|
||||
{round.program.name}
|
||||
{round.program.year} Edition
|
||||
</Link>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
|
|
|
|||
|
|
@ -150,20 +150,20 @@ function CreateRoundContent() {
|
|||
name="programId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Program</FormLabel>
|
||||
<FormLabel>Edition</FormLabel>
|
||||
<Select
|
||||
onValueChange={field.onChange}
|
||||
defaultValue={field.value}
|
||||
>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select a program" />
|
||||
<SelectValue placeholder="Select an edition" />
|
||||
</SelectTrigger>
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
{programs.map((program) => (
|
||||
<SelectItem key={program.id} value={program.id}>
|
||||
{program.name} ({program.year})
|
||||
{program.year} Edition
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ function RoundsContent() {
|
|||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<CardTitle className="text-lg">{program.name}</CardTitle>
|
||||
<CardTitle className="text-lg">{program.year} Edition</CardTitle>
|
||||
<CardDescription>
|
||||
{program.year} - {program.status}
|
||||
{program.name} - {program.status}
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Button asChild>
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ async function AssignmentsContent({
|
|||
program: {
|
||||
select: {
|
||||
name: true,
|
||||
year: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -154,7 +155,7 @@ async function AssignmentsContent({
|
|||
<div>
|
||||
<p>{assignment.round.name}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{assignment.round.program.name}
|
||||
{assignment.round.program.year} Edition
|
||||
</p>
|
||||
</div>
|
||||
</TableCell>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ async function ProjectContent({ projectId }: { projectId: string }) {
|
|||
round: {
|
||||
include: {
|
||||
program: {
|
||||
select: { name: true },
|
||||
select: { name: true, year: true },
|
||||
},
|
||||
evaluationForms: {
|
||||
where: { isActive: true },
|
||||
|
|
@ -158,7 +158,7 @@ async function ProjectContent({ projectId }: { projectId: string }) {
|
|||
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
|
||||
<div className="space-y-1">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<span>{round.program.name}</span>
|
||||
<span>{round.program.year} Edition</span>
|
||||
<span>/</span>
|
||||
<span>{round.name}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default function MentorDashboard() {
|
|||
<div className="space-y-1">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<span>
|
||||
{project.round.program.name} {project.round.program.year}
|
||||
{project.round.program.year} Edition
|
||||
</span>
|
||||
<span>•</span>
|
||||
<span>{project.round.name}</span>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ function ProjectDetailContent({ projectId }: { projectId: string }) {
|
|||
<div className="space-y-1">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<span>
|
||||
{project.round.program.name} {project.round.program.year}
|
||||
{project.round.program.year} Edition
|
||||
</span>
|
||||
<span>•</span>
|
||||
<span>{project.round.name}</span>
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export default function MentorProjectsPage() {
|
|||
<div className="space-y-1">
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<span>
|
||||
{project.round.program.name} {project.round.program.year}
|
||||
{project.round.program.year} Edition
|
||||
</span>
|
||||
<span>•</span>
|
||||
<span>{project.round.name}</span>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ async function ObserverDashboardContent() {
|
|||
orderBy: { createdAt: 'desc' },
|
||||
take: 5,
|
||||
include: {
|
||||
program: { select: { name: true } },
|
||||
program: { select: { name: true, year: true } },
|
||||
_count: {
|
||||
select: {
|
||||
projects: true,
|
||||
|
|
@ -172,7 +172,7 @@ async function ObserverDashboardContent() {
|
|||
</Badge>
|
||||
</div>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{round.program.name}
|
||||
{round.program.year} Edition
|
||||
</p>
|
||||
</div>
|
||||
<div className="text-right text-sm">
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ export function SubmissionDetailClient() {
|
|||
</Badge>
|
||||
</div>
|
||||
<p className="text-muted-foreground">
|
||||
{project.round.program.name} {project.round.program.year} - {project.round.name}
|
||||
{project.round.program.year} Edition - {project.round.name}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export function MySubmissionClient() {
|
|||
<div>
|
||||
<CardTitle className="text-lg">{project.title}</CardTitle>
|
||||
<CardDescription>
|
||||
{project.round.program.name} {project.round.program.year} - {project.round.name}
|
||||
{project.round.program.year} Edition - {project.round.name}
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Badge variant={statusColors[project.status] || 'secondary'}>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export const projectRouter = router({
|
|||
include: {
|
||||
files: true,
|
||||
round: {
|
||||
select: { id: true, name: true, program: { select: { name: true } } },
|
||||
select: { id: true, name: true, program: { select: { name: true, year: true } } },
|
||||
},
|
||||
_count: { select: { assignments: true } },
|
||||
},
|
||||
|
|
@ -130,7 +130,7 @@ export const projectRouter = router({
|
|||
.query(async ({ ctx }) => {
|
||||
const [rounds, countries, categories, issues] = await Promise.all([
|
||||
ctx.prisma.round.findMany({
|
||||
select: { id: true, name: true, program: { select: { name: true } } },
|
||||
select: { id: true, name: true, program: { select: { name: true, year: true } } },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
}),
|
||||
ctx.prisma.project.findMany({
|
||||
|
|
|
|||
Loading…
Reference in New Issue