Repository navigation
fix: edit and resubmit returned employee requests (#42) - #46
patrickschiller wants to merge 3 commits into
Conversation
Reopen returned drafts with their values and revision reason. Add owner-only versioned editing/resubmission, shared validation, balance/overlap self-exclusion, transactional concurrency guards, employee names, synchronized API contracts and regression/manual acceptance coverage. Co-authored-by: patrickschiller <39913537+patrickschiller@users.noreply.github.com> Signed-off-by: Patrick Schiller <39913537+patrickschiller@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 230dbb0e0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| <Dialog open onOpenChange={(open) => !open && onClose()}> | ||
| <DialogContent className="max-h-[90dvh] max-w-lg overflow-y-auto"> | ||
| {request.data && !request.isFetching ? ( |
There was a problem hiding this comment.
Preserve unsaved edits during background request refetches
If the browser reconnects to the network while an employee is editing a returned request, React Query's default reconnect refetch applies because this query has staleTime: 0. Checking !request.isFetching here unmounts NewRequestForm during that background fetch, destroying all locally edited dates, reason, substitute and half-day selections. When the fetch finishes, the form initializes from the server values again—even if updatedAt did not change—silently losing the employee's work. Keep the initialized form mounted during background fetches rather than treating every fetch as an initial load.
Useful? React with 👍 / 👎.
Keep persisted timestamps unchanged until their time field is edited. Resolve wall-clock validation and payloads to identical instants, require explicit ambiguous-time choices, reject clock-change gaps, and cover seconds, both fold occurrences and reason-only save/resubmit cycles. Co-authored-by: patrickschiller <39913537+patrickschiller@users.noreply.github.com> Signed-off-by: Patrick Schiller <39913537+patrickschiller@users.noreply.github.com>
Keep the English DST selection regression independent of jsdom persisted locale on Node 20. Verify all 208 web tests with Node 20.20.2 and document the CI follow-up. Co-authored-by: patrickschiller <39913537+patrickschiller@users.noreply.github.com> Signed-off-by: Patrick Schiller <39913537+patrickschiller@users.noreply.github.com>
Zusammenfassung
Closes #42
PATCH /api/requests/:idundPOST /api/requests/:id/resubmit: nurworkflowState=Draft, Bearer-Identität, unveränderliche ID/Typ/Eigentümer, erforderlichesexpectedUpdatedAtgegen veraltete Tabs.status=Submitted).P2-Nachkorrektur aus der unabhängigen Abnahme
RequestsPage.tsxaus230dbb0fehl und bestehen mit dem Fix.Verifikation
Synthetische, isolierte PostgreSQL-16-Testdatenbank; Node v26.12.1, pnpm 9.15.9:
pnpm verify:apiundgit diff --checkerfolgreich.Ein kombinierter paralleler Build-/Typecheck-Zwischenlauf zeigte einen vorhandenen Output-Verzeichniskonflikt (Vite leert Web-
dist, TS6305). Der anschließend erzwungene separate Web-Typecheck und der separate Vier-Projekt-Typecheck bestanden. Keine Konfigurationsänderung dafür.Lokaler Nachlauf der P2-Korrektur
TZ=UTC pnpm nx test web --run src/routes/RequestsPage.spec.tsx src/lib/local-date-time.spec.ts src/app/i18n.spec.tsx: 29/29 bestanden.TZ=UTC pnpm nx test web --run: 208/208 Tests, 34 Dateien bestanden.pnpm nx run-many -t typecheck,lint -p web: erfolgreich, 0 Fehler, 2 bestehende Warnungen.pnpm nx build web: erfolgreich, einschließlich PWA.git diff --check: erfolgreich.TZ=UTC pnpm nx test web --run --skip-nx-cache, 208/208 Tests bestanden. Der erste CI-Nachlauf deckte eine gespeicherte deutsche Sprachpräferenz in der neuen EN-Testfixture auf (207/208); Storage danach wie in den bestehenden i18n-Tests isoliert. Kein Anwendungscode musste dafür geändert werden.Manueller Nachtest
Deutsche Anleitung mit isoliertem Docker-Setup, synthetischen Rollen, Schritten/Erwartungen und Negativtests.
UI-Regressionsprüfungen wurden mit React Testing Library ausgeführt. Der dokumentierte manuelle Docker-/Browser-Durchlauf wurde nicht als durchgeführt gewertet.
Umfang
Nur Paket #42. Keine Folgepakete #41/#43/#45/#44, kein Release, kein Tag, kein Versionsbump, kein Merge, kein Deployment und kein Release-Workflow.
Ursprüngliche GitHub-Prüfungen vor der P2-Nachkorrektur vollständig grün: CI-Lauf mit
build-test-lint, vollständigerapi-e2e-Suite,database-upgradeundterminal-pin-browser; zusätzlich DCO. Alle fünf PR-Checks erfolgreich.Finaler Head nach P2-Nachkorrektur
Finale CI auf
4ff247bc18adfc0b245d8dbb044f7968cf2a4678vollständig grün:build-test-lint,api-e2e,database-upgrade,terminal-pin-browsererfolgreich.pnpm verify:apierfolgreich.