Merge pull request #6990 from Budibase/feature/option-isin-filter

Add 'Is In' filter to Option data type
This commit is contained in:
melohagan 2022-07-29 17:36:42 +01:00 committed by GitHub
commit 4f5ffc2845
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@
{error}
{disabled}
{readonly}
{value}
value={Array.isArray(value) ? value : [value]}
{options}
{placeholder}
{sort}

View File

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

View File

@ -30,7 +30,7 @@ export const getValidOperatorsForType = type => {
} else if (type === "number") {
return numOps
} else if (type === "options") {
return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty]
return [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty, Op.In]
} else if (type === "array") {
return [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty, Op.ContainsAny]
} else if (type === "boolean") {