Fix local version switching

Fixes https://github.com/galaxyproject/galaxy/issues/14311.
Problem is that we use `:key` in
https://github.com/mvdbeek/galaxy/blob/9e4563d9eb5d8f38a48e1f01466d4fcd1fc66502/client/src/components/Form/FormDisplay.vue#L3,
so that doesn't re-render when the tool id doesn't change (which is the
case for local tools, but not toolshed tools).
This commit is contained in:
mvdbeek
2022-07-13 00:04:28 +03:00
parent 9162d57bb9
commit 3e08160102
+7 -1
View File
@@ -45,7 +45,7 @@
itemtype="https://schema.org/CreativeWork">
<template v-slot:body>
<FormDisplay
:id="formConfig.id"
:id="toolId"
:inputs="formConfig.inputs"
:validation-scroll-to="validationScrollTo"
@onChange="onChange"
@@ -185,6 +185,12 @@ export default {
toolName() {
return this.formConfig.name;
},
toolId() {
// ensure version is included in tool id, otherwise form inputs are
// not re-rendered when versions change.
const { id, version } = this.formConfig;
return id.endsWith(version) ? id : `${id}/${version}`;
},
tooltip() {
return `Execute: ${this.formConfig.name} (${this.formConfig.version})`;
},