[25.1] Fix "Create New" in workflow editor not resetting editor state

Watch `$route.query` instead of `$route.params` so the handler fires
when navigating between `?id=xxx` and no-id query strings. Also
increment `editorReloadKey` when entering a new blank workflow so the
Editor component is destroyed and re-created (clearing old state), and
reset `newWorkflow` to false when loading an existing workflow.

Fixes https://github.com/galaxyproject/galaxy/issues/21662

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Awan
2026-02-24 14:49:32 -06:00
co-authored by Claude Sonnet 4.6
parent af20447ea5
commit 1adaeeae91
@@ -29,7 +29,7 @@ export default {
};
},
watch: {
"$route.params": {
"$route.query": {
handler() {
this.getEditorConfig();
},
@@ -50,8 +50,12 @@ export default {
const workflowId = this.workflowId || this.storedWorkflowId;
if (!workflowId) {
this.newWorkflow = true;
if (reloadEditor) {
this.editorReloadKey += 1;
}
return;
}
this.newWorkflow = false;
if (this.workflowId) {
const { id: storedWorkflowId } = await getWorkflowInfo(workflowId, this.version, true);
this.storedWorkflowId = storedWorkflowId;