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"],
|
2016-02-03 07:59:51 +05:30
|
|
|
|
2018-06-15 17:03:24 +02:00
|
|
|
@computed("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 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
|
|
|
|
2018-07-25 13:16:35 -04:00
|
|
|
@computed("category_id", "group_id", "start_date", "end_date")
|
2018-07-27 01:22:00 -04:00
|
|
|
filters(categoryId, groupId, startDate, endDate) {
|
2018-07-25 13:16:35 -04:00
|
|
|
return {
|
|
|
|
categoryId,
|
|
|
|
groupId,
|
|
|
|
startDate,
|
|
|
|
endDate
|
|
|
|
};
|
|
|
|
},
|
2015-09-15 16:45:01 -04:00
|
|
|
|
2018-07-25 13:16:35 -04:00
|
|
|
actions: {
|
|
|
|
onParamsChange(params) {
|
|
|
|
this.setProperties({
|
|
|
|
start_date: params.startDate,
|
|
|
|
category_id: params.categoryId,
|
|
|
|
group_id: params.groupId,
|
|
|
|
end_date: params.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
|
|
|
});
|