feat(dashboards): editor + per-widget data fetches (PMS-487) #332
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!332
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-487-dashboard-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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):
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.
appends a row to the in-memory draft with sensible defaults
(col=1, row=next-after-max, col_span=6, row_span=1).
/dashboards/{id}with{layout: ...}andrefetches the row on success.
Per-widget bodies:
/reports/dashboard./time-entries./reports/dashboard./invoices?status=sent&per_page=50./audit-log.Acceptance criteria:
through
PATCH /dashboards/{id}(UpdateLayoutBody + on_save).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