Skip to content

Commit

Permalink
Fix "Show on Map" button
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jun 18, 2024
1 parent 4dc337a commit b7896ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/components/Asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<template v-if="hasAlternatives">
<b-tabs card>
<b-tab :title="asset.name || $t('assets.alternate.main')" active>
<AssetAlternative :asset="asset" :context="context" :shown="shown" hasAlternatives />
<AssetAlternative :asset="asset" :context="context" :shown="shown" hasAlternatives @show="show" />
</b-tab>
<b-tab v-for="(altAsset, key) in alternatives" :title="altAsset.name || key" :key="key">
<AssetAlternative :asset="altAsset" :context="context" :shown="shown" hasAlternatives :key="key" />
<AssetAlternative :asset="altAsset" :context="context" :shown="shown" hasAlternatives :key="key" @show="show" />
</b-tab>
</b-tabs>
</template>
<AssetAlternative v-else :asset="asset" :context="context" />
<AssetAlternative v-else :asset="asset" :context="context" @show="show" />
</b-collapse>
</b-card>
</template>
Expand Down Expand Up @@ -149,6 +149,9 @@ export default {
collapseToggled(isVisible) {
let event = isVisible ? 'openCollapsible' : 'closeCollapsible';
this.$store.commit(event, {type: this.type, uid: this.uid});
},
show() {
this.$emit('show', ...arguments);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export default {
}
}
};
</script>
</script>
7 changes: 5 additions & 2 deletions src/components/HrefActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ export default {
if (this.context instanceof STAC) {
baseUrl = this.context.getAbsoluteUrl();
}
return this.getRequestUrl(this.data.href, baseUrl);
try {
return this.getRequestUrl(this.data.href, baseUrl);
} catch (e) {
return this.data.href;
}
},
parsedHref() {
return URI(this.href);
Expand Down Expand Up @@ -289,7 +293,6 @@ export default {
// Use fetch because stacRequest uses axios
// and axios doesn't support responseType: 'stream'
const res = await fetch(url, options);
console.log(res);
if (res.status >= 400) {
let msg;
switch(res.status) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShowAssetMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ export default {
}
}
}
};
};

0 comments on commit b7896ba

Please sign in to comment.