Skip to content

Business hours schedule select on SLA policy and department forms - #209

Merged
mpge merged 2 commits into
mainfrom
feat/business-schedule-select
Oct 22, 2026
Merged

mpge merged 2 commits into
mainfrom
feat/business-schedule-select

Conversation

@mpge

@mpge mpge commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Backends now let an SLA policy and a department name the business schedule their business-hours deadlines count in (precedence: policy, then the ticket's department, then the default schedule). See escalated-laravel #256 and escalated-nestjs #168.

What changes

  • Admin/SlaPolicies/Form and Admin/Departments/Form accept an optional schedules prop ([{ id, name }]).
  • When present, a Business hours schedule select is shown: "Use the default" (null) plus each schedule, bound to business_schedule_id and preselected from the saved record. Validation errors on the field are shown.
  • When absent, the pages render and post exactly as before. The key is not sent at all, which matters: both Laravel and NestJS leave the stored schedule alone when the key is missing, so an older page cannot clear it, and backends without schedules never see the field.
  • pages.json regenerated (schedules added to both forms' props). CHANGELOG [Unreleased] entry.

Tests

tests/pages/AdminBusinessScheduleSelect.test.js runs the same cases against both forms: no prop (no select, nothing posted, including for a saved record with a schedule), the options, null for the default, the chosen id, and switching a saved schedule back to the default.

Full vitest, npm run lint, npm run format:check, npm run pages:check pass locally (the packaging test needs npm pack, exercised in CI).

The Laravel side that passes schedules is a follow-up PR in escalated-laravel.

Also

The Node 22 job's npm audit step started failing on advisories published since main last ran (vite, vitest/@vitest/mocker, follow-redirects). A second commit runs npm audit fix (lockfile only, within existing ranges); npm audit reports 0 vulnerabilities.

… forms

Shown only when the backend passes a schedules list; posts business_schedule_id
(null for the default). Pages rendered without the list are unchanged and never
send the field.
npm audit fix: vite, vitest/@vitest/mocker and follow-redirects, lockfile only.
@mpge
mpge merged commit 009bfaf into main Oct 22, 2026
11 checks passed
@mpge mpge mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant