diff --git a/components/employees/NotfallkontaktModal.tsx b/components/employees/NotfallkontaktModal.tsx index 346d257..f536a19 100644 --- a/components/employees/NotfallkontaktModal.tsx +++ b/components/employees/NotfallkontaktModal.tsx @@ -4,10 +4,11 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { changeEmployeeData } from "@/actions/employees"; import { Button } from "@/components/ui/Button"; -import { TextField } from "@/components/ui/Field"; +import { SelectField, TextField } from "@/components/ui/Field"; import { Modal } from "@/components/ui/Modal"; import { useToast } from "@/components/ui/Toast"; import { todayIso } from "@/lib/format"; +import { EMERGENCY_RELATIONS } from "@/lib/types"; // Der Notfallkontakt, ohne den Umweg über „Daten ändern". // @@ -96,11 +97,15 @@ export function NotfallkontaktModal({ - ({ value: r, label: r }))} /> diff --git a/components/orgchart/PositionTree.tsx b/components/orgchart/PositionTree.tsx index 528bf8f..15c8745 100644 --- a/components/orgchart/PositionTree.tsx +++ b/components/orgchart/PositionTree.tsx @@ -204,10 +204,17 @@ export function buildUnitTree(units: OrgUnitNode[], employees: OrgEmployee[], va id: key, kind: "role", label: `${unit.org_number} · ${unit.name}`, + // Die Gesellschaft bleibt ohne Vermerk: sie wird nicht geführt, sondern + // ist das Ganze. „Leitung vakant" las sich dort wie eine offene Stelle, + // die jemand besetzen müsste, und färbte obendrein den obersten Knoten + // als Vakanz ein. Überall sonst ist der Vermerk genau das und gehört + // hin — wie im Druck (PrintChart). sublabel: chief ? `Leitung: ${fmtName(chief.first_name, chief.last_name)}${chief.absent ? " (abwesend)" : ""}` - : "Leitung vakant", - vacant: !chief, + : unit.unit_type === "Gesellschaft" + ? undefined + : "Leitung vakant", + vacant: !chief && unit.unit_type !== "Gesellschaft", children: [...subUnits, ...titleGroups, ...vacancyNodes], }; }