Kommentare beschreiben den heutigen Stand und warum er so ist, nicht mehr die Entwicklungsgeschichte: keine Datumsangaben zu Ereignissen, keine Vorfaelle an Testpersonen, keine Lieferantensicht, keine internen Namen oder Plattformen. In Migrationen nur Kommentare ausserhalb von Dollar-Quoting; Kommentare in Funktionskoerpern nur dort, wo ihr Text in keiner anderen Migration als Anker vorkommt. - Andreis Anpassungen aus windows-uebergabe nach master uebernommen. - LOLYO-Startpasswort kommt aus LOLYO_STARTPASSWORT statt aus dem Code; ohne Wert lehnt der Export mit Hinweis ab. - Beispiel- und erzeugte E-Mail-Adressen ohne Kundendomain. - Content-Security-Policy wird durchgesetzt; form-action fest mit login.microsoftonline.com, weil das Paket ohne Umgebungswerte gebaut wird. Geprueft im Browser: alle Seiten ohne Verstoss, Weiterleitung zu Microsoft geht durch. - migrate.mjs: einmalige Uebernahme der alten Buchfuehrung entfernt (seit 20260907100000 ohne Wirkung). - freischalten.ps1 vergibt und entzieht den HR-Zugang (-Entziehen) und protokolliert beides im Audit-Log. - docs/security-review.md -> docs/sicherheitskonzept.md: beschreibt den heutigen Stand ohne offene Punkte. README, entra-sso.md und deploy/windows/README.md ohne Widersprueche (Leserolle der IT, Freischaltung, Konto des Nachtlaufs), Abnahme-Checkliste statt "noch offen". Geprueft: lint, tsc, types:check, 823 Unit-Tests, Waechter (412 Dateien, keine Funde), alle 114 Migrationen auf leerem PostgreSQL 18 (zweiter Lauf leer), rauchtest.sql und vertragsangaben.sql bestanden.
71 lines
2.4 KiB
TypeScript
71 lines
2.4 KiB
TypeScript
"use client";
|
|
|
|
import { Printer } from "lucide-react";
|
|
import Link from "next/link";
|
|
import { SegmentedControl } from "@/components/ui/SegmentedControl";
|
|
import { useGemerktesWort } from "./ansicht-merken";
|
|
import { AsOfPicker } from "./AsOfPicker";
|
|
import { EmployeeTree } from "./EmployeeTree";
|
|
import { PositionTree } from "./PositionTree";
|
|
import type { OrgEmployee, OrgUnitNode, OrgVacancy } from "./types";
|
|
|
|
type View = "ma" | "pos";
|
|
|
|
const VIEWS: readonly View[] = ["ma", "pos"] as const;
|
|
|
|
type OrgChartClientProps = {
|
|
employees: OrgEmployee[];
|
|
units: OrgUnitNode[];
|
|
vacancies: OrgVacancy[];
|
|
asOf: string;
|
|
today: string;
|
|
projectedCount: number;
|
|
historyStartsAt: string | null;
|
|
/** Arrived via "Im Organigramm anzeigen" — unfold and centre this person. */
|
|
focusId: string | null;
|
|
};
|
|
|
|
export function OrgChartClient({
|
|
employees,
|
|
units,
|
|
vacancies,
|
|
asOf,
|
|
today,
|
|
projectedCount,
|
|
historyStartsAt,
|
|
focusId,
|
|
}: OrgChartClientProps) {
|
|
// Gemerkt, nicht neu gesetzt: wer aus der Organisationssicht eine Person
|
|
// öffnet, landete sonst beim Zurückgehen wieder auf der Mitarbeitersicht.
|
|
const [view, setView] = useGemerktesWort<View>("alpenwerk.orgchart.sicht", "ma", VIEWS);
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4">
|
|
<div className="flex flex-wrap items-center justify-between gap-3">
|
|
<SegmentedControl<View>
|
|
value={view}
|
|
onChange={setView}
|
|
options={[
|
|
{ value: "ma", label: "Mitarbeiter" },
|
|
{ value: "pos", label: "Organisation" },
|
|
]}
|
|
/>
|
|
{/* Der Stichtag wandert mit: wer eine vergangene Struktur ansieht,
|
|
druckt sie auch. */}
|
|
<Link
|
|
href={asOf === today ? "/orgchart/print" : `/orgchart/print?asOf=${asOf}`}
|
|
className="inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-semibold text-ink hover:bg-brand-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-500"
|
|
>
|
|
<Printer className="h-4 w-4" />
|
|
Als PDF
|
|
</Link>
|
|
</div>
|
|
|
|
<AsOfPicker asOf={asOf} today={today} projectedCount={projectedCount} historyStartsAt={historyStartsAt} />
|
|
|
|
{view === "ma" && <EmployeeTree employees={employees} focusId={focusId} />}
|
|
{view === "pos" && <PositionTree employees={employees} units={units} vacancies={vacancies} />}
|
|
</div>
|
|
);
|
|
}
|