2018-06-15 17:03:24 +02:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
2015-09-15 16:45:01 -04:00
|
|
|
|
2015-08-11 12:27:07 -04:00
|
|
|
export default Ember.Controller.extend({
|
2018-07-19 14:33:11 -04:00
|
|
|
queryParams: ["start_date", "end_date", "category_id", "group_id"],
|
2015-06-24 15:19:39 +02:00
|
|
|
categoryId: null,
|
2016-02-03 07:59:51 +05:30
|
|
|
groupId: null,
|
|
|
|
|
2018-06-15 17:03:24 +02:00
|
|
|
@computed("model.type")
|
2018-07-19 14:33:11 -04:00
|
|
|
reportOptions(type) {
|
|
|
|
let options = { table: { perPage: 50, limit: 50 } };
|
2016-04-21 13:03:23 +05:30
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
if (type === "top_referred_topics") {
|
|
|
|
options.table.limit = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return options;
|
2016-02-03 07:59:51 +05:30
|
|
|
},
|
2015-07-03 12:58:13 -04:00
|
|
|
|
2013-09-16 14:08:55 -04:00
|
|
|
actions: {
|
2018-07-19 14:33:11 -04:00
|
|
|
onSelectStartDate(startDate) {
|
|
|
|
this.set("start_date", startDate);
|
2014-11-05 14:46:27 -05:00
|
|
|
},
|
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
onSelectCategory(categoryId) {
|
|
|
|
this.set("category_id", categoryId);
|
2013-09-16 14:08:55 -04:00
|
|
|
},
|
2013-03-17 15:02:36 -04:00
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
onSelectGroup(groupId) {
|
|
|
|
this.set("group_id", groupId);
|
2015-09-15 16:45:01 -04:00
|
|
|
},
|
|
|
|
|
2018-07-19 14:33:11 -04:00
|
|
|
onSelectEndDate(endDate) {
|
|
|
|
this.set("end_date", endDate);
|
2013-09-16 14:08:55 -04:00
|
|
|
}
|
2013-03-17 15:02:36 -04:00
|
|
|
}
|
2014-06-10 11:54:38 -04:00
|
|
|
});
|