Skip to content

Commit

Permalink
Merge pull request #17330 from ElectronicBlueberry/fix-workflow-id-re…
Browse files Browse the repository at this point in the history
…activity-23-2

[23.2] Fix Subworkflow Edit Button
  • Loading branch information
martenson authored Jan 20, 2024
2 parents f9ebc5b + 3dc6315 commit 24dd984
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
14 changes: 9 additions & 5 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,15 @@ export default {
const runUrl = `/workflows/run?id=${this.id}`;
this.onNavigate(runUrl);
},
onNavigate(url) {
this.onSave(true).then(() => {
this.hasChanges = false;
this.$router.push(url);
});
async onNavigate(url) {
if (this.isNewTempWorkflow) {
await this.onCreate();
} else {
await this.onSave(true);
}
this.hasChanges = false;
this.$router.push(url);
},
onSave(hideProgress = false) {
if (!this.nameValidate()) {
Expand Down
28 changes: 22 additions & 6 deletions client/src/entry/analysis/modules/WorkflowEditor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<Editor
v-if="editorConfig"
:key="editorReloadKey"
:workflow-id="editorConfig.id"
:data-managers="editorConfig.dataManagers"
:initial-version="editorConfig.initialVersion"
Expand All @@ -23,6 +24,7 @@ export default {
storedWorkflowId: null,
workflowId: null,
editorConfig: null,
editorReloadKey: 0,
};
},
watch: {
Expand All @@ -35,15 +37,29 @@ export default {
},
methods: {
async getEditorConfig() {
const storedWorkflowId = Query.get("id");
const workflowId = Query.get("workflow_id");
let reloadEditor = true;
// this will only be the case the first time the route updates from a new workflow
if (!this.storedWorkflowId && !this.workflowId) {
reloadEditor = false;
}
this.storedWorkflowId = Query.get("id");
this.workflowId = Query.get("workflow_id");
const params = {};
if (workflowId) {
params.workflow_id = workflowId;
} else if (storedWorkflowId) {
params.id = storedWorkflowId;
if (this.workflowId) {
params.workflow_id = this.workflowId;
} else if (this.storedWorkflowId) {
params.id = this.storedWorkflowId;
}
this.editorConfig = await urlData({ url: "/workflow/editor", params });
if (reloadEditor) {
this.editorReloadKey += 1;
}
},
},
};
Expand Down

0 comments on commit 24dd984

Please sign in to comment.