Files
nexarch/web/shl/components/ModuleNavShell.tsx
T
patrickandClaude Sonnet 5 3a7d2d4696
CI / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (pull_request) Canceled after 0s
Core-Pflichttest-Gate / pflichttest-gate (pull_request) Canceled after 0s
RBAC-Rollenhierarchie-Pflichtgate / rbac-policy-invariant (pull_request) Canceled after 0s
Supply-Chain-Scan (npm) / npm-audit (pull_request) Canceled after 0s
CI / Core-Modul (Build/Vet/Test) (pull_request) Canceled after 0s
CI / DMS Security-Test-Gate (AC5, Merge-Gate) (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
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 (Lint/Build/Test/Coverage/Artefakt) (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 / Web-Barrierefreiheitspruefung (axe, Tastatur, Reflow, Textabstaende) (push) Canceled after 0s
ANA-02: Kennzahlen-Dashboard ins Portal einbinden, globale Navigation nachziehen
ModuleNavShell/MODULE_REGISTRY existierte bisher nur live auf Host 204,
nie committet - alle 12 Module (ai-extraction-review, ai-summaries,
connect-status, datev-export, dms-upload, mail-search, rbac-admin,
routing-rules, tenant-admin, workflow-approvals, workflow-cases) jetzt
mit ModuleNavShell verdrahtet, inklusive Export-Fix in web/shl/index.ts.

Kennzahlen-Dashboard (ANA-02) neu in Registry/Navigation aufgenommen,
RBAC-Recht kennzahlen.read per Migration an tenant_admin vergeben
(analog 0018_module_policy_rules).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-19 00:11:57 +02:00

74 lines
2.8 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 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;
}
function resolveHref(href: string): string {
try {
const url = new URL(href);
if (url.hostname === "localhost" && typeof window !== "undefined" && 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 modules = MODULE_REGISTRY.map((m) => ({
key: m.key,
label: m.label,
href: resolveHref(m.href),
active: m.key === activeKey,
}));
return (
<Shell modules={modules} tenantLabel={tenantLabel()}>
{children}
</Shell>
);
}