Skip to content

Commit c4579f1

Browse files
committed
fix: A filter condition over a number property generates a property value as a string (closes #1410)
1 parent d761c7c commit c4579f1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

map/client/components/KFilterCondition.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@
6060
emit-value map-options dense
6161
id="condition-value"
6262
/>
63+
<q-input
64+
v-else-if="valueIsNumber"
65+
v-model.number="value"
66+
type="number"
67+
:label="$t('KFilterCondition.VALUE')"
68+
:error="hasValueErrors"
69+
:error-message="$t('KFilterCondition.CANNOT_BE_EMPTY')"
70+
@update:model-value="checkValueValidity"
71+
dense
72+
id="condition-value"
73+
/>
6374
<q-input
6475
v-else
6576
v-model="value"
66-
:type="valueIsNumber ? 'number' : 'text'"
77+
type="text"
6778
:label="$t('KFilterCondition.VALUE')"
6879
:error="hasValueErrors"
6980
:error-message="$t('KFilterCondition.CANNOT_BE_EMPTY')"
@@ -180,8 +191,8 @@ function getProperties () {
180191
}
181192
async function onPropertyChange (property) {
182193
if (!property) return null
183-
// Use input of type number if the component from schema is KNumberField
184-
if (_.get(layer, ['schema', 'content', 'properties', property, 'field', 'component']) === 'form/KNumberField') {
194+
// Use input of type number if the schema is like
195+
if (_.get(layer, ['schema', 'content', 'properties', property, 'type']) === 'number') {
185196
valueOptions.value = null
186197
valueIsNumber.value = true
187198
// Switch comparison operator if not in operators that can be applied to numbers

0 commit comments

Comments
 (0)