FIX: ensures report-filter/category is correctly filtering (#8992)
This commit is contained in:
parent
ea49ca7ef5
commit
99746c2850
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{{search-advanced-category-chooser
|
||||
filterable=true
|
||||
value=category
|
||||
onChange=(action (mut category))
|
||||
onChange=(action "onChange")
|
||||
options=(hash
|
||||
filterable=true
|
||||
)
|
||||
}}
|
||||
|
|
Loading…
Reference in New Issue