diff --git a/src/app/(dashboard)/commandes-auto/page.tsx b/src/app/(dashboard)/commandes-auto/page.tsx index 2b7ee83..5b5d287 100644 --- a/src/app/(dashboard)/commandes-auto/page.tsx +++ b/src/app/(dashboard)/commandes-auto/page.tsx @@ -4,6 +4,9 @@ import { CommandesAutoTabs } from "./tabs"; export type { PgCommandeAutoRow }; +// Données live (DB + API FF Nancy) : rendu à la requête, jamais prérendu au build. +export const dynamic = "force-dynamic"; + export default async function CommandesAutoPage() { const [rows, cadences, fournisseurs] = await Promise.all([ pgGetCommandesAuto(), diff --git a/src/app/globals.css b/src/app/globals.css index 2415593..f9c6aed 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,5 +1,13 @@ @import "tailwindcss"; +/* Police de l'app : Inter (chargée via dans le layout, fallback système). + Définie ici pour que l'utilitaire `font-sans` et var(--font-sans) la prennent + sans recourir à next/font/google (pas de fetch réseau au build). */ +@theme { + --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; +} + + /* ═══════════════════════════════════════════ CollectFlow — Apple-inspired Design System ═══════════════════════════════════════════ */ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 8fb1e34..7fbdeef 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,21 +1,12 @@ import type { Metadata } from "next"; -import { Inter } from "next/font/google"; -import { ThemeProvider } from "@/components/shared/theme-provider"; import "./globals.css"; - -const inter = Inter({ - subsets: ["latin"], - variable: "--font-sans", - display: "swap", -}); +import { Providers } from "./providers"; export const metadata: Metadata = { title: "CollectFlow — Dashboard Décisionnel", description: "Révision d'Assortiment Haute Performance", }; -import { Providers } from "./providers"; - export default function RootLayout({ children, }: Readonly<{ @@ -23,7 +14,18 @@ export default function RootLayout({ }>) { return ( - + + {/* Inter chargé côté navigateur (et non au build) pour éviter toute + dépendance réseau à Google Fonts pendant `next build` (Docker). */} + + + {/* eslint-disable-next-line @next/next/no-page-custom-font */} + + + {children} diff --git a/src/features/commandes-auto/actions.ts b/src/features/commandes-auto/actions.ts index 06d878b..7453569 100644 --- a/src/features/commandes-auto/actions.ts +++ b/src/features/commandes-auto/actions.ts @@ -45,10 +45,17 @@ export async function getFournisseursPourCadence(): Promise<{ code: string; nom: * de la dernière réception (FF Nancy). */ export async function listCadences(): Promise { - const [rows, receptions] = await Promise.all([ - db.select().from(commandeCadences), - pgGetDerniereReceptionParFournisseur(), - ]); + let rows: typeof commandeCadences.$inferSelect[] = []; + let receptions = new Map(); + try { + [rows, receptions] = await Promise.all([ + db.select().from(commandeCadences), + pgGetDerniereReceptionParFournisseur(), + ]); + } catch (e) { + console.error("[cadence] listCadences error:", (e as Error).message); + return []; + } const now = Date.now();