diff --git a/components/audit/AuditDetail.tsx b/components/audit/AuditDetail.tsx index 815d628..9a66b54 100644 --- a/components/audit/AuditDetail.tsx +++ b/components/audit/AuditDetail.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { useState } from "react"; +import { AenderungsTabelle } from "@/components/ui/AenderungsTabelle"; import { SlideOver } from "@/components/ui/SlideOver"; import { actionBadgeStyle } from "@/lib/colors"; import type { AuditChange } from "@/lib/supabase/types"; @@ -33,14 +34,6 @@ const zeitFormat = new Intl.DateTimeFormat("de-AT", { timeZone: "Europe/Vienna", }); -/** Leerer Wert heisst „war nicht gesetzt“ — und das ist eine Aussage. */ -function Wert({ text, art }: { text: string | null; art: "vorher" | "nachher" }) { - if (text === null || text === "") { - return leer; - } - return {text}; -} - export function AuditDetail({ eintrag }: { eintrag: AuditEintrag }) { const [offen, setOffen] = useState(false); const anzahl = eintrag.changes?.length ?? 0; @@ -101,29 +94,8 @@ export function AuditDetail({ eintrag }: { eintrag: AuditEintrag }) {

Geänderte Felder

{anzahl > 0 ? ( -
- - - - - - - - - - {eintrag.changes!.map((c, i) => ( - - - - - - ))} - -
FeldVorherNachher
{c.feld} - - - -
+
+
) : ( // Kein Aufzählungszeichen für „nichts da“: der Grund ist wichtig, diff --git a/components/employees/tabs/HistorieTab.tsx b/components/employees/tabs/HistorieTab.tsx index 0ec4707..cb3b241 100644 --- a/components/employees/tabs/HistorieTab.tsx +++ b/components/employees/tabs/HistorieTab.tsx @@ -1,9 +1,22 @@ +import { AenderungsTabelle } from "@/components/ui/AenderungsTabelle"; import { actionBadgeStyle } from "@/lib/colors"; import { fmtDate, todayIso } from "@/lib/format"; import type { Database } from "@/lib/supabase/types"; type HistoryRow = Database["public"]["Tables"]["employee_history"]["Row"]; +// Die Geschichte einer Person — und zwar aufklappbar bis auf die Werte. +// +// Vorher stand hier nur „Geänderte Felder: Adresse, Ort". Damit liess sich +// zwar sehen, *dass* jemand die Anschrift angefasst hat, aber nicht, was +// vorher dort stand. Die alte Adresse lag allein im Protokoll, und das ist +// eine andere Seite, nach Zeitpunkt sortiert statt nach Person — man hätte +// also erst wissen müssen, wonach man sucht. +// +// Aufgeklappt wird mit
, nicht mit einem Zustand im Browser: die +// Werte stehen dann schon in der Seite, sind durchsuchbar (Strg+F) und im +// Ausdruck sichtbar, und es braucht kein Skript dafür. + export function HistorieTab({ history }: { history: HistoryRow[] }) { const today = todayIso(); @@ -15,6 +28,7 @@ export function HistorieTab({ history }: { history: HistoryRow[] }) {