Skip to content

Commit

Permalink
ensure correct version routed to on workflow run
Browse files Browse the repository at this point in the history
This is a bug caused in galaxyproject#18378 which made the `SaveChangesModal` useless because the version before the save was routed to.
Now, we instead append the version to the route after the user confirms the save (or doesn't) in the modal.
  • Loading branch information
ahmedhamidawan committed Jun 18, 2024
1 parent 72217d1 commit b5cabbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -801,12 +801,9 @@ export default {
this.report.markdown = markdown;
},
onRun() {
const runUrl = `/workflows/run?id=${this.id}${
this.version !== undefined ? `&version=${this.version}` : ""
}`;
this.onNavigate(runUrl);
this.onNavigate(`/workflows/run?id=${this.id}`, false, false, true);
},
async onNavigate(url, forceSave = false, ignoreChanges = false) {
async onNavigate(url, forceSave = false, ignoreChanges = false, appendVersion = false) {
if (this.isNewTempWorkflow) {
await this.onCreate();
} else if (this.hasChanges && !forceSave && !ignoreChanges) {
Expand All @@ -819,6 +816,9 @@ export default {
await this.onSave();
}
if (appendVersion && this.version !== undefined) {
url += `&version=${this.version}`;
}
this.hasChanges = false;
await nextTick();
this.$router.push(url);
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Workflow/Editor/SaveChangesModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const busy = ref(false);
const emit = defineEmits<{
/** Proceed with or without saving the changes */
(e: "on-proceed", url: string, forceSave: boolean, ignoreChanges: boolean): void;
(e: "on-proceed", url: string, forceSave: boolean, ignoreChanges: boolean, appendVersion: boolean): void;
/** Update the nav URL prop */
(e: "update:nav-url", url: string): void;
/** Update the show modal boolean prop */
Expand All @@ -49,13 +49,13 @@ function closeModal() {
function dontSave() {
busy.value = true;
emit("on-proceed", props.navUrl, false, true);
emit("on-proceed", props.navUrl, false, true, true);
}
function saveChanges() {
busy.value = true;
closeModal();
emit("on-proceed", props.navUrl, true, false);
emit("on-proceed", props.navUrl, true, false, true);
}
</script>

Expand Down

0 comments on commit b5cabbf

Please sign in to comment.