Browse Source

fix: revise filterComparisonOp for mm, hm & bt

pull/2535/head
Wing-Kam Wong 2 years ago
parent
commit
8c082d4259
  1. 22
      packages/nc-gui/components/project/spreadsheet/components/ColumnFilter.vue

22
packages/nc-gui/components/project/spreadsheet/components/ColumnFilter.vue

@ -324,13 +324,23 @@ export default {
if (
f &&
f.fk_column_id &&
this.columnsById[f.fk_column_id] &&
this.columnsById[f.fk_column_id].uidt ===
UITypes.LinkToAnotherRecord &&
this.columnsById[f.fk_column_id].uidt === UITypes.Lookup
this.columnsById[f.fk_column_id]
) {
return !['notempty', 'empty', 'notnull', 'null'].includes(op.value)
}
const uidt = this.columnsById[f.fk_column_id].uidt
if (uidt === UITypes.Lookup) {
// TODO: handle it later
return !['notempty', 'empty', 'notnull', 'null'].includes(op.value)
} else if (uidt === UITypes.LinkToAnotherRecord) {
const type = this.columnsById[f.fk_column_id].colOptions.type
if (type === 'hm' || type === 'mm') {
// exclude notnull & null
return !['notnull', 'null'].includes(op.value)
} else if (type === 'bt') {
// exclude notempty & empty
return !['notempty', 'empty'].includes(op.value)
}
}
}
return true
})
},

Loading…
Cancel
Save