David Taylor 0ed4b09527
DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00

30 lines
779 B
JavaScript

import Controller from "@ember/controller";
import discourseComputed from "discourse/lib/decorators";
export default class AdminReportsShowController extends Controller {
queryParams = ["start_date", "end_date", "filters", "chart_grouping", "mode"];
start_date = null;
end_date = null;
filters = null;
chart_grouping = null;
@discourseComputed("model.type")
reportOptions(type) {
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
if (type === "top_referred_topics") {
options.table.limit = 10;
}
if (type === "site_traffic") {
options.stackedChart = {
hiddenLabels: ["page_view_other", "page_view_crawler"],
};
}
options.chartGrouping = this.chart_grouping;
return options;
}
}