towerops/lib/towerops_web/live/escalation_policy_live
Graham McIntire 434386816e feat(on_call): drag-drop reorder + restrictions editor + new-schedule polish
Three deferred followups from the chunk-4 plan, all together:

A. Restrictions editor
- Resolver: time_of_week support (weekday set + time-of-day window),
  in addition to the existing time_of_day.
- New OnCall.update_layer_restrictions/2 + clear_layer_restrictions/1.
- schedule_live/show: per-layer Restrict on-call shifts form
  (Always on call / Time of day / Time of week with Mon-Sun checkboxes),
  changes patched live and persisted via the resolver.

B. Drag-and-drop reorder
- New OnCall.reorder_layers/2 + reorder_escalation_rules/2 (atomic
  transaction; validates id count + membership).
- assets/js/sortable_list.ts: minimal HTML5 drag-and-drop hook (no
  external dep; mirrors the existing DeviceListReorder pattern),
  registered as SortableList in app.ts.
- schedule_live/show + escalation_policy_live/show: layer/level cards
  now carry data-id + draggable + a visible drag handle. Up/down arrow
  buttons remain as a fallback for users on assistive tech.

C. Unified new-schedule UX
- schedule_live/show pre-opens the Add Layer form when the schedule
  has zero layers, so the new-schedule -> add-layers flow lands ready
  to act on. Two existing tests updated to seed a layer first; two
  new tests verify the auto-open behaviour both ways.

Full suite 10,231 / 0 failures. Format/dialyzer clean.
2026-04-28 14:27:38 -05:00
..
form.ex fix: input validation, SSRF, API hardening, and cookie security 2026-03-14 14:48:59 -05:00
form.html.heex feat(on_call): PagerDuty-style escalation policy redesign + dialyzer fix 2026-04-28 12:36:41 -05:00
index.ex feat: add on-call schedules and escalation policies 2026-03-11 12:32:54 -05:00
index.html.heex feat(on_call): PagerDuty-style escalation policy redesign + dialyzer fix 2026-04-28 12:36:41 -05:00
show.ex feat(on_call): drag-drop reorder + restrictions editor + new-schedule polish 2026-04-28 14:27:38 -05:00
show.html.heex feat(on_call): drag-drop reorder + restrictions editor + new-schedule polish 2026-04-28 14:27:38 -05:00