Skip to content

Custom dashboards - #11

Merged
almokhtarbr merged 1 commit into
mainfrom
custom-dashboards
Sep 7, 2026
Merged

almokhtarbr merged 1 commit into
mainfrom
custom-dashboards

Conversation

@almokhtarbr

Copy link
Copy Markdown
Owner

Teams get more than the one fixed layout per project.

Model

  • Dashboard belongs_to :project, has_many :dashboard_widgets (ordered by position), has_many :saved_reports, through:. #pin(report) appends a widget once (idempotent).
  • DashboardWidget belongs_to :dashboard + :saved_report, delegates project.
  • WidgetMetric reduces a saved report to a single 30-day headline number for the count-shaped types (event_explorer, trend); returns nil for funnel/retention so the card links out instead.

Controllers / routes

  • DashboardsController — index / show / create / destroy, all @project-scoped.
  • Nested DashboardWidgetsController — create (pin) / destroy (unpin); pinning a report from another project 404s.
  • resources :dashboards do resources :dashboard_widgets end under :projects.

UI

  • New Dashboards tab in the project nav.
  • Index: name-and-create form + list. Show: widget cards in a responsive grid, each with headline metric or an "Open report →" link, plus an "Add a widget" picker of the not-yet-pinned saved reports.

Tests — 17 new examples (model, service, request). Full suite 273 green, rubocop clean, brakeman 0 warnings. Migration adds dashboards + dashboard_widgets; db/structure.sql regenerated.

Closes the last open item from the roadmap's build list; ROADMAP.md updated.

Any number of named boards per project. Pin saved reports as widgets;
count-shaped reports (event explorer / trend) render a 30-day headline
number via WidgetMetric, funnels and retention link out to the full
report. Dashboards and widgets are project-scoped end to end.

- Dashboard has_many :dashboard_widgets (ordered), through to saved_reports
- Dashboard#pin appends a report once, idempotent
- WidgetMetric reduces a report to one figure or nil
- DashboardsController + nested DashboardWidgetsController
- Dashboards tab in the project nav
@almokhtarbr
almokhtarbr merged commit 6898f79 into main Sep 7, 2026
2 checks passed
@almokhtarbr
almokhtarbr deleted the custom-dashboards branch September 7, 2026 02:26
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