diff --git a/client/src/components/Workflow/TrsImport.vue b/client/src/components/Workflow/TrsImport.vue index 04a22a1ec57b..3ec341dbdba7 100644 --- a/client/src/components/Workflow/TrsImport.vue +++ b/client/src/components/Workflow/TrsImport.vue @@ -105,9 +105,20 @@ export default { this.trsTool = tool; this.errorMessage = null; if (this.isAutoImport) { - const version = this.trsTool.versions.find((version) => version.id === this.queryTrsVersionId); + /* Resolve discrepancy between workflowhub, which sends an id as query parameter, + and dockstore, which uses the version name as the query parameter. + Should just be one of them eventually. */ + let versionField = "name"; + const version = this.trsTool.versions.find((version) => { + if (version.name === this.queryTrsVersionId) { + return true; + } else if (version.id === this.queryTrsVersionId) { + versionField = "id"; + return true; + } + }); if (version) { - this.importVersion(this.trsTool.id, version, this.isRun); + this.importVersion(this.trsTool.id, version[versionField], this.isRun); } else { Toast.warning(`Specified version: ${this.queryTrsVersionId} doesn't exist`); this.isAutoImport = false; diff --git a/client/src/components/Workflow/trsMixin.js b/client/src/components/Workflow/trsMixin.js index dfd944df435d..32a9ab780f04 100644 --- a/client/src/components/Workflow/trsMixin.js +++ b/client/src/components/Workflow/trsMixin.js @@ -11,7 +11,7 @@ export default { methods: { importVersion(toolId, version, isRunFormRedirect = false) { this.services - .importTrsTool(this.trsSelection.id, toolId, version.name) + .importTrsTool(this.trsSelection.id, toolId, version) .then((response_data) => { redirectOnImport(getAppRoot(), response_data, isRunFormRedirect); })