Skip to content

Commit

Permalink
fixed the issue with shared reference of the conditionValue object ac…
Browse files Browse the repository at this point in the history
…ross components, causing changes made in one component to affect the other
  • Loading branch information
satti-hari-krishna-reddy committed Feb 24, 2024
1 parent 961a629 commit e7ae46a
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions frontend/src/views/AngularWorkflow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9548,8 +9548,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
tmpConditionValue.value = "equals";
setTmpConditionValue(tmpConditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "equals";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"equals"}
Expand All @@ -9559,8 +9560,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
tmpConditionValue.value = "does not equal";
setTmpConditionValue(tmpConditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "does not equal";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"does not equal"}
Expand All @@ -9570,8 +9572,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "startswith";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "startswith";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"starts with"}
Expand All @@ -9581,8 +9584,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "endswith";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "endswith";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"ends with"}
Expand All @@ -9592,8 +9596,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "contains";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "contains";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"contains"}
Expand All @@ -9603,8 +9608,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "contains_any_of";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "contains_any_of";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"contains_any_of"}
Expand All @@ -9614,8 +9620,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "matches regex";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "matches regex";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"matches regex"}
Expand All @@ -9625,8 +9632,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "larger than";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "larger than";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"larger than"}
Expand All @@ -9636,8 +9644,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "less than";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "less than";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"less than"}
Expand All @@ -9647,8 +9656,9 @@ if (
<MenuItem
style={menuItemStyle}
onClick={(e) => {
conditionValue.value = "is empty";
setConditionValue(conditionValue);
const newConditionValue = { ...conditionValue };
newConditionValue.value = "is empty";
setConditionValue(newConditionValue);
setVariableAnchorEl(null);
}}
key={"is empty"}
Expand Down

0 comments on commit e7ae46a

Please sign in to comment.