feat(dashboards): editor + per-widget data fetches (PMS-487) #332

Merged
YousifShkara merged 1 commit from feat/PMS-487-dashboard-editor into feat/PMS-472-dashboard-view-surface 2026-06-25 07:47:18 +02:00
Owner

PMS-472 shipped the read-only view surface for a saved dashboard's
layout. PMS-487 layers the editor and replaces the placeholder widget
bodies with real data fetches against existing PSA endpoints.

Editor (toggled via an "Edit layout" button on SavedDashboardViewPage):

  • Per-widget number inputs for grid_col / grid_row / grid_col_span /
    grid_row_span. Number inputs are the v1 shape - drag-and-drop is
    nicer UX but locks the project into a heavy dnd dependency the
    PMS-487 AC explicitly does not require.
  • "Add widget" panel listing every catalog key as a button; click
    appends a row to the in-memory draft with sensible defaults
    (col=1, row=next-after-max, col_span=6, row_span=1).
  • "Save layout" PATCHes /dashboards/{id} with {layout: ...} and
    refetches the row on success.
  • "Cancel" reverts the draft to the persisted layout.

Per-widget bodies:

  • tickets_by_status: open-by-priority from /reports/dashboard.
  • time_this_week: minutes since Monday from /time-entries.
  • sla_at_risk: at-risk + breached from /reports/dashboard.
  • open_invoices: count + total from /invoices?status=sent&per_page=50.
  • recent_audit_log: last 5 rows of /audit-log.

Acceptance criteria:

  • "Edit layout" toggle on SavedDashboardViewPage swaps into editor.
  • User can add widgets from the catalog, change grid coords, save
    through PATCH /dashboards/{id} (UpdateLayoutBody + on_save).
  • Each catalog widget renders real data via its own per-widget fetch.
  • The pinned-default dashboard loads via GET /dashboards/default
    (DefaultDashboardPage, unchanged from PMS-472).

Builds on PMS-472 - rebase / merge that branch first.

#PMS-487

PMS-472 shipped the read-only view surface for a saved dashboard's layout. PMS-487 layers the editor and replaces the placeholder widget bodies with real data fetches against existing PSA endpoints. Editor (toggled via an "Edit layout" button on SavedDashboardViewPage): - Per-widget number inputs for grid_col / grid_row / grid_col_span / grid_row_span. Number inputs are the v1 shape - drag-and-drop is nicer UX but locks the project into a heavy dnd dependency the PMS-487 AC explicitly does not require. - "Add widget" panel listing every catalog key as a button; click appends a row to the in-memory draft with sensible defaults (col=1, row=next-after-max, col_span=6, row_span=1). - "Save layout" PATCHes `/dashboards/{id}` with `{layout: ...}` and refetches the row on success. - "Cancel" reverts the draft to the persisted layout. Per-widget bodies: - tickets_by_status: open-by-priority from `/reports/dashboard`. - time_this_week: minutes since Monday from `/time-entries`. - sla_at_risk: at-risk + breached from `/reports/dashboard`. - open_invoices: count + total from `/invoices?status=sent&per_page=50`. - recent_audit_log: last 5 rows of `/audit-log`. Acceptance criteria: - "Edit layout" toggle on SavedDashboardViewPage swaps into editor. - User can add widgets from the catalog, change grid coords, save through `PATCH /dashboards/{id}` (UpdateLayoutBody + on_save). - Each catalog widget renders real data via its own per-widget fetch. - The pinned-default dashboard loads via `GET /dashboards/default` (DefaultDashboardPage, unchanged from PMS-472). Builds on PMS-472 - rebase / merge that branch first. #PMS-487
PMS-472 shipped the read-only view surface for a saved dashboard's
layout. PMS-487 layers the editor and replaces the placeholder widget
bodies with real data fetches against existing PSA endpoints.

Editor (toggled via an "Edit layout" button on SavedDashboardViewPage):
- Per-widget number inputs for grid_col / grid_row / grid_col_span /
  grid_row_span. Number inputs are the v1 shape - drag-and-drop is
  nicer UX but locks the project into a heavy dnd dependency the
  PMS-487 AC explicitly does not require.
- "Add widget" panel listing every catalog key as a button; click
  appends a row to the in-memory draft with sensible defaults
  (col=1, row=next-after-max, col_span=6, row_span=1).
- "Save layout" PATCHes `/dashboards/{id}` with `{layout: ...}` and
  refetches the row on success.
- "Cancel" reverts the draft to the persisted layout.

Per-widget bodies:
- tickets_by_status: open-by-priority from `/reports/dashboard`.
- time_this_week: minutes since Monday from `/time-entries`.
- sla_at_risk: at-risk + breached from `/reports/dashboard`.
- open_invoices: count + total from `/invoices?status=sent&per_page=50`.
- recent_audit_log: last 5 rows of `/audit-log`.

Acceptance criteria:
- "Edit layout" toggle on SavedDashboardViewPage swaps into editor.
- User can add widgets from the catalog, change grid coords, save
  through `PATCH /dashboards/{id}` (UpdateLayoutBody + on_save).
- Each catalog widget renders real data via its own per-widget fetch.
- The pinned-default dashboard loads via `GET /dashboards/default`
  (DefaultDashboardPage, unchanged from PMS-472).

Builds on PMS-472 - rebase / merge that branch first.

#PMS-487
YousifShkara merged commit a8da01fbfd into feat/PMS-472-dashboard-view-surface 2026-06-25 07:47:18 +02:00
YousifShkara deleted branch feat/PMS-487-dashboard-editor 2026-06-25 07:47:19 +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!332
No description provided.