From 7de57683e70ba3adfb4ed2fcf868362d2389d17a Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Sat, 25 Feb 2023 19:45:16 -0600 Subject: [PATCH] Group Condition Filter not staying set #155 Ensure group conditions are set correctly resolves #155 --- libs/ui/src/lib/expression-group/ExpressionContainer.tsx | 1 + libs/ui/src/lib/expression-group/ExpressionGroup.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/ui/src/lib/expression-group/ExpressionContainer.tsx b/libs/ui/src/lib/expression-group/ExpressionContainer.tsx index 6b2ea95a0..70514aaa9 100644 --- a/libs/ui/src/lib/expression-group/ExpressionContainer.tsx +++ b/libs/ui/src/lib/expression-group/ExpressionContainer.tsx @@ -468,6 +468,7 @@ export const ExpressionContainer: FunctionComponent = groupKey={row.key} group={i + 1} parentAction={expression.action} + rowAction={row.action} onActionChange={(andOr) => handleGroupActionChange(andOr, row)} onAddCondition={() => handleAddCondition(row)} moveRowToGroup={moveRowToGroup} diff --git a/libs/ui/src/lib/expression-group/ExpressionGroup.tsx b/libs/ui/src/lib/expression-group/ExpressionGroup.tsx index b88e44a7a..a90ca7133 100644 --- a/libs/ui/src/lib/expression-group/ExpressionGroup.tsx +++ b/libs/ui/src/lib/expression-group/ExpressionGroup.tsx @@ -10,6 +10,7 @@ export interface ExpressionGroupProps { groupKey: number; group: number; parentAction: AndOr; + rowAction: AndOr; onActionChange: (value: AndOr) => void; onAddCondition: () => void; moveRowToGroup: (item: DraggableRow, targetGroup: number) => void; @@ -17,7 +18,7 @@ export interface ExpressionGroupProps { } export const ExpressionGroup: FunctionComponent = React.memo( - ({ parentAction, groupKey, group, children, onActionChange, onAddCondition, moveRowToGroup }) => { + ({ parentAction, rowAction, groupKey, group, children, onActionChange, onAddCondition, moveRowToGroup }) => { const [{ isOver, canDrop }, drop] = useDrop({ accept: 'row', collect: (monitor) => ({ @@ -42,7 +43,7 @@ export const ExpressionGroup: FunctionComponent = React.me {parentAction} {`Condition Group ${group}`} - + {children}