DEV: Add value transformer for admin reports show query params (#31597)

## 🔍 Overview
This update adds a new value transformer to the `queryParams` property
on the `AdminReportsShowController`. This is necessary so that plugins
can add additional `queryParams` to the route and have it reflected when
the route is transitioned.
This commit is contained in:
Keegan George 2025-03-03 18:33:08 -08:00 committed by GitHub
parent c815294c57
commit 879faa82b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -1,8 +1,15 @@
import Controller from "@ember/controller";
import discourseComputed from "discourse/lib/decorators";
import { applyValueTransformer } from "discourse/lib/transformer";
export default class AdminReportsShowController extends Controller {
queryParams = ["start_date", "end_date", "filters", "chart_grouping", "mode"];
queryParams = applyValueTransformer("admin-reports-show-query-params", [
"start_date",
"end_date",
"filters",
"chart_grouping",
"mode",
]);
start_date = null;
end_date = null;
filters = null;

View File

@ -9,6 +9,7 @@ export const BEHAVIOR_TRANSFORMERS = Object.freeze([
export const VALUE_TRANSFORMERS = Object.freeze([
// use only lowercase names
"admin-reports-show-query-params",
"category-available-views",
"category-description-text",
"category-display-name",