mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 15:16:04 +08:00
4c3d2267b4
Note that this commit will also disable daily grouping for datasets with more than 30 data points. This will also smartly do the grouping by month when grouping a full year.
24 lines
606 B
JavaScript
24 lines
606 B
JavaScript
import Controller from "@ember/controller";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
export default Controller.extend({
|
|
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;
|
|
},
|
|
});
|