mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(editor): Ensure no running node when execution finished (#15299)
This commit is contained in:
@@ -290,6 +290,13 @@ describe('NDV', () => {
|
||||
workflowPage.actions.openNode('Switch1');
|
||||
ndv.actions.execute();
|
||||
|
||||
ndv.getters.parameterExpressionPreview('output').should('include.text', '1');
|
||||
ndv.getters.parameterExpressionPreview('output').should('have.text', '1');
|
||||
ndv.getters.inlineExpressionEditorInput().click();
|
||||
ndv.getters.inlineExpressionEditorOutput().should('have.text', '1');
|
||||
ndv.actions.expressionSelectNextItem();
|
||||
ndv.getters.inlineExpressionEditorOutput().should('have.text', '3');
|
||||
ndv.actions.expressionSelectNextItem();
|
||||
ndv.getters.inlineExpressionEditorOutput().should('have.text', '1');
|
||||
ndv.getters.inlineExpressionEditorItemNextButton().should('be.disabled');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ import type {
|
||||
ExpressionError,
|
||||
IDataObject,
|
||||
IRunExecutionData,
|
||||
IRunData,
|
||||
} from 'n8n-workflow';
|
||||
import { codeNodeEditorEventBus, globalLinkActionsEventBus } from '@/event-bus';
|
||||
import { h } from 'vue';
|
||||
@@ -466,6 +467,8 @@ export function setRunExecutionData(
|
||||
runExecutionData.resultData.runData = workflowsStore.getWorkflowRunData;
|
||||
}
|
||||
|
||||
removeRunningTaskData(runExecutionData.resultData.runData);
|
||||
|
||||
workflowsStore.executingNode.length = 0;
|
||||
|
||||
workflowsStore.setWorkflowExecutionData({
|
||||
@@ -505,3 +508,11 @@ export function setRunExecutionData(
|
||||
const lineNumber = runExecutionData.resultData?.error?.lineNumber;
|
||||
codeNodeEditorEventBus.emit('highlightLine', lineNumber ?? 'last');
|
||||
}
|
||||
|
||||
function removeRunningTaskData(runData: IRunData): void {
|
||||
for (const [nodeName, taskItems] of Object.entries(runData)) {
|
||||
if (taskItems.some((item) => item.executionStatus === 'running')) {
|
||||
runData[nodeName] = taskItems.filter((item) => item.executionStatus !== 'running');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user