Skip to content

Commit

Permalink
- FIX: Fixed wrong Helium direct link export URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-raubach committed May 17, 2024
1 parent 9ce667a commit 476b4cc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"vue-template-compiler": "~2.6.14",
"webpack-bundle-analyzer": "^4.6.1"
},
"copyright": "Copyright 2023 The James Hutton Institute",
"copyright": "Copyright 2024 The James Hutton Institute",
"homepage": "https://ics.hutton.ac.uk/get-germinate",
"license": "Apache-2.0",
"repository": {
Expand Down
40 changes: 39 additions & 1 deletion src/components/structure/SidebarAsyncJobs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<div v-if="job.datatype === 'pedigree' && storeServerSettings && storeServerSettings.heliumUrl">
<HeliumIcon />
<small class="d-inline-block ml-1">
<a target="_blank" :href="`${storeServerSettings.heliumUrl}pedigree?germinateUrl=${encodeURIComponent(storeBaseUrl + 'dataset/export/async/' + job.uuid + '/download')}`" @click="updateInternal">{{ $t('buttonSendToHelium') }}</a>
<a target="_blank" :href="`${heliumUrl}?germinateUrl=${encodeURIComponent(getHeliumExportUrl(job.uuid))}`" @click="updateInternal">{{ $t('buttonSendToHelium') }}</a>
</small>
</div>
<div class="d-flex flex-row align-items-start">
Expand Down Expand Up @@ -271,6 +271,29 @@ export default {
'storeServerSettings',
'storeAsyncSidebarTabIndex'
]),
heliumUrl: function () {
if (this.storeServerSettings && this.storeServerSettings.heliumUrl) {
let url = this.storeServerSettings.heliumUrl
if (url.endsWith('/')) {
if (url.endsWith('/#/')) {
url += 'pedigree'
} else {
url += '#/pedigree'
}
} else {
if (url.endsWidth('/#')) {
url += '/pedigree'
} else {
url += '/#/pedigree'
}
}
return url
} else {
return ''
}
},
exportJobTypes: function () {
if (this.asyncExportJobs) {
return this.asyncExportJobs.map(j => {
Expand Down Expand Up @@ -315,6 +338,21 @@ export default {
methods: {
userIsAtLeast,
getNumberWithSuffix,
getHeliumExportUrl: function (jobUuid) {
const end = `dataset/export/async/${jobUuid}/download`
if (this.storeBaseUrl.startsWith('http')) {
let base = this.storeBaseUrl
if (!base.endsWith('/')) {
base += '/'
}
return `${base}${end}`
} else {
return `${window.location.protocol}//${window.location.host}${window.location.pathname}/api/${end}`
}
},
getJobVariant: function (job) {
if (job.errorStatus === 'ERROR') {
return 'danger'
Expand Down

0 comments on commit 476b4cc

Please sign in to comment.