diff --git a/src/util/updateComponentCondition.js b/src/util/updateComponentCondition.js index 91feb64..aab4698 100644 --- a/src/util/updateComponentCondition.js +++ b/src/util/updateComponentCondition.js @@ -1,4 +1,4 @@ -import { component, and, condition, findComponentNode, Type, isComposedComponentExpression } from "../FilterDSL"; +import { component, and, condition, findComponentNode, Type, isComposedComponentExpression, operation } from "../FilterDSL"; import compareConditions from "./compareConditions"; @@ -171,13 +171,22 @@ function updateComponentConditionRecursive( } + if (compositeCondition.type === Type.OPERATION) { + const newOperation = operation(compositeCondition.name); + newOperation.operands = [ + ...newOperands, + ...oldOperands + ]; + return newOperation; + } + const newCondition = condition(compositeCondition.name); newCondition.operands = [ ...newOperands, ...oldOperands ]; - return newCondition; + } function wrapConditionIntoComponent(componentCondition, componentId) {