feat: Update Workflow class usage on the Frontend for better performance (no-changelog) (#17680)

This commit is contained in:
Alex Grozav
2025-08-04 15:04:00 +03:00
committed by GitHub
parent ff8531d544
commit 279dce639a
66 changed files with 659 additions and 660 deletions

View File

@@ -35,7 +35,7 @@ type MappingMode = 'debugging' | 'mapping';
export type Props = {
runIndex: number;
workflow: Workflow;
workflowObject: Workflow;
pushRef: string;
activeNodeName: string;
currentNodeName?: string;
@@ -103,7 +103,7 @@ const activeNode = computed(() => workflowsStore.getNodeByName(props.activeNodeN
const rootNode = computed(() => {
if (!activeNode.value) return null;
return props.workflow.getChildNodes(activeNode.value.name, 'ALL').at(0) ?? null;
return props.workflowObject.getChildNodes(activeNode.value.name, 'ALL').at(0) ?? null;
});
const hasRootNodeRun = computed(() => {
@@ -134,12 +134,12 @@ const isActiveNodeConfig = computed(() => {
let inputs = activeNodeType.value?.inputs ?? [];
let outputs = activeNodeType.value?.outputs ?? [];
if (props.workflow && activeNode.value) {
const node = props.workflow.getNode(activeNode.value.name);
if (props.workflowObject && activeNode.value) {
const node = props.workflowObject.getNode(activeNode.value.name);
if (node && activeNodeType.value) {
inputs = NodeHelpers.getNodeInputs(props.workflow, node, activeNodeType.value);
outputs = NodeHelpers.getNodeOutputs(props.workflow, node, activeNodeType.value);
inputs = NodeHelpers.getNodeInputs(props.workflowObject, node, activeNodeType.value);
outputs = NodeHelpers.getNodeOutputs(props.workflowObject, node, activeNodeType.value);
}
}
@@ -192,7 +192,7 @@ const isExecutingPrevious = computed(() => {
const rootNodesParents = computed(() => {
if (!rootNode.value) return [];
return props.workflow.getParentNodesByDepth(rootNode.value);
return props.workflowObject.getParentNodesByDepth(rootNode.value);
});
const currentNode = computed(() => {
@@ -219,7 +219,7 @@ const parentNodes = computed(() => {
return [];
}
const parents = props.workflow
const parents = props.workflowObject
.getParentNodesByDepth(activeNode.value.name)
.filter((parent) => parent.name !== activeNode.value?.name);
return uniqBy(parents, (parent) => parent.name);
@@ -376,7 +376,7 @@ function handleChangeCollapsingColumn(columnName: string | null) {
:class="[$style.runData, { [$style.runDataV2]: isNDVV2 }]"
:node="currentNode"
:nodes="isMappingMode ? rootNodesParents : parentNodes"
:workflow="workflow"
:workflow-object="workflowObject"
:run-index="isMappingMode ? 0 : runIndex"
:linked-runs="linkedRuns"
:can-link-runs="!mappedNode && canLinkRuns"
@@ -430,7 +430,7 @@ function handleChangeCollapsingColumn(columnName: string | null) {
<InputNodeSelect
v-if="parentNodes.length && currentNodeName"
:model-value="currentNodeName"
:workflow="workflow"
:workflow="workflowObject"
:nodes="parentNodes"
@update:model-value="onInputNodeChange"
/>
@@ -444,7 +444,7 @@ function handleChangeCollapsingColumn(columnName: string | null) {
<div :class="$style.mappedNode">
<InputNodeSelect
:model-value="mappedNode"
:workflow="workflow"
:workflow="workflowObject"
:nodes="rootNodesParents"
@update:model-value="onMappedNodeSelected"
/>