206
206
</div >
207
207
208
208
<!-- Placeholder for spacing -->
209
- <div v-else class =" flex-1" >
210
- </div >
211
-
209
+ <div v-else class =" flex-1" ></div >
212
210
213
211
<!-- Remove condition -->
214
212
<div class =" cursor-pointer mt-2" @click.prevent =" removeCondition(index)" >
@@ -380,6 +378,10 @@ const emitUpdate = () => {
380
378
}
381
379
382
380
const getFieldOperators = (field , fieldType ) => {
381
+ // Set default field type if not set for backwards compatibility as this field was added later.
382
+ if (! fieldType) {
383
+ fieldType = fieldTypeConstants .conversation
384
+ }
383
385
if (fieldType === fieldTypeConstants .contact_custom_attribute ) {
384
386
return contactCustomAttributes .value [field]? .operators || []
385
387
}
@@ -390,6 +392,10 @@ const getFieldOperators = (field, fieldType) => {
390
392
}
391
393
392
394
const getFieldOptions = (field , fieldType ) => {
395
+ // Set default field type if not set for backwards compatibility as this field was added later.
396
+ if (! fieldType) {
397
+ fieldType = fieldTypeConstants .conversation
398
+ }
393
399
if (fieldType === fieldTypeConstants .contact_custom_attribute ) {
394
400
return contactCustomAttributes .value [field]? .options || []
395
401
}
@@ -401,9 +407,14 @@ const getFieldOptions = (field, fieldType) => {
401
407
402
408
const inputType = (index ) => {
403
409
const field = ruleGroup .value .rules [index]? .field
404
- const fieldType = ruleGroup .value .rules [index]? .field_type
405
410
const operator = ruleGroup .value .rules [index]? .operator
411
+ let fieldType = ruleGroup .value .rules [index]? .field_type
406
412
if ([' contains' , ' not contains' ].includes (operator)) return ' tag'
413
+
414
+ // Set default field type if not set for backwards compatibility as this field was added later.
415
+ if (! fieldType) {
416
+ fieldType = fieldTypeConstants .conversation
417
+ }
407
418
if (field && fieldType) {
408
419
if (fieldType === fieldTypeConstants .contact_custom_attribute ) {
409
420
return contactCustomAttributes .value [field]? .type || ' '
0 commit comments