feat(frontend): purge all static content fallback files and enforce strict backend-only dynamic rendering
- Delete all legacy static content data files (members.ts, publications.ts, lectures.ts, standards.ts, projects.ts) - Remove all fallback imports and static fallbacks across all page components - Enforce strict dynamic runtime fetching where pages render empty datasets when Go backend server is unavailable
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
import { researchProjects as staticProjects } from "../../content/projects";
|
||||
import type { ResearchProject } from "../../content/types";
|
||||
import ProjectPageViewControls from "./ProjectPageViewControls";
|
||||
|
||||
@@ -8,7 +7,7 @@ interface ProjectPageViewProps {
|
||||
}
|
||||
|
||||
export function ProjectPageView({ projects: projectsProp }: ProjectPageViewProps = {}) {
|
||||
const projects = projectsProp ?? staticProjects;
|
||||
const projects = projectsProp ?? [];
|
||||
const slugs = projects.map((p) => p.slug);
|
||||
const trackId = "research-projects-track";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { semesters as staticSemesters } from "../../content/lectures";
|
||||
import { getSemesters } from "../../lib/api";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -11,7 +10,7 @@ export const metadata: Metadata = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function LecturesPage() {
|
||||
const semesters = (await getSemesters()) ?? staticSemesters;
|
||||
const semesters = (await getSemesters()) ?? [];
|
||||
|
||||
const recentSemesters = semesters.slice(0, 3);
|
||||
const olderSemesters = semesters.slice(3);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { activeMembers as staticMembers, alumni as staticAlumni } from "../../content/members";
|
||||
import { getMembers, getAlumni } from "../../lib/api";
|
||||
import { ProfessorDetailsDialog } from "./_components/ProfessorDetailsDialog";
|
||||
|
||||
@@ -22,8 +21,8 @@ const DEGREE_LABEL: Record<string, string> = {
|
||||
};
|
||||
|
||||
export default async function MembersPage() {
|
||||
const activeMembers = (await getMembers()) ?? staticMembers;
|
||||
const alumni = (await getAlumni()) ?? staticAlumni;
|
||||
const activeMembers = (await getMembers()) ?? [];
|
||||
const alumni = (await getAlumni()) ?? [];
|
||||
|
||||
const phdStudents = activeMembers.filter(
|
||||
(m) =>
|
||||
|
||||
@@ -2,31 +2,10 @@ import React from "react";
|
||||
import Link from "next/link";
|
||||
import HeroComposition from "./_components/HeroComposition";
|
||||
import { ProjectPageView } from "./_components/ProjectPageView";
|
||||
import { publications as staticPubs, patents as staticPatents } from "../content/publications";
|
||||
import { standardsBodies as staticStandards } from "../content/standards";
|
||||
import { researchProjects as staticProjects } from "../content/projects";
|
||||
import { getStatsSummary, getResearchAreaNames, getResearchProjects } from "../lib/api";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
// CUSTOMIZATION HOOK: 14 Core Research Areas
|
||||
const RESEARCH_AREAS: string[] = [
|
||||
"Quick UDP Internet Connection (QUIC)",
|
||||
"QUIC-based Mobility and Multi-Streaming Support",
|
||||
"Services and Protocols for Internet-of-Things (IoT)",
|
||||
"Constrained Application Protocol (CoAP)",
|
||||
"In-Vehicle Infotainment (IVI)",
|
||||
"Optical Wireless or Visible Light Communications (OWC/VLC)",
|
||||
"Lighting Control Networks (PLASA E1.45) for LED-based VLC",
|
||||
"Mobility Management: Distributed Mobility Control",
|
||||
"Multicast Routing Protocols and Reliable Multicasting",
|
||||
"mobile SCTP (mSCTP): Soft Handover in Transport Layer",
|
||||
"Stream Control Transmission Protocol (SCTP)",
|
||||
"Telecommunication Optimization: Network Planning and Management",
|
||||
"TAC/TAL Configuration for Paging and Location Management",
|
||||
"Tabu Search and Genetic Algorithm",
|
||||
];
|
||||
|
||||
const INTERNATIONAL_SDOS = [
|
||||
"IEC TC100: Multimedia Systems and Equipment",
|
||||
"ISO/IEC JTC1/SC41: Internet-of-Things (IoT) Applications",
|
||||
@@ -37,19 +16,13 @@ const INTERNATIONAL_SDOS = [
|
||||
|
||||
export default async function HomePage() {
|
||||
const stats = (await getStatsSummary()) ?? {
|
||||
intlPubsCount: staticPubs.filter(
|
||||
(p) => p.category === "intl-journal-conf"
|
||||
).length,
|
||||
patentCount: staticPatents.length,
|
||||
stdDocsCount: staticStandards.reduce(
|
||||
(sum, b) =>
|
||||
sum + b.projects.reduce((pSum, p) => pSum + p.documents.length, 0),
|
||||
0
|
||||
),
|
||||
intlPubsCount: 0,
|
||||
patentCount: 0,
|
||||
stdDocsCount: 0,
|
||||
};
|
||||
|
||||
const researchAreas = (await getResearchAreaNames()) ?? RESEARCH_AREAS;
|
||||
const researchProjects = (await getResearchProjects()) ?? staticProjects;
|
||||
const researchAreas = (await getResearchAreaNames()) ?? [];
|
||||
const researchProjects = (await getResearchProjects()) ?? [];
|
||||
|
||||
return (
|
||||
<div className="container-content space-y-16 md:space-y-24 pt-10 md:pt-16 pb-16 md:pb-24">
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { CategoryNav } from "../_components/CategoryNav";
|
||||
import { publications as staticPubs, patents as staticPatents } from "../../../content/publications";
|
||||
import { getPublications, getPatents } from "../../../lib/api";
|
||||
import { PUB_CATEGORIES } from "../../../content/categories";
|
||||
import { PubCategory } from "../../../content/types";
|
||||
@@ -36,8 +35,8 @@ export default async function PublicationCategoryPage({ params }: PageProps) {
|
||||
|
||||
const slug = category as PubCategory;
|
||||
|
||||
const publications = (await getPublications()) ?? staticPubs;
|
||||
const patents = (await getPatents()) ?? staticPatents;
|
||||
const publications = (await getPublications()) ?? [];
|
||||
const patents = (await getPatents()) ?? [];
|
||||
|
||||
const counts = {
|
||||
"intl-journal-conf": publications.filter((p) => p.category === "intl-journal-conf").length,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
import { PUB_CATEGORIES } from "../../../content/categories";
|
||||
import { publications as staticPubs, patents as staticPatents } from "../../../content/publications";
|
||||
import { PubCategory } from "../../../content/types";
|
||||
|
||||
export interface CategoryCounts {
|
||||
@@ -20,8 +19,7 @@ export function CategoryNav({ currentCategory, counts }: CategoryNavProps) {
|
||||
if (counts?.[slug as keyof CategoryCounts] !== undefined) {
|
||||
return counts[slug as keyof CategoryCounts]!;
|
||||
}
|
||||
if (slug === "patent") return staticPatents.length;
|
||||
return staticPubs.filter((p) => p.category === slug).length;
|
||||
return 0;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { CategoryNav } from "./_components/CategoryNav";
|
||||
import { publications as staticPubs, patents as staticPatents } from "../../content/publications";
|
||||
import { getPublications, getPatents } from "../../lib/api";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -11,8 +10,8 @@ export const metadata: Metadata = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function PublicationsIndexPage() {
|
||||
const publications = (await getPublications()) ?? staticPubs;
|
||||
const patents = (await getPatents()) ?? staticPatents;
|
||||
const publications = (await getPublications()) ?? [];
|
||||
const patents = (await getPatents()) ?? [];
|
||||
|
||||
const counts = {
|
||||
"intl-journal-conf": publications.filter((p) => p.category === "intl-journal-conf").length,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { standardsBodies as staticStandards } from "../../content/standards";
|
||||
import { getStandardsBodies } from "../../lib/api";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
@@ -11,7 +10,7 @@ export const metadata: Metadata = {
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function StandardizationPage() {
|
||||
const standardsBodies = (await getStandardsBodies()) ?? staticStandards;
|
||||
const standardsBodies = (await getStandardsBodies()) ?? [];
|
||||
return (
|
||||
<div className="container-content py-8 sm:py-12 space-y-10 sm:space-y-14">
|
||||
{/* Page Header */}
|
||||
|
||||
Reference in New Issue
Block a user