Skip to content

Commit

Permalink
Merge pull request #70 from akhuoa/feature/dataset-click-event
Browse files Browse the repository at this point in the history
Add dataset click event
  • Loading branch information
alan-wu authored May 9, 2024
2 parents 32a0fa5 + 54a6c69 commit 58c060d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"./src/*": "./src/*"
},
"dependencies": {
"@abi-software/gallery": "^1.0.0",
"@abi-software/gallery": "^1.1.0",
"@abi-software/svg-sprite": "^1.0.0",
"@element-plus/icons-vue": "^2.3.1",
"algoliasearch": "^4.10.5",
Expand Down
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ export default {
console.log('mounted app')
EventBus.on('contextUpdate', (payLoad) => {
console.log('contextUpdate', payLoad)
})
});
EventBus.on('datalink-clicked', (payLoad) => {
console.log('datalink-clicked', payLoad)
});
},
}
</script>
Expand Down
4 changes: 4 additions & 0 deletions src/components/DatasetCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:dataset-biolucida="biolucidaData"
:category="currentCategory"
@card-clicked="galleryClicked"
@datalink-clicked="galleryDatalinkClicked"
/>
</span>
<div class="card-right">
Expand Down Expand Up @@ -163,6 +164,9 @@ export default {
galleryClicked: function (payload) {
this.propogateCardAction(payload)
},
galleryDatalinkClicked: function (payload) {
EventBus.emit('datalink-clicked', payload); // Pass to mapintegratedvuer
},
openDataset: function () {
window.open(this.dataLocation, '_blank')
},
Expand Down
6 changes: 5 additions & 1 deletion src/components/ImageGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:body-style="bodyStyle"
:shadow="shadow"
@card-clicked="cardClicked"
@datalink-clicked="datalinkClicked"
ref="gallery"
/>
</div>
Expand Down Expand Up @@ -116,6 +117,9 @@ export default {
cardClicked: function (payload) {
this.$emit('card-clicked', payload)
},
datalinkClicked: function (payload) {
this.$emit('datalink-clicked', payload);
},
createSciCurnchItems: function () {
this.updateS3Bucket(this.entry.s3uri)
this.createDatasetItem()
Expand Down Expand Up @@ -171,7 +175,7 @@ export default {
let thumbnailURL = undefined
let mimetype = ''
if (thumbnail) {
thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
id,
prefix: this.getS3Prefix(),
Expand Down
9 changes: 9 additions & 0 deletions src/components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ export default {
*/
this.$emit('contextUpdate', payLoad)
})
EventBus.on('datalink-clicked', (payLoad) => {
/**
* This event is emitted
* when the dataset button or dataset image thumbnail
* from the gallery component is clicked.
* @arg payload
*/
this.$emit('datalink-clicked', payLoad);
})
},
}
</script>
Expand Down

0 comments on commit 58c060d

Please sign in to comment.