discourse/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6
Joffrey JAFFEUX 1a78e12f4e
FEATURE: part 2 of dashboard improvements
- moderation tab
- sorting/pagination
- improved third party reports support
- trending charts
- better perf
- many fixes
- refactoring
- new reports

Co-Authored-By: Simon Cossar <scossar@users.noreply.github.com>
2018-07-19 14:33:11 -04:00

37 lines
767 B
JavaScript

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,
@computed("model.type")
reportOptions(type) {
let options = { table: { perPage: 50, limit: 50 } };
if (type === "top_referred_topics") {
options.table.limit = 10;
}
return options;
},
actions: {
onSelectStartDate(startDate) {
this.set("start_date", startDate);
},
onSelectCategory(categoryId) {
this.set("category_id", categoryId);
},
onSelectGroup(groupId) {
this.set("group_id", groupId);
},
onSelectEndDate(endDate) {
this.set("end_date", endDate);
}
}
});