Skip to content

Commit

Permalink
Fix reseting record list filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Fajfa committed Oct 15, 2024
1 parent 2a8682c commit fc3d64d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions client/web/compose/src/components/Common/RecordListFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ export default {
processFilter () {
return this.componentFilter.map(({ groupCondition, filter = [], name }) => {
filter = filter.map(({ record, ...f }) => {
if (!f.name) {
return
}
if (record) {
f.value = record[f.name] || record.values[f.name]
}
Expand All @@ -627,10 +631,10 @@ export default {
}
return f
})
}).filter(f => f)
return { groupCondition, filter, name }
})
}).filter(({ filter }) => filter.length)
},
onSave (close = true, type = 'filter') {
Expand Down
13 changes: 9 additions & 4 deletions client/web/compose/src/components/PageBlocks/RecordListBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1139,11 +1139,16 @@ export default {
},
onFilter (filter = []) {
filter.forEach(f => {
f.name = this.$t('recordList.customFilter')
})
if (filter.length) {
filter.forEach(f => {
f.name = this.$t('recordList.customFilter')
})
this.activeFilters = [this.$t('recordList.customFilter')]
} else {
this.activeFilters = []
}
this.activeFilters = [this.$t('recordList.customFilter')]
this.recordListFilter = filter
this.setStorageRecordListFilter()
this.refresh(true)
Expand Down

0 comments on commit fc3d64d

Please sign in to comment.