mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
🐛 Fix workflow execution bugs (#1941)
This commit is contained in:
parent
004979f592
commit
f940ba8f71
|
@ -349,6 +349,7 @@ export default mixins(
|
||||||
this.$externalHooks().run('nodeView.createNodeActiveChanged', { source: 'add_node_button' });
|
this.$externalHooks().run('nodeView.createNodeActiveChanged', { source: 'add_node_button' });
|
||||||
},
|
},
|
||||||
async openExecution (executionId: string) {
|
async openExecution (executionId: string) {
|
||||||
|
this.resetWorkspace();
|
||||||
|
|
||||||
let data: IExecutionResponse | undefined;
|
let data: IExecutionResponse | undefined;
|
||||||
try {
|
try {
|
||||||
|
@ -368,6 +369,10 @@ export default mixins(
|
||||||
this.$store.commit('setWorkflowExecutionData', data);
|
this.$store.commit('setWorkflowExecutionData', data);
|
||||||
|
|
||||||
await this.addNodes(JSON.parse(JSON.stringify(data.workflowData.nodes)), JSON.parse(JSON.stringify(data.workflowData.connections)));
|
await this.addNodes(JSON.parse(JSON.stringify(data.workflowData.nodes)), JSON.parse(JSON.stringify(data.workflowData.connections)));
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.zoomToFit();
|
||||||
|
this.$store.commit('setStateDirty', false);
|
||||||
|
});
|
||||||
|
|
||||||
this.$externalHooks().run('execution.open', { workflowId: data.workflowData.id, workflowName: data.workflowData.name, executionId });
|
this.$externalHooks().run('execution.open', { workflowId: data.workflowData.id, workflowName: data.workflowData.name, executionId });
|
||||||
},
|
},
|
||||||
|
@ -824,6 +829,10 @@ export default mixins(
|
||||||
zoomToFit () {
|
zoomToFit () {
|
||||||
const nodes = this.$store.getters.allNodes as INodeUi[];
|
const nodes = this.$store.getters.allNodes as INodeUi[];
|
||||||
|
|
||||||
|
if (nodes.length === 0) { // some unknown workflow executions
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const {minX, minY, maxX, maxY} = getWorkflowCorners(nodes);
|
const {minX, minY, maxX, maxY} = getWorkflowCorners(nodes);
|
||||||
|
|
||||||
const PADDING = NODE_SIZE * 4;
|
const PADDING = NODE_SIZE * 4;
|
||||||
|
|
Loading…
Reference in a new issue