From 18a3a636dd088d622cdc6ca94cf6b151d1bdaf8e Mon Sep 17 00:00:00 2001 From: Fidelis Huber Date: Fri, 11 Sep 2026 08:29:44 +0200 Subject: [PATCH] Monteur-Dropdown + VenDoc-Spaltennamen im CSV-Export angepasst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Monteur ist jetzt ein Dropdown (Michael/Daniel/Dietmar/Fidelis) mit freiem Textfeld für "Andere". CSV-Export nutzt jetzt VenDocs eigene Spaltennamen (Position/EH/Positionstext/Aufmaß), ermittelt aus einem echten VenDoc- Aufmaßblatt-Export des Nutzers; Art.-Nr. wird wie dort im Positionstext eingebettet, da VenDoc keine eigene Artikelnummer-Spalte führt. Co-Authored-By: Claude Sonnet 5 --- client/src/components/MonteurField.tsx | 42 ++++++++++++++++++++++++++ client/src/pages/Dashboard.tsx | 5 ++- client/src/pages/ProjektDetail.tsx | 26 ++++++++-------- 3 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 client/src/components/MonteurField.tsx diff --git a/client/src/components/MonteurField.tsx b/client/src/components/MonteurField.tsx new file mode 100644 index 0000000..0dbfd2b --- /dev/null +++ b/client/src/components/MonteurField.tsx @@ -0,0 +1,42 @@ +import { useState } from 'react'; + +export const MONTEURE = ['Michael', 'Daniel', 'Dietmar', 'Fidelis']; + +interface Props { + value: string; + onChange: (v: string) => void; + onCommit?: (v: string) => void; +} + +export default function MonteurField({ value, onChange, onCommit }: Props) { + const [customMode, setCustomMode] = useState(() => value !== '' && !MONTEURE.includes(value)); + + function handleSelect(v: string) { + if (v === '__custom__') { + setCustomMode(true); + return; + } + setCustomMode(false); + onChange(v); + onCommit?.(v); + } + + return ( + + ); +} diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 7d5756e..e1c7c89 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { api } from '../lib/api'; import type { Projekt, ProjektStatus } from '../lib/types'; +import MonteurField from '../components/MonteurField'; function dd(s: string | null) { if (!s) return '–'; @@ -101,9 +102,7 @@ export default function Dashboard() { - + setForm({ ...form, monteur: v })} />