discourse/app/assets/javascripts/admin/addon/controllers/admin-reports-show.js
David Taylor be354e7950
DEV: Update admin controllers to native class syntax (#20674)
This commit was generated using the ember-native-class-codemod along with a handful of manual updates
2023-03-15 09:42:12 +00:00

24 lines
642 B
JavaScript

import Controller from "@ember/controller";
import discourseComputed from "discourse-common/utils/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;
}
options.chartGrouping = this.chart_grouping;
return options;
}
}