discourse/plugins/discourse-solved/spec/integration
Natalie Tay 728e70f507
FEATURE: Admin dashboard highlights to real data (#39895)
Behind the `dashboard_improvements` setting, the Highlights row is
hardcoded

This commit updates `/admin/dashboard.json` to swap out to a
`sections.highlights`. The endpoint takes optional `start_date` /
`end_date` so the redesigned page passes its picker range. Legacy
dashboard / `AdminDashboard.fetch()` callers get the same response
without the new stuff.

Core ships three KPIs (`new_signups`, `dau_mau`, `new_contributors`).
Plugins register more via a new
`register_admin_dashboard_highlight_kpi(type:, report:, enabled:)`
(discourse-solved for now). Each plugin owns their own KPI stuff.

Caching uses the existing per-report layer (`Report.find_cached`) rather
than wrapping the service in its own cache. Toggling a plugin's
`enabled:` takes effect immediately, the cache is shared with the
Reports tab when an admin drills into a tile, and the cache key isn't
fragmented per admin since the data is admin-agnostic.

The server returns `report_type` + `report_query` instead of a full URL
so routes are stable.

Without solved:

https://github.com/user-attachments/assets/28612829-b425-4664-bfb9-02e8783f5b93

With solved:

https://github.com/user-attachments/assets/3c6b6d6f-44b7-4c61-9b23-0aaaa3f21ddc
2026-05-12 13:15:52 +08:00
..
admin_dashboard_highlight_kpi_spec.rb FEATURE: Admin dashboard highlights to real data (#39895) 2026-05-12 13:15:52 +08:00
solved_spec.rb UX: Downgrade site settings to category custom fields in solved plugin (#38402) 2026-03-12 10:03:37 +10:00