1
0
Fork 0
mirror of synced 2024-07-03 05:20:32 +12:00

use normal combobox for filtering array columns

This commit is contained in:
Peter Clement 2021-08-25 17:00:42 +01:00
parent 84350933d4
commit 078cb07b04
2 changed files with 3 additions and 17 deletions

View file

@ -136,7 +136,7 @@
/>
{:else if ["string", "longform", "number"].includes(filter.type)}
<Input disabled={filter.noValue} bind:value={filter.value} />
{:else if filter.type === "options"}
{:else if filter.type === "options" || filter.type === "array"}
<Combobox
disabled={filter.noValue}
options={getFieldOptions(filter.field)}

View file

@ -229,14 +229,7 @@ class QueryBuilder {
if (!value) {
return null
}
let opts = []
value.forEach(val =>
opts.push(
`${key}.${val}:${builder.preprocess(val, allPreProcessingOpts)}`
)
)
const joined = opts.join(" AND ")
return joined
return `${key}.${value}:${builder.preprocess(value, allPreProcessingOpts)}`
})
}
@ -245,14 +238,7 @@ class QueryBuilder {
if (!value) {
return null
}
let opts = []
value.forEach(val =>
opts.push(
`!${key}.${val}:${builder.preprocess(val, allPreProcessingOpts)}`
)
)
const joined = opts.join(" AND ")
return joined
return `!${key}.${value}:${builder.preprocess(value, allPreProcessingOpts)}`
})
}