diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index ef0d17a83c5..b854e91200f 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -1072,8 +1072,10 @@ export default { this.onNavigate(`/workflows/run?id=${this.id}`, false, false, true); }, async onNavigate(url, forceSave = false, ignoreChanges = false, appendVersion = false) { + let proceed = false; if (this.isNewTempWorkflow) { await this.onCreate(); + proceed = true; } else if (this.hasChanges && !forceSave && !ignoreChanges) { // if there are changes, prompt user to save or discard or cancel this.navUrl = url; @@ -1081,7 +1083,13 @@ export default { return; } else if (forceSave) { // when forceSave is true, save the workflow before navigating - await this.onSave(); + proceed = await this.onSave(); + } else { + // no changes to save, proceed with navigation + proceed = true; + } + if (!proceed) { + return; } if (appendVersion && this.version !== undefined) { diff --git a/client/src/entry/analysis/modules/WorkflowEditor.vue b/client/src/entry/analysis/modules/WorkflowEditor.vue index 0175b4fe489..a0d5f2f4d1e 100644 --- a/client/src/entry/analysis/modules/WorkflowEditor.vue +++ b/client/src/entry/analysis/modules/WorkflowEditor.vue @@ -44,7 +44,8 @@ export default { this.skipNextReload = false; } - this.version = parseInt(Query.get("version"), 10); + const versionParam = Query.get("version"); + this.version = versionParam !== undefined ? parseInt(versionParam, 10) : undefined; this.storedWorkflowId = Query.get("id"); this.workflowId = Query.get("workflow_id"); const workflowId = this.workflowId || this.storedWorkflowId; diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index fc9cdfa68d6..bc9f9135bbb 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -4,7 +4,6 @@ from typing import ( Optional, ) -import pytest import yaml from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By @@ -923,8 +922,6 @@ steps: self.workflow_editor_connect("nested_workflow#workflow_output", "metadata_bam#input_bam") self.assert_connected("nested_workflow#workflow_output", "metadata_bam#input_bam") - @pytest.mark.xfail - @selenium_only("Not yet migrated to support Playwright backend") @selenium_test def test_edit_subworkflow(self): self.open_in_workflow_editor(""" @@ -939,10 +936,13 @@ steps: - tool_id: create_2 label: create_2 """) + # Save after auto-layout so there are no unsaved changes + self.assert_workflow_has_changes_and_save() editor = self.components.workflow_editor node = editor.node._(label="nested_workflow") node.wait_for_and_click() editor.edit_subworkflow.wait_for_and_click() + self.sleep_for(self.wait_types.UX_RENDER) node = editor.node._(label="create_2") node.wait_for_and_click()