ESC-575 If operator has no format and no expected_type, it means it doesn't n… (#767)

* If operator has no format and no expected_type, it means it doesn't need input

* Add testcase for integration logic with checkbox

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2025-05-28 13:35:24 +05:30
committed by GitHub
parent 360b116062
commit cac88e7a3c
2 changed files with 63 additions and 2 deletions

View File

@@ -47,6 +47,14 @@ class IntegrationLogicRule implements DataAwareRule, ValidationRule
return;
}
$typeField = $condition['value']['property_meta']['type'];
$operator = $condition['value']['operator'];
// If operator has no format and no expected_type, it means it doesn't need input
if (!isset(FormPropertyLogicRule::getConditionMapping()[$typeField]['comparators'][$operator]['expected_type'])) {
return;
}
if (!isset($condition['value']['value'])) {
$this->isConditionCorrect = false;
$this->conditionErrors[] = 'missing condition value';
@@ -54,8 +62,6 @@ class IntegrationLogicRule implements DataAwareRule, ValidationRule
return;
}
$typeField = $condition['value']['property_meta']['type'];
$operator = $condition['value']['operator'];
$value = $condition['value']['value'];
if (!isset(FormPropertyLogicRule::getConditionMapping()[$typeField])) {