mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 16:04:30 +08:00
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:
parent
c815294c57
commit
879faa82b3
@ -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;
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user