diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte index 822442fcea..f3c99c6454 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterDrawer.svelte @@ -126,6 +126,7 @@ // Update type based on field const fieldSchema = enrichedSchemaFields.find(x => x.name === filter.field) filter.type = fieldSchema?.type + filter.subtype = fieldSchema?.subtype // Update external type based on field filter.externalType = getSchema(filter)?.externalType @@ -196,7 +197,7 @@ } return LuceneUtils.getValidOperatorsForType( - filter.type, + { type: filter.type, subtype: filter.subtype }, filter.field, datasource ) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte index d21b4799a1..ddbc8b004e 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ConditionalUIDrawer.svelte @@ -118,7 +118,7 @@ } const getOperatorOptions = condition => { - return LuceneUtils.getValidOperatorsForType(condition.valueType) + return LuceneUtils.getValidOperatorsForType({ type: condition.valueType }) } const onOperatorChange = (condition, newOperator) => { @@ -137,9 +137,9 @@ condition.referenceValue = null // Ensure a valid operator is set - const validOperators = LuceneUtils.getValidOperatorsForType(newType).map( - x => x.value - ) + const validOperators = LuceneUtils.getValidOperatorsForType({ + type: newType, + }).map(x => x.value) if (!validOperators.includes(condition.operator)) { condition.operator = validOperators[0] ?? Constants.OperatorOptions.Equals.value diff --git a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte index 513c19126d..0adf508dfa 100644 --- a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte +++ b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte @@ -63,7 +63,7 @@ // Ensure a valid operator is set const validOperators = LuceneUtils.getValidOperatorsForType( - expression.type, + { type: expression.type }, expression.field, datasource ).map(x => x.value) @@ -125,7 +125,7 @@