discourse/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6

37 lines
767 B
Plaintext
Raw Normal View History

2018-06-15 11:03:24 -04:00
import computed from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
queryParams: ["start_date", "end_date", "category_id", "group_id"],
categoryId: null,
groupId: null,
2018-06-15 11:03:24 -04:00
@computed("model.type")
reportOptions(type) {
let options = { table: { perPage: 50, limit: 50 } };
if (type === "top_referred_topics") {
options.table.limit = 10;
}
return options;
},
2013-09-16 14:08:55 -04:00
actions: {
onSelectStartDate(startDate) {
this.set("start_date", startDate);
},
onSelectCategory(categoryId) {
this.set("category_id", categoryId);
2013-09-16 14:08:55 -04:00
},
onSelectGroup(groupId) {
this.set("group_id", groupId);
},
onSelectEndDate(endDate) {
this.set("end_date", endDate);
2013-09-16 14:08:55 -04:00
}
}
});