feat(sla): show schedule/holiday JSON validation errors inline #404

Merged
longjacksonle merged 2 commits from feat/PMS-604-sla-json-inline-errors into main 2026-07-01 22:51:14 +02:00

What

PMS-604 frontend (AC3). Surface SLA schedule / holiday JSON validation errors inline on the relevant field instead of in the modal banner.

Pairs with the mokosh-server PR that adds strict write-time validation (rejecting malformed schedule/holiday JSON with a 422 keyed onto the schedule / holidays field).

How

In both the Business Hours and Holiday Calendar form modals:

  • Add a field-scoped error signal (schedule_err / holidays_err) wired into the JSON Textarea's error prop (standard form pattern).
  • Route the existing client-side JSON parse error to that signal instead of the banner.
  • On a save failure, if the server returned a field-keyed message (err.field_message("schedule") / ("holidays")), show it inline; otherwise keep it in the banner for name/timezone/generic errors.

Test

just pre-commit (fmt --check + cargo check --target wasm32-unknown-unknown + unit tests) passes.

Part of PMS-604.

## What PMS-604 frontend (AC3). Surface SLA schedule / holiday JSON validation errors inline on the relevant field instead of in the modal banner. Pairs with the mokosh-server PR that adds strict write-time validation (rejecting malformed schedule/holiday JSON with a 422 keyed onto the `schedule` / `holidays` field). ## How In both the Business Hours and Holiday Calendar form modals: - Add a field-scoped error signal (`schedule_err` / `holidays_err`) wired into the JSON Textarea's `error` prop (standard form pattern). - Route the existing client-side JSON parse error to that signal instead of the banner. - On a save failure, if the server returned a field-keyed message (`err.field_message("schedule")` / `("holidays")`), show it inline; otherwise keep it in the banner for name/timezone/generic errors. ## Test `just pre-commit` (fmt --check + `cargo check --target wasm32-unknown-unknown` + unit tests) passes. Part of PMS-604.
PMS-604 frontend. The business-hours modal parsed the schedule blob client-side and dumped any error into the modal banner, and a server-side malformed-schedule 422 also landed in the banner. Route both to a `schedule_err` signal wired into the Schedule Textarea's `error` prop instead: bad client-side JSON and the server's `schedule`-keyed 422 now render inline on the field (standard form pattern), leaving the banner for name/timezone/generic failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(sla): show holiday JSON validation errors inline on the field
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m20s
Create release / Create release from merged PR (pull_request) Has been skipped
177d192a2c
PMS-604 frontend. Mirror the business-hours change for the holiday-calendar modal: route both the client-side JSON parse error and the server's `holidays`-keyed 422 to a `holidays_err` signal wired into the Holidays Textarea's `error` prop, so a malformed holiday list renders inline on the field instead of in the modal banner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/PMS-604-sla-json-inline-errors 2026-07-01 22:51:15 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!404
No description provided.