CI / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (pull_request) Canceled after 0s
CI / DMS Security-Test-Gate (AC5, Merge-Gate) (pull_request) Canceled after 0s
CI / Core-Modul (Build/Vet/Test) (pull_request) Canceled after 0s
RBAC-Rollenhierarchie-Pflichtgate / rbac-policy-invariant (pull_request) Canceled after 0s
CI / Connect Security-Test-Gate (QA-01 AC4, Merge-Gate) (pull_request) Canceled after 0s
CI / DMS-Modul Supply-Chain-Scan (govulncheck) (pull_request) Canceled after 0s
CI / Web (dms-browser) (pull_request) Canceled after 0s
CI / Web (pdf-viewer) (pull_request) Canceled after 0s
CI / Web (shl) (pull_request) Canceled after 0s
Core-Schnittstellen-Vertragstests / contract-tests (pull_request) Canceled after 0s
Supply-Chain-Scan (Go) / govulncheck (pull_request) Canceled after 0s
Supply-Chain-Scan (npm) / npm-audit (pull_request) Canceled after 0s
Core-Pflichttest-Gate / pflichttest-gate (pull_request) Canceled after 0s
CI / DMS-Modul (Lint/Build/Test/Coverage/Artefakt) (pull_request) Canceled after 0s
CI / Core-Modul (Build/Vet/Test) (push) Canceled after 0s
CI / DMS Security-Test-Gate (AC5, Merge-Gate) (push) Canceled after 0s
CI / Connect Security-Test-Gate (QA-01 AC4, Merge-Gate) (push) Canceled after 0s
CI / DMS-Modul Supply-Chain-Scan (govulncheck) (push) Canceled after 0s
CI / Web (dms-browser) (push) Canceled after 0s
CI / Web (pdf-viewer) (push) Canceled after 0s
CI / Web (shl) (push) Canceled after 0s
CI / DMS-Modul (Lint/Build/Test/Coverage/Artefakt) (push) Canceled after 0s
CI / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (push) Canceled after 0s
P0-Fund aus Fable5-Review: shl-table/shl-field* hatten keine CSS-Regeln (baseComponentStyles in tokens.ts ergaenzt, ueber Shell.tsx eingebunden). dms-browser und portal hatten ModuleNavShell trotz Registry-Eintrag nicht eingebunden, jetzt nachgezogen. Hartcodierte Hex-Farben in status-page/ tenant-admin/lic-admin/audit-log durch Tokens ersetzt (dangerSubtle neu). ModuleNavShell.resolveHref las window.location.hostname beim ersten Render -> SSR/Client-Mismatch (Hydration-Fehler in React 19). Fix: Href bleibt beim ersten Render unveraendert, Hostname-Tausch erst in useEffect nach dem Mount. Verschachteltes <main> in portal/app/page.tsx entfernt (Shell.tsx rendert bereits eins). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
86 lines
3.4 KiB
TypeScript
86 lines
3.4 KiB
TypeScript
"use client";
|
|
|
|
// Globale Navigation ueber alle Modul-Frontends (SHL-01 Akzeptanzkriterium 1).
|
|
// Statische Registry statt Live-Abruf: die Modul-Frontends dieses Testhosts
|
|
// nutzen unterschiedliche, noch nicht vereinheitlichte Anmeldemodelle
|
|
// (Core-Sitzung vs. feste Demo-Kennung per Umgebungsvariable) -- ein
|
|
// gemeinsamer Live-Abruf ueber /api/visible-modules wuerde fuer die Haelfte
|
|
// der Module eine Core-Anmeldung voraussetzen, die sie bisher nicht haben.
|
|
// Dieselbe Liste wie web/portal/config/modules.json, hier dupliziert, weil
|
|
// jedes Modul sein eigenes, unabhaengig gebautes Next.js-Bundle ist.
|
|
|
|
import { useEffect, useState } from "react";
|
|
import type { ReactNode } from "react";
|
|
import { Shell } from "./Shell";
|
|
|
|
export interface ModuleRegistryEntry {
|
|
key: string;
|
|
label: string;
|
|
href: string;
|
|
}
|
|
|
|
export const MODULE_REGISTRY: ModuleRegistryEntry[] = [
|
|
{ key: "dms", label: "Dokumente", href: "http://localhost:3101" },
|
|
{ key: "dms_upload", label: "Dokumente hochladen", href: "http://localhost:3107" },
|
|
{ key: "mail", label: "Postfach", href: "http://localhost:3102" },
|
|
{ key: "workflow", label: "Aufgaben & Freigaben", href: "http://localhost:3103" },
|
|
{ key: "workflow_cases", label: "Akten & Vorgänge", href: "http://localhost:3108" },
|
|
{ key: "routing_rules", label: "Routing-Regeln", href: "http://localhost:3109" },
|
|
{ key: "ai", label: "KI-Funktionen", href: "http://localhost:3104" },
|
|
{ key: "ai_extraction", label: "Extraktions-Korrektur", href: "http://localhost:3110" },
|
|
{ key: "connect", label: "Externe Anbindungen", href: "http://localhost:3105" },
|
|
{ key: "connect_datev", label: "DATEV-Export", href: "http://localhost:3111" },
|
|
{ key: "tenant_admin", label: "Mandantenverwaltung", href: "http://localhost:3106" },
|
|
{ key: "rbac_admin", label: "Rollen & Rechte", href: "http://localhost:3112" },
|
|
{ key: "kennzahlen_dashboard", label: "Kennzahlen", href: "http://localhost:3113" },
|
|
{ key: "portal", label: "Übersicht", href: "http://localhost:3900" },
|
|
];
|
|
|
|
export interface ModuleNavShellProps {
|
|
activeKey: string;
|
|
children: ReactNode;
|
|
}
|
|
|
|
// Liefert serverseitig/beim ersten Client-Render immer den unveraenderten
|
|
// Original-Href (identisch zu SSR), damit React 19 keine
|
|
// Hydration-Mismatch-Warnung wirft. Der Hostname-Tausch passiert erst in
|
|
// einem useEffect nach dem Mount (resolveHrefClientOnly), analog zum
|
|
// bestehenden themeInit-Pattern.
|
|
function resolveHrefClientOnly(href: string): string {
|
|
try {
|
|
const url = new URL(href);
|
|
if (url.hostname === "localhost" && window.location.hostname !== "localhost") {
|
|
url.hostname = window.location.hostname;
|
|
}
|
|
return url.toString();
|
|
} catch {
|
|
return href;
|
|
}
|
|
}
|
|
|
|
function tenantLabel(): string {
|
|
if (typeof process === "undefined") return "";
|
|
return process.env.NEXT_PUBLIC_TENANT_SLUG ?? process.env.NEXT_PUBLIC_MAIL_TENANT_SLUG ?? "demo";
|
|
}
|
|
|
|
export function ModuleNavShell({ activeKey, children }: ModuleNavShellProps) {
|
|
const [hrefs, setHrefs] = useState<Record<string, string>>({});
|
|
|
|
useEffect(() => {
|
|
setHrefs(Object.fromEntries(MODULE_REGISTRY.map((m) => [m.key, resolveHrefClientOnly(m.href)])));
|
|
}, []);
|
|
|
|
const modules = MODULE_REGISTRY.map((m) => ({
|
|
key: m.key,
|
|
label: m.label,
|
|
href: hrefs[m.key] ?? m.href,
|
|
active: m.key === activeKey,
|
|
}));
|
|
|
|
return (
|
|
<Shell modules={modules} tenantLabel={tenantLabel()}>
|
|
{children}
|
|
</Shell>
|
|
);
|
|
}
|