mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 17:48:30 +08:00
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 |
||
|---|---|---|
| .. | ||
| admin_dashboard_highlight_kpi_spec.rb | ||
| solved_spec.rb | ||