count block children in determining whether to enable debugging via b… (#3067)
This commit is contained in:
@@ -89,6 +89,7 @@ import {
|
|||||||
descendants,
|
descendants,
|
||||||
generateNodeLabel,
|
generateNodeLabel,
|
||||||
getAdditionalParametersForEmailBlock,
|
getAdditionalParametersForEmailBlock,
|
||||||
|
getOrderedChildrenBlocks,
|
||||||
getOutputParameterKey,
|
getOutputParameterKey,
|
||||||
getWorkflowBlocks,
|
getWorkflowBlocks,
|
||||||
getWorkflowErrors,
|
getWorkflowErrors,
|
||||||
@@ -397,10 +398,21 @@ function FlowRenderer({
|
|||||||
}, [nodesInitialized]);
|
}, [nodesInitialized]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const blocks = getWorkflowBlocks(nodes, edges);
|
const topLevelBlocks = getWorkflowBlocks(nodes, edges);
|
||||||
const debuggable = blocks.filter((block) =>
|
const debuggable = topLevelBlocks.filter((block) =>
|
||||||
debuggableWorkflowBlockTypes.has(block.block_type),
|
debuggableWorkflowBlockTypes.has(block.block_type),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
for (const node of nodes) {
|
||||||
|
const childBlocks = getOrderedChildrenBlocks(nodes, edges, node.id);
|
||||||
|
|
||||||
|
for (const child of childBlocks) {
|
||||||
|
if (debuggableWorkflowBlockTypes.has(child.block_type)) {
|
||||||
|
debuggable.push(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setDebuggableBlockCount(debuggable.length);
|
setDebuggableBlockCount(debuggable.length);
|
||||||
}, [nodes, edges]);
|
}, [nodes, edges]);
|
||||||
|
|
||||||
|
|||||||
@@ -2242,6 +2242,7 @@ export {
|
|||||||
getLabelForWorkflowParameterType,
|
getLabelForWorkflowParameterType,
|
||||||
maxNestingLevel,
|
maxNestingLevel,
|
||||||
getWorkflowSettings,
|
getWorkflowSettings,
|
||||||
|
getOrderedChildrenBlocks,
|
||||||
getOutputParameterKey,
|
getOutputParameterKey,
|
||||||
getPreviousNodeIds,
|
getPreviousNodeIds,
|
||||||
getUniqueLabelForExistingNode,
|
getUniqueLabelForExistingNode,
|
||||||
|
|||||||
Reference in New Issue
Block a user