[260] Typ-Feld „Im Grundriss“ im Fenster-/Türeditor (Objekt), gemeinsame Optionen mit den Ressourcen

This commit is contained in:
Claude committed 2026-11-15 02:12:01 +00:00
1 parent eaf5213316
commit ced306e5c3
7 files changed
+102 -20

No files matched your search

@@ -24,6 +24,20 @@ describe("Objekteinstellungen: Öffnung [195b]", () => {
expect(html).not.toContain("imp-overlay");
});
it("[260] Typ-Feld „Im Grundriss“ im Editor: Fenster und Tür, Wert aus dem Typ", () => {
const p = buildComplexSampleProject();
for (const kind of ["window", "door"] as const) {
const o = p.openings!.find((x) => x.kind === kind && x.typeId && !x.hostRoofId && !x.hostCeilingId)!;
const key = kind === "window" ? "windowTypes" : "doorTypes";
getState().loadProject({ ...p, [key]: p[key]!.map((ty) => (ty.id === o.typeId ? { ...ty, planMode: "geschnitten" } : ty)) });
setState({ selection: { ...EMPTY_SELECTION, openings: [o.id] } });
const html = render();
const m = /<select[^>]*data-testid="oed-planMode"[^>]*>.*?<\/select>/s.exec(html);
expect(m, kind).not.toBeNull();
expect(m![0]).toMatch(/<option value="geschnitten" selected/);
}
});
it("zwei Öffnungen mit abweichender Breite: „gemischt“ am Breitenfeld", () => {
const p = buildComplexSampleProject();
const [a, b] = p.openings!.filter((x) => !x.hostRoofId && !x.hostCeilingId);
+28 -6
View File
@@ -27,6 +27,7 @@ import type {
import { useStore } from "../../state/appStore";
import type { usePanelHost } from "../host";
import { getDoorType, getWindowType, sashesOfWindowType, glazingPanesOf } from "../../model/types";
import { planModeFromValue, planModeOptions } from "../../ui/planModeOptions";
import { CorePreview, DoorFramePanel, FrameDetailPanel, RebatePanel, RevealPanel, ScopeSwitch } from "../../ui/OpeningDetailPanels";
/** P0-Kategorien der Sidebar, je nach Öffnungsart. */
@@ -304,17 +305,20 @@ function SelField<V extends string>({
value,
options,
onChange,
testId,
}: {
label: string;
value: V;
options: { value: V; label: string }[];
onChange: (v: V) => void;
testId?: string;
}) {
return (
<label className="oed-field">
<span className="oed-flabel">{label}</span>
<select
className="oed-select"
data-testid={testId}
value={value}
onChange={(e) => onChange(e.target.value as V)}
>
@@ -361,12 +365,22 @@ function BasisPanel({
}) {
if (isDoor && dt) {
return (
<SelField
label={t("oed.f.kind")}
value={dt.kind}
options={DOOR_KIND_OPTS()}
onChange={(v) => patchDt({ kind: v })}
/>
<>
<SelField
label={t("oed.f.kind")}
value={dt.kind}
options={DOOR_KIND_OPTS()}
onChange={(v) => patchDt({ kind: v })}
/>
{/* [260] Darstellung im Grundriss (Typ; leer = Modelldarstellung), wie in den Ressourcen. */}
<SelField
label={t("objinfo.opening.planMode")}
value={dt.planMode ?? ""}
options={planModeOptions()}
onChange={(v) => patchDt({ planMode: planModeFromValue(v) })}
testId="oed-planMode"
/>
</>
);
}
if (wt) {
@@ -378,6 +392,14 @@ function BasisPanel({
options={OPENING_KIND_OPTS()}
onChange={(v) => patchWt({ kind: v })}
/>
{/* [260] Darstellung im Grundriss (Typ; leer = Modelldarstellung), wie in den Ressourcen. */}
<SelField
label={t("objinfo.opening.planMode")}
value={wt.planMode ?? ""}
options={planModeOptions()}
onChange={(v) => patchWt({ planMode: planModeFromValue(v) })}
testId="oed-planMode"
/>
<SelField
label={t("oed.f.glazing")}
value={String(glazingPanesOf(wt)) as "1" | "2" | "3"}