Skip to content

Commit

Permalink
chore: more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed Apr 14, 2023
1 parent 546b3b6 commit 1d37237
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const NodeExecutionRow: React.FC<NodeExecutionRowProps> = ({
className={classnames(
tableStyles.rowColumn,
tableStyles.expander,
node.grayedOut ? grayedClassName : '',
node.filteredOut ? grayedClassName : '',
)}
>
<div className={styles.namesContainerExpander}>
Expand All @@ -127,7 +127,7 @@ export const NodeExecutionRow: React.FC<NodeExecutionRowProps> = ({
className={classnames(
tableStyles.rowColumn,
className,
node.grayedOut ? grayedClassName : '',
node.filteredOut ? grayedClassName : '',
)}
>
{cellRenderer({
Expand All @@ -149,7 +149,7 @@ export const NodeExecutionRow: React.FC<NodeExecutionRowProps> = ({
inputUri: '',
scopedId: node.scopedId,
},
className: node.grayedOut ? tableStyles.grayed : '',
className: node.filteredOut ? tableStyles.grayed : '',
})}
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const filterNodes = (
const result = hasFilteredChildren || shouldBeIncluded;

if (hasFilteredChildren && !shouldBeIncluded) {
node.grayedOut = true;
node.filteredOut = true;
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ export const NodeExecutionDynamicContext =

const checkEnableChildQuery = (
childExecutions: NodeExecution[],
nodeExecution: WorkflowNodeExecution,
node: dNode,
inView: boolean,
) => {
const nodeExecution = node.execution;

if(!nodeExecution){
return false
}
// check that we fetched all children otherwise force fetch
const missingChildren =
isParentNode(nodeExecution) && !childExecutions.length;
Expand All @@ -59,7 +64,7 @@ const checkEnableChildQuery = (

const executionRunning = !nodeExecutionIsTerminal(nodeExecution);

const tasksFetched = nodeExecution.tasksFetched;
const tasksFetched = (nodeExecution as WorkflowNodeExecution).tasksFetched;

const forceRefetch =
inView &&
Expand Down Expand Up @@ -122,7 +127,7 @@ export const NodeExecutionDynamicProvider = ({
() => {
const shouldRun = checkEnableChildQuery(
childExecutions,
nodeExecution!,
node,
!!overloadedInView,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/models/Graph/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface dNode {
nodes: Array<dNode>;
edges: Array<dEdge>;
expanded?: boolean;
grayedOut?: boolean;
filteredOut?: boolean;
level?: number;
execution?: WorkflowNodeExecution;
isParentNode?: boolean;
Expand Down

0 comments on commit 1d37237

Please sign in to comment.