Skip to content

Commit

Permalink
fix condition merge converting operations to conditions (#182)
Browse files Browse the repository at this point in the history
Co-authored-by: Denis Weiß <denis.peters@quinscape.de>
  • Loading branch information
ZidArgs-Work and Denis Weiß authored Sep 25, 2024
1 parent 2e49946 commit 673c3a3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/util/updateComponentCondition.js
Original file line number Diff line number Diff line change
@@ -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";


Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 673c3a3

Please sign in to comment.