Refactor checkbox condition logic with new operators

- Replace legacy 'equals' and 'does_not_equal' checkbox operators with 'is_checked' and 'is_not_checked'
- Update FormLogicConditionChecker in PHP and JavaScript to handle new operators
- Modify open_filters.json to reflect new checkbox comparator structure
- Add migration logic in ColumnCondition.vue to support legacy operator conversion
- Improve checkbox condition handling with explicit true/false checks
This commit is contained in:
Julien Nahum
2025-02-10 21:48:21 +01:00
parent b457368398
commit f5b9b86c16
6 changed files with 499 additions and 56 deletions

View File

@@ -332,10 +332,15 @@ function numberConditionMet(propertyCondition, value) {
function checkboxConditionMet(propertyCondition, value) {
switch (propertyCondition.operator) {
case "is_checked":
return value === true
case "is_not_checked":
return value === false
// Legacy operators
case "equals":
return checkEquals(propertyCondition, value)
return value === true
case "does_not_equal":
return !checkEquals(propertyCondition, value)
return value === false
}
return false
}