🐛 Fix workflow execution bugs (#1941)

This commit is contained in:
Mutasem Aldmour 2021-06-27 09:37:53 +03:00 committed by GitHub
parent 004979f592
commit f940ba8f71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -349,6 +349,7 @@ export default mixins(
this.$externalHooks().run('nodeView.createNodeActiveChanged', { source: 'add_node_button' });
},
async openExecution (executionId: string) {
this.resetWorkspace();
let data: IExecutionResponse | undefined;
try {
@ -368,6 +369,10 @@ export default mixins(
this.$store.commit('setWorkflowExecutionData', data);
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 });
},
@ -824,6 +829,10 @@ export default mixins(
zoomToFit () {
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 PADDING = NODE_SIZE * 4;