2019-11-07 16:38:28 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-10-23 13:06:54 -04:00
|
|
|
import Controller from "@ember/controller";
|
2015-09-15 16:45:01 -04:00
|
|
|
|
2019-10-23 13:06:54 -04:00
|
|
|
export default Controller.extend({
|
2020-07-28 10:14:41 -04:00
|
|
|
queryParams: ["start_date", "end_date", "filters", "chart_grouping"],
|
2019-04-26 06:17:10 -04:00
|
|
|
start_date: null,
|
|
|
|
end_date: null,
|
|
|
|
filters: null,
|
2020-07-28 10:14:41 -04:00
|
|
|
chart_grouping: null,
|
2016-02-02 21:29:51 -05:00
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("model.type")
|
2018-07-19 14:33:11 -04:00
|
|
|
reportOptions(type) {
|
2018-08-01 18:40:59 -04:00
|
|
|
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
|
2016-04-21 03:33:23 -04:00
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
if (type === "top_referred_topics") {
|
|
|
|
options.table.limit = 10;
|
|
|
|
}
|
|
|
|
|
2020-07-28 10:14:41 -04:00
|
|
|
options.chartGrouping = this.chart_grouping;
|
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
return options;
|
2013-03-17 15:02:36 -04:00
|
|
|
},
|
2014-06-10 11:54:38 -04:00
|
|
|
});
|