Only allow bindings type for Is In Conditional UI

This commit is contained in:
Mel O'Hagan 2022-08-16 13:36:48 +01:00
parent 9287d48ccf
commit c5196c7a37
2 changed files with 10 additions and 3 deletions

View File

@ -112,7 +112,7 @@
Constants.OperatorOptions.NotEmpty.value,
]
condition.noValue = noValueOptions.includes(newOperator)
if (condition.noValue) {
if (condition.noValue || condition.operator === "oneOf") {
condition.referenceValue = null
condition.valueType = "string"
}
@ -207,7 +207,14 @@
/>
<Select
disabled={condition.noValue}
options={valueTypeOptions}
options={condition.operator === "oneOf"
? [
{
value: "string",
label: "Binding",
},
]
: valueTypeOptions}
bind:value={condition.valueType}
placeholder={null}
on:change={e => onValueTypeChange(condition, e.detail)}

View File

@ -114,7 +114,7 @@ export const buildLuceneQuery = filter => {
return
}
}
if (type === "number" && !Array.isArray(value)) {
if (type === "number" && typeof value === "string") {
if (operator === "oneOf") {
value = value.split(",").map(item => parseFloat(item))
} else if (!isHbs) {