Schriftzug "Testsystem" ueber TESTSYSTEM in der Konfiguration
Mit TESTSYSTEM=1 haengt oben mittig auf jeder Seite, auch auf der Anmeldeseite, ein Schriftzug "Testsystem", und der Titel im Browser-Tab beginnt mit "[Testsystem]". Ohne den Eintrag erscheint nichts; gelesen wird zur Laufzeit, dasselbe Paket laeuft in Test und Produktion. Der Schriftzug ist klickdurchlaessig und erscheint nicht auf Ausdrucken. Die Checkliste setzt ihren Titel absolut, er dient beim Drucken als Dateiname. Neue Variable in .env.example, app.env.vorlage, README und DEPLOYMENT.md. Kein Geheimnis, daher nicht in der Tabelle im Sicherheitskonzept. Geprueft: lint, tsc, types:check, npm test (neuer Test testsystem), waechter.
This commit is contained in:
@@ -30,8 +30,10 @@ export async function generateMetadata({ params, searchParams }: Props) {
|
||||
const [{ id }, sp] = await Promise.all([params, searchParams]);
|
||||
const art = parseArt(sp.art);
|
||||
const daten = await withUser(await currentUserId(), (tx) => loadChecklistPrint(tx, id, art));
|
||||
if (!daten) return { title: artTitel(art) };
|
||||
return { title: checklistDateiname(art, daten.kopf, todayIso()) };
|
||||
// Absolut: der Titel ist der Dateiname, eine Vorlage des Layouts gehört
|
||||
// nicht hinein.
|
||||
if (!daten) return { title: { absolute: artTitel(art) } };
|
||||
return { title: { absolute: checklistDateiname(art, daten.kopf, todayIso()) } };
|
||||
}
|
||||
|
||||
export default async function ChecklistPrintPage({ params, searchParams }: Props) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import { Barlow } from "next/font/google";
|
||||
import { TestsystemSchriftzug } from "@/components/shell/TestsystemSchriftzug";
|
||||
import { ToastProvider } from "@/components/ui/Toast";
|
||||
import { istTestsystem, TESTSYSTEM_SCHRIFTZUG } from "@/lib/testsystem";
|
||||
import "./globals.css";
|
||||
|
||||
// ═══ Die Schrift ═══
|
||||
@@ -31,7 +33,7 @@ const din = Barlow({
|
||||
weight: ["400", "600", "700", "800"],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
const METADATA: Metadata = {
|
||||
title: "Alpenwerk HR",
|
||||
description: "HR-Stammdaten- und Organisationsmanagement für Alpenwerk Industrie GmbH",
|
||||
// Added to the home screen on iOS this opens without Safari's chrome and
|
||||
@@ -44,6 +46,15 @@ export const metadata: Metadata = {
|
||||
manifest: "/manifest.webmanifest",
|
||||
};
|
||||
|
||||
// Als Funktion, damit TESTSYSTEM bei der Anfrage gelesen wird und nicht beim
|
||||
// Bauen. Die Vorlage setzt den Schriftzug auch vor die Titel der Unterseiten;
|
||||
// Seiten, deren Titel als Dateiname beim Drucken dient, setzen ihn absolut.
|
||||
export function generateMetadata(): Metadata {
|
||||
if (!istTestsystem()) return METADATA;
|
||||
const vorsatz = `[${TESTSYSTEM_SCHRIFTZUG}]`;
|
||||
return { ...METADATA, title: { default: `${vorsatz} Alpenwerk HR`, template: `${vorsatz} %s` } };
|
||||
}
|
||||
|
||||
export const viewport: Viewport = {
|
||||
width: "device-width",
|
||||
initialScale: 1,
|
||||
@@ -63,6 +74,7 @@ export default function RootLayout({
|
||||
return (
|
||||
<html lang="de-AT" className={`${din.variable} h-full antialiased`}>
|
||||
<body className="flex min-h-dvh flex-col font-sans">
|
||||
{istTestsystem() && <TestsystemSchriftzug />}
|
||||
<ToastProvider>{children}</ToastProvider>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user