diff --git a/src/app/(mentor)/mentor/projects/[id]/page.tsx b/src/app/(mentor)/mentor/projects/[id]/page.tsx
index 9f4ed49..3683750 100644
--- a/src/app/(mentor)/mentor/projects/[id]/page.tsx
+++ b/src/app/(mentor)/mentor/projects/[id]/page.tsx
@@ -109,18 +109,24 @@ function ProjectDetailContent({ projectId }: { projectId: string }) {
- {project.round.program.year} Edition
+ {project.program.year} Edition
- •
- {project.round.name}
+ {project.roundProjects?.[0]?.round && (
+ <>
+ •
+ {project.roundProjects[0].round.name}
+ >
+ )}
{project.title}
-
- {project.status.replace('_', ' ')}
-
+ {project.roundProjects?.[0]?.status && (
+
+ {project.roundProjects[0].status.replace('_', ' ')}
+
+ )}
{project.teamName && (
{project.teamName}
diff --git a/src/app/(mentor)/mentor/projects/page.tsx b/src/app/(mentor)/mentor/projects/page.tsx
index 821d0c1..25a4222 100644
--- a/src/app/(mentor)/mentor/projects/page.tsx
+++ b/src/app/(mentor)/mentor/projects/page.tsx
@@ -94,16 +94,22 @@ export default function MentorProjectsPage() {
- {project.round.program.year} Edition
+ {project.program.year} Edition
- •
- {project.round.name}
+ {project.roundProjects?.[0]?.round && (
+ <>
+ •
+ {project.roundProjects[0].round.name}
+ >
+ )}
{project.title}
-
- {project.status.replace('_', ' ')}
-
+ {project.roundProjects?.[0]?.status && (
+
+ {project.roundProjects[0].status.replace('_', ' ')}
+
+ )}
{project.teamName && (
{project.teamName}
diff --git a/src/app/(observer)/observer/page.tsx b/src/app/(observer)/observer/page.tsx
index 3dfd232..4df8d97 100644
--- a/src/app/(observer)/observer/page.tsx
+++ b/src/app/(observer)/observer/page.tsx
@@ -48,7 +48,7 @@ async function ObserverDashboardContent() {
program: { select: { name: true, year: true } },
_count: {
select: {
- projects: true,
+ roundProjects: true,
assignments: true,
},
},
@@ -176,7 +176,7 @@ async function ObserverDashboardContent() {
-
{round._count.projects} projects
+
{round._count.roundProjects} projects
{round._count.assignments} assignments
diff --git a/src/app/(observer)/observer/reports/page.tsx b/src/app/(observer)/observer/reports/page.tsx
index 1259943..dd12986 100644
--- a/src/app/(observer)/observer/reports/page.tsx
+++ b/src/app/(observer)/observer/reports/page.tsx
@@ -34,7 +34,7 @@ async function ReportsContent() {
},
_count: {
select: {
- projects: true,
+ roundProjects: true,
assignments: true,
},
},
@@ -70,7 +70,7 @@ async function ReportsContent() {
})
// Calculate totals
- const totalProjects = roundStats.reduce((acc, r) => acc + r._count.projects, 0)
+ const totalProjects = roundStats.reduce((acc, r) => acc + r._count.roundProjects, 0)
const totalAssignments = roundStats.reduce(
(acc, r) => acc + r.totalAssignments,
0
@@ -176,7 +176,7 @@ async function ReportsContent() {
{round.program.name}
-
{round._count.projects}
+
{round._count.roundProjects}
@@ -237,7 +237,7 @@ async function ReportsContent() {
)}
- {round._count.projects} projects
+ {round._count.roundProjects} projects
{round.completedEvaluations}/{round.totalAssignments} evaluations
diff --git a/src/app/(public)/my-submission/[id]/submission-detail-client.tsx b/src/app/(public)/my-submission/[id]/submission-detail-client.tsx
index 03e9da4..423c02f 100644
--- a/src/app/(public)/my-submission/[id]/submission-detail-client.tsx
+++ b/src/app/(public)/my-submission/[id]/submission-detail-client.tsx
@@ -132,7 +132,7 @@ export function SubmissionDetailClient() {
- {project.round.program.year} Edition - {project.round.name}
+ {project.roundProjects?.[0]?.round?.program?.year ? `${project.roundProjects[0].round.program.year} Edition` : ''}{project.roundProjects?.[0]?.round?.name ? ` - ${project.roundProjects[0].round.name}` : ''}
diff --git a/src/app/(public)/my-submission/my-submission-client.tsx b/src/app/(public)/my-submission/my-submission-client.tsx
index 90e43f7..fcd4b45 100644
--- a/src/app/(public)/my-submission/my-submission-client.tsx
+++ b/src/app/(public)/my-submission/my-submission-client.tsx
@@ -131,18 +131,24 @@ export function MySubmissionClient() {
) : (
- {submissions.map((project) => (
+ {submissions.map((project) => {
+ const latestRoundProject = project.roundProjects?.[0]
+ const projectStatus = latestRoundProject?.status ?? 'SUBMITTED'
+ const roundName = latestRoundProject?.round?.name
+ const programYear = latestRoundProject?.round?.program?.year
+
+ return (
{project.title}
- {project.round.program.year} Edition - {project.round.name}
+ {programYear ? `${programYear} Edition` : ''}{roundName ? ` - ${roundName}` : ''}
-
- {project.status.replace('_', ' ')}
+
+ {projectStatus.replace('_', ' ')}
@@ -197,22 +203,22 @@ export function MySubmissionClient() {
status: 'UNDER_REVIEW',
label: 'Under Review',
date: null,
- completed: ['UNDER_REVIEW', 'SEMIFINALIST', 'FINALIST', 'WINNER'].includes(project.status),
+ completed: ['UNDER_REVIEW', 'SEMIFINALIST', 'FINALIST', 'WINNER'].includes(projectStatus),
},
{
status: 'SEMIFINALIST',
label: 'Semi-finalist',
date: null,
- completed: ['SEMIFINALIST', 'FINALIST', 'WINNER'].includes(project.status),
+ completed: ['SEMIFINALIST', 'FINALIST', 'WINNER'].includes(projectStatus),
},
{
status: 'FINALIST',
label: 'Finalist',
date: null,
- completed: ['FINALIST', 'WINNER'].includes(project.status),
+ completed: ['FINALIST', 'WINNER'].includes(projectStatus),
},
]}
- currentStatus={project.status}
+ currentStatus={projectStatus}
className="mt-4"
/>
@@ -229,7 +235,8 @@ export function MySubmissionClient() {
- ))}
+ )
+ })}