Repository navigation
fix(settings): track order numbering in isDirty - #1490
Conversation
Include JSON.stringify(orderNumberForm) !== JSON.stringify(savedOrderNumberForm) in the Settings page isDirty check so editing only an Order & Invoice Numbering field displays the floating Save/Discard bar. Fixes #1484
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoTrack order and invoice numbering edits as unsaved settings
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt |
Intent
Fix F-05 (
https://github.com/FreeOpenSourcePOS/FloCafe/issues/1484): Infrontend/src/app/(dashboard)/settings/page.tsx:3893-3903,isDirtyomitsJSON.stringify(orderNumberForm) !== JSON.stringify(savedOrderNumberForm). When an admin changes only an Order & Invoice Numbering field in Settings > Store (GeneralSettingsTab), no Save/Discard bar appears and the edit is lost on navigation. IncludeorderNumberFormvssavedOrderNumberForminisDirtyand verify with a regression test.Fixes #1484
What Changed
JSON.stringify(orderNumberForm) !== JSON.stringify(savedOrderNumberForm)in theSettingsPageisDirtycalculation infrontend/src/app/(dashboard)/settings/page.tsxso modifying only Order & Invoice Numbering fields surfaces the Save/Discard bar and tracks unsaved state.frontend/e2e/settings-request-budget.spec.tsverifying that editing only order or invoice numbering fields shows the Save Changes and Discard buttons and cleanly saves or discards the edits.Risk Assessment
✅ Low: Minimal, well-bounded fix that includes orderNumberForm vs savedOrderNumberForm in SettingsPage isDirty calculation with an end-to-end regression test covering edit, discard, and save flows.
Testing
Built the backend and static frontend, ran the new Playwright regression test (
Editing only order numbering marks Settings dirty and saves or discards cleanly), the order-numbering hydration test,npm run test:order-numbering-settings, andqa-settings-store-locale.spec.ts, and drove four live scenarios in Chromium against the running FloCafe E2E server with visual screenshot and API state evidence captured for dirty-bar appearance, blocked navigation on unsaved edits, Discard recovery, and Save Changes persistence across page reloads; all checks passed.Evidence: Live verification summary JSON (API and UI state across all scenarios)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
cd frontend && npx playwright test e2e/settings-request-budget.spec.ts -g "Editing only order numbering marks Settings dirty and saves or discards cleanly" --config=playwright.config.ts --project=chromiumcd frontend && npx playwright test e2e/settings-request-budget.spec.ts -g "Save All preserves order numbering edits during hydration" --config=playwright.config.ts --project=chromiumnpm run test:order-numbering-settingscd frontend && npx playwright test e2e/qa-settings-store-locale.spec.ts --config=playwright.config.ts --project=chromiumLive Playwright browser verification against tests/e2e-server.cjs driving Order & Invoice Numbering dirty state, navigation guard, Discard, Save Changes, and reload persistence with screenshot capture✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.