Commit Graph

7 Commits

Author SHA1 Message Date
3134229a72 Datumsfelder: immer TT.MM.JJJJ, unabhaengig von der Spracheinstellung
All checks were successful
CI / Lint, Typen, Tests, Build (push) Successful in 12m43s
CI / Migrationen auf leerer Datenbank (push) Successful in 11m7s
CI / Ausrollen (push) Successful in 6s
Ein <input type="date"> zeigt das Datum im Format der Spracheinstellung
des Browsers oder des Betriebssystems, auf einem englisch eingestellten
Rechner also als MM/DD/YYYY. Jedes Datumsfeld ist jetzt ein Textfeld mit
TT.MM.JJJJ und einem Knopf fuer den Kalender des Browsers; gemeldet wird
weiterhin JJJJ-MM-TT.

Angenommen werden 1.3.2026, 01.03.2026, Komma oder Schraegstrich als
Trenner (die Zifferntastatur am Telefon), acht Ziffern ohne Trenner und
ein eingefuegtes JJJJ-MM-TT. Ein unvollstaendiges oder unmoegliches Datum
geht nicht hinaus und zeigt beim Verlassen einen Hinweis; ein Datum
ausserhalb der Schranken nennt die Grenze. Der Stichtag im Organigramm
nutzt dieselbe Logik (useDatumEingabe).

Geprueft: lint, tsc, 1029 Tests, Waechter.
2026-11-03 09:04:22 +01:00
f060cde5c1 Aufraeumen: Audit-Filter aus dem Protokoll, Reorganisation entfernt, toter Code
All checks were successful
CI / Lint, Typen, Tests, Build (push) Successful in 12m15s
CI / Migrationen auf leerer Datenbank (push) Successful in 10m39s
CI / Ausrollen (push) Successful in 6s
- Audit-Log: die Auswahl der Aktionen kommt aus dem Protokoll selbst
  (distinct action) statt aus einer festen Liste, die vier tote Aktionen
  fuehrte und rund dreissig aktuelle nicht kannte.
- "Reorganisation" nicht mehr als Ereignistyp in den Berichten (immer leer)
  und nicht im Import; Texte in Organigramm, Nachtlauf (nachtlauf.ps1) und
  Kommentaren ohne Reorg. Import kennt "Uebernahme", nicht mehr
  "Gehaltsanpassung".
- adjust_karenz_return entfernt (Migration): sie setzte nur die Spalte und
  liess die vorgemerkte Rueckkehr stehen; rueckkehr_anpassen ist der Weg.
  lib/acting-manager.ts entfernt (die Berichtslinie rechnet
  om_reporting_lines in der Datenbank).
- Export Mitarbeiter: "Auf wessen Wunsch" mit "Wunsch Dienstnehmer/
  Dienstgeber" wie in der Oberflaeche.

Geprueft: lint, tsc, types:check, Tests, Uebergabe-Waechter
2026-10-22 20:14:25 +02:00
fe2cc8b155 Jahreszahlen in Datumsfeldern haben vier Stellen
Ein <input type="date"> ohne max nimmt Jahreszahlen bis 275760 an. Jedes
Datumsfeld laeuft jetzt ueber DateField:

- min 1900-01-01 und max 2099-12-31 als Vorgabe; mit vierstelligem max
  begrenzt der Browser das Jahressegment schon beim Tippen. Eigene
  Schranken des Aufrufers gehen vor.
- Eine Jahreszahl mit mehr als vier Stellen wird nie gemeldet: das
  Formular behaelt seinen letzten gueltigen Stand, das Feld zeigt
  "Die Jahreszahl hat vier Stellen." Der Tippstand bleibt im Bauteil,
  sonst zeigte das Feld etwas anderes, als das Formular enthaelt.
- 34 Aufrufstellen von TextField type="date" auf DateField umgestellt;
  der Stichtag im Organigramm (ein blankes input) bekommt dieselben
  Schranken.

Geprueft: lint, tsc, types:check, 825 Tests (zwei neue fuer DateField),
Waechter.
2026-10-15 12:36:45 +02:00
muena
86177d648e Uebergabe-Bereinigung: Kommentare, Geheimnisse, CSP, Dokumentation
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.
2026-10-14 09:42:51 +02:00
96c94642ba Datumsfelder lassen sich wieder tippen
All checks were successful
CI / Lint, Typen, Tests, Build (push) Successful in 11m50s
CI / Migrationen auf leerer Datenbank (push) Successful in 10m13s
In den Berichten hing jedes Datumsfeld unmittelbar an der Adresszeile: eine
Aenderung hiess router.push, also neu laden und neu rendern. Ein
<input type="date"> meldet beim Tippen der Jahreszahl aber viermal -- 0002,
0020, 0202, 2026 -- und die ersten drei loesten je eine Navigation aus, die das
Feld auf den Stand aus der Adresse zuruecksetzte. Mitten im Tippen. Mit dem
Kalender ging es, weil der in einem Zug ein fertiges Datum setzt; das war der
Hinweis darauf, wo es klemmt.

DateField haelt den Tippstand jetzt bei sich und meldet nur, was eine Aussage
ist: ein vollstaendiges Datum mit vierstelliger Jahreszahl ab 1000, oder das
Leeren des Feldes. Beim Verlassen wird nachgereicht, was liegengeblieben ist.
Der Stichtag im Organigramm ist ein blankes input und benutzt dieselbe Regel
ueber istMeldbaresDatum -- zwei Fassungen davon liefen hier erfahrungsgemaess
auseinander.

Der Abgleich mit dem Wert von aussen laeuft waehrend des Renderns, nicht in
einem Effekt: der liefe erst nach dem Zeichnen, das Feld zeigte also fuer einen
Bildaufbau den alten Stand -- und die Regel gegen setState im Effekt verbietet
ihn aus genau diesem Grund.

Die Felder in den Panels bleiben, wie sie sind: dort ist der Zustand lokal, es
gibt keine Navigation und damit auch kein Zuruecksetzen.
2026-09-29 21:39:35 +02:00
d9367a8ce4 Form primitives, keyboard-operable comboboxes, dialog focus, route states
Accessibility work on the UI layer, all of it rooted in one structural gap:
there were no form primitives, so every field was hand-assembled and every
field got the same details wrong.

Form primitives
- components/ui/Field.tsx (Field/TextField/SelectField/TextareaField) and
  Button.tsx. Field generates the control id with useId and derives htmlFor
  from it, which is what makes the association impossible to omit rather
  than merely conventional.
- 92 labels existed, 4 used htmlFor, and no input carried an id at all: a
  screen reader announced an unnamed edit box and clicking a label focused
  nothing. Now every label resolves to its control (0 unassociated), and the
  input class chain that appeared verbatim 85 times appears zero times.
- Field also takes a render prop, so Lookup, CountryPicker and Picklist get
  the same wiring instead of a second, partial solution.
- SearchInput replaces three hand-rolled copies of the icon-in-a-box search
  whose input had only a placeholder — not a label — and killed its own
  focus ring with outline-none and nothing in its place.
- Toggle groups (workdays, reorg change type) became fieldsets with
  aria-pressed; colour alone was carrying the selected state.

Comboboxes
- Lookup and CountryPicker were text inputs with a div of clickable buttons
  underneath: typeable, but no keyboard path to a result and nothing telling
  a screen reader a list had appeared. Both now carry role=combobox,
  aria-expanded/controls/activedescendant and listbox semantics, with arrow
  keys, Enter and Escape. Escape stops propagation, or it would close the
  surrounding dialog along with the dropdown.

Dialogs
- useDialogFocus centralises what Modal and SlideOver each owed the
  keyboard and neither provided beyond Escape: focus into the dialog on
  open, Tab and Shift+Tab cycling within it, focus restored to the trigger
  on close.
- SlideOver stays mounted for its transition, and aria-hidden does not
  remove anything from the tab order — so every closed panel was leaving
  invisible tab stops at the end of the page. `inert` fixes that.

Route states
- loading.tsx, error.tsx, not-found.tsx and global-error.tsx. Every page in
  the (app) group is server-rendered per request, so without loading.tsx a
  navigation showed nothing at all until the server answered, and a render
  error dropped the user on Next's own screen with no way back.

Tests
- 22 component tests (vitest jsdom project). Two of them found limits of the
  environment rather than of the code: jsdom implements neither `inert` nor
  scrollIntoView, so the inert test asserts the attribute and the missing
  scrollIntoView — which was taking the whole render down from inside an
  effect — is stubbed in the setup file.
2026-07-25 13:11:09 +02:00
79f0e19bf8 Org assignment history, mobile support, and a correctness pass
Data model
- employee_assignments records org placement over time (valid_from/valid_to),
  written by a trigger on `employees` rather than inside each RPC: ~70
  `update employees` statements spread over fifteen migrations mean per-call
  bookkeeping would miss paths today and again with every future RPC. A
  partial unique index enforces the one-open-interval invariant the trigger
  relies on when closing the current row.
- The Organigramm gains a Stichtag (default today). Membership comes from
  entry/exit/karenz, past placement from the new history, future placement
  projected from pending_org_changes. Placements predating the migration are
  backfilled with today's values and flagged as such in the UI, since
  employee_history only ever stored free text and cannot be reconstructed.

Correctness
- Reports and exports silently truncated at PostgREST's 1000-row cap
  (db.max_rows); employee_history is already past it at ~800 staff. Every
  whole-table read now pages explicitly.
- XLSX date cells were a day early: ExcelJS converts a Date to an Excel
  serial straight off getTime(), so a Date built at local midnight lands on
  the previous day's serial in any positive-offset zone.
- Date handling is pinned to Europe/Vienna throughout, and date-only strings
  are formatted without a Date round-trip. The dashboard's YTD window was
  built by round-tripping a local Date through toISOString(), which shifted
  it a day early and dropped 31 December entirely.
- Export routes parsed measure/group/split/eventType with unchecked `as`
  casts, so an unknown value reached column headers as `undefined` and the
  Content-Disposition filename. Parsed against the label maps now, with the
  filename slugged as a backstop.
- toXlsx keyed columns by header text, silently dropping the second of any
  two columns sharing a name — split columns take their header from data.
- The org chart tree walks had no cycle guard; nothing in the schema forbids
  a manager_id cycle, and one would hang the tab rather than misreport.
- The login page reflected ?error= verbatim, letting anyone put arbitrary
  text on the real sign-in screen; messages are looked up by code now.
- React Flow needs elementsSelectable on, or it sets pointer-events:none on
  the whole node and the expand control stops responding.

UI
- Mobile: the shell was unusable below lg — a fixed 236px margin pushed
  content off-screen with no mobile navigation at all. The sidebar is now a
  drawer, dvh replaces vh, safe-area insets are honoured, inputs are 16px so
  iOS stops zooming on focus, and form grids stack.
- Org chart nodes redesigned: per-kind accent stripes and icons, vacant
  roles called out, expand control moved to the bottom edge carrying the
  child count.
- Pagination is windowed; it previously rendered one link per page (54 for
  the employee list, unbounded for the audit log).
- Positions page reduced to open positions with a single "Besetzen" action.
- The employee Organisation tab links into the org chart focused on that
  person, reusing the chart's existing search-match highlighting.

Also included, uncommitted until now
- Dependants, HR notes, academic titles, split address fields, position
  validity and role/employment fields, with their migrations and UI.
- Docker/compose deployment setup, data-model and security-review docs.
2026-07-24 23:38:10 +02:00