FIX: better handling of category filter deselection (#7468)

This commit is contained in:
Joffrey JAFFEUX 2019-05-02 10:03:12 +02:00 committed by GitHub
parent d5c9ac7196
commit 75591664e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -207,6 +207,7 @@ export default Ember.Component.extend({
refreshReport() { refreshReport() {
this.attrs.onRefresh({ this.attrs.onRefresh({
type: this.get("model.type"),
startDate: this.get("startDate"), startDate: this.get("startDate"),
endDate: this.get("endDate"), endDate: this.get("endDate"),
filters: this.get("filters.customFilters") filters: this.get("filters.customFilters")

View File

@ -10,5 +10,11 @@ export default FilterComponent.extend({
@computed("filter.default") @computed("filter.default")
category(categoryId) { category(categoryId) {
return Category.findById(categoryId); return Category.findById(categoryId);
},
actions: {
onDeselect() {
this.applyFilter(this.get("filter.id"), undefined);
}
} }
}); });

View File

@ -3,4 +3,5 @@
value=category value=category
castInteger=true castInteger=true
onSelectNone=(action "onChange") onSelectNone=(action "onChange")
onDeselect=(action "onDeselect")
onSelect=(action "onChange")}} onSelect=(action "onChange")}}