FIX: ensures report-filter/category is correctly filtering (#8992)

This commit is contained in:
Joffrey JAFFEUX 2020-02-18 17:37:43 +01:00 committed by GitHub
parent ea49ca7ef5
commit 99746c2850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -1,5 +1,4 @@
import Category from "discourse/models/category";
import discourseComputed from "discourse-common/utils/decorators";
import { readOnly } from "@ember/object/computed";
import FilterComponent from "admin/components/report-filters/filter";
export default FilterComponent.extend({
@ -7,14 +6,11 @@ export default FilterComponent.extend({
layoutName: "admin/templates/components/report-filters/category",
@discourseComputed("filter.default")
category(categoryId) {
return Category.findById(categoryId);
},
category: readOnly("filter.default"),
actions: {
onDeselect() {
this.applyFilter(this.get("filter.id"), undefined);
onChange(categoryId) {
this.applyFilter(this.get("filter.id"), categoryId || undefined);
}
}
});

View File

@ -1,5 +1,7 @@
{{search-advanced-category-chooser
filterable=true
value=category
onChange=(action (mut category))
onChange=(action "onChange")
options=(hash
filterable=true
)
}}