Correctly handling overlapping column names.

This commit is contained in:
mike12345567 2024-06-27 17:55:09 +01:00
parent 1b9211ee6c
commit b0e6d3e72c
1 changed files with 6 additions and 1 deletions

View File

@ -99,10 +99,15 @@ function cleanupFilters(
key => (userColumnMap[key] = mapToUserColumn(key)) key => (userColumnMap[key] = mapToUserColumn(key))
) )
) )
// sort longest first, don't find substrings
const userColumnList = Object.keys(userColumnMap).sort(
(a, b) => b.length - a.length
)
// update the keys of filters to manage user columns // update the keys of filters to manage user columns
for (let filter of Object.values(filters)) { for (let filter of Object.values(filters)) {
for (let key of Object.keys(filter)) { for (let key of Object.keys(filter)) {
const found = Object.keys(userColumnMap).find(possibleColumn => const found = userColumnList.find(possibleColumn =>
key.endsWith(possibleColumn) key.endsWith(possibleColumn)
) )
if (found) { if (found) {