From 4f4d68d00e62da70d179a00aa72249acf4a8aeed Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Mon, 24 Feb 2025 19:10:14 +0200 Subject: [PATCH] Update ComponentDataCondition --- .../model/conditional_variables/ComponentDataCondition.ts | 5 ++--- .../conditional_variables/ComponentConditionalVariable.ts | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/core/src/data_sources/model/conditional_variables/ComponentDataCondition.ts b/packages/core/src/data_sources/model/conditional_variables/ComponentDataCondition.ts index a2a9e19ca..d153f61a0 100644 --- a/packages/core/src/data_sources/model/conditional_variables/ComponentDataCondition.ts +++ b/packages/core/src/data_sources/model/conditional_variables/ComponentDataCondition.ts @@ -7,8 +7,8 @@ export default class ComponentDataCondition extends Component { dataResolver: DataCondition; constructor(props: DataConditionProps, opt: ComponentOptions) { - const { condition, ifTrue, ifFalse } = props; - const dataConditionInstance = new DataCondition(condition, ifTrue, ifFalse, { em: opt.em }); + const dataConditionInstance = new DataCondition(props, { em: opt.em }); + super( { ...props, @@ -22,7 +22,6 @@ export default class ComponentDataCondition extends Component { } private handleConditionChange() { - this.dataResolver.reevaluate(); this.components(this.dataResolver.getDataValue()); } diff --git a/packages/core/test/specs/data_sources/model/conditional_variables/ComponentConditionalVariable.ts b/packages/core/test/specs/data_sources/model/conditional_variables/ComponentConditionalVariable.ts index 0909eaf7d..33af1c63c 100644 --- a/packages/core/test/specs/data_sources/model/conditional_variables/ComponentConditionalVariable.ts +++ b/packages/core/test/specs/data_sources/model/conditional_variables/ComponentConditionalVariable.ts @@ -1,7 +1,7 @@ import { Component, DataSourceManager, Editor } from '../../../../../src'; import { DataVariableType } from '../../../../../src/data_sources/model/DataVariable'; import { DataConditionType } from '../../../../../src/data_sources/model/conditional_variables/DataCondition'; -import { GenericOperation } from '../../../../../src/data_sources/model/conditional_variables/operators/GenericOperator'; +import { AnyTypeOperation } from '../../../../../src/data_sources/model/conditional_variables/operators/AnyTypeOperator'; import { NumberOperation } from '../../../../../src/data_sources/model/conditional_variables/operators/NumberOperator'; import ComponentDataConditionView from '../../../../../src/data_sources/view/ComponentDataConditionView'; import ComponentWrapper from '../../../../../src/dom_components/model/ComponentWrapper'; @@ -97,7 +97,7 @@ describe('ComponentConditionalVariable', () => { type: DataVariableType, path: 'ds1.left_id.left', }, - operator: GenericOperation.equals, + operator: AnyTypeOperation.equals, right: { type: DataVariableType, path: 'ds1.right_id.right', @@ -146,7 +146,7 @@ describe('ComponentConditionalVariable', () => { type: DataVariableType, path: 'ds1.left_id.left', }, - operator: GenericOperation.equals, + operator: AnyTypeOperation.equals, right: { type: DataVariableType, path: 'ds1.right_id.right', @@ -162,7 +162,7 @@ describe('ComponentConditionalVariable', () => { type: DataVariableType, path: 'ds1.left_id.left', }, - operator: GenericOperation.equals, + operator: AnyTypeOperation.equals, right: { type: DataVariableType, path: 'ds1.right_id.right',