From 6cbde233626ac689121cebbde402e09315de28b0 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 2 May 2024 13:01:38 +1200 Subject: [PATCH 1/6] Add dataset click event from gallery --- src/components/DatasetCard.vue | 4 ++++ src/components/ImageGallery.vue | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/DatasetCard.vue b/src/components/DatasetCard.vue index 49cab748..8b5fa195 100644 --- a/src/components/DatasetCard.vue +++ b/src/components/DatasetCard.vue @@ -15,6 +15,7 @@ :dataset-biolucida="biolucidaData" :category="currentCategory" @card-clicked="galleryClicked" + @dataset-clicked="galleryDatasetClicked" />
@@ -163,6 +164,9 @@ export default { galleryClicked: function (payload) { this.propogateCardAction(payload) }, + galleryDatasetClicked: function (payload) { + EventBus.emit('dataset-clicked', payload) // Pass to mapintegratedvuer + }, openDataset: function () { window.open(this.dataLocation, '_blank') }, diff --git a/src/components/ImageGallery.vue b/src/components/ImageGallery.vue index 18c1f967..1bb1479a 100644 --- a/src/components/ImageGallery.vue +++ b/src/components/ImageGallery.vue @@ -13,6 +13,7 @@ :body-style="bodyStyle" :shadow="shadow" @card-clicked="cardClicked" + @dataset-clicked="datasetClicked" ref="gallery" />
@@ -116,6 +117,9 @@ export default { cardClicked: function (payload) { this.$emit('card-clicked', payload) }, + datasetClicked: function (payload) { + this.$emit('dataset-clicked', payload) + }, createSciCurnchItems: function () { this.updateS3Bucket(this.entry.s3uri) this.createDatasetItem() @@ -171,7 +175,7 @@ export default { let thumbnailURL = undefined let mimetype = '' if (thumbnail) { - + thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, { id, prefix: this.getS3Prefix(), From d54a992ad92230eb116cebf768da2600fb1b37a0 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 2 May 2024 13:13:18 +1200 Subject: [PATCH 2/6] Add dataset-clicked event --- src/components/SideBar.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue index df2b9d21..706b032e 100644 --- a/src/components/SideBar.vue +++ b/src/components/SideBar.vue @@ -211,6 +211,15 @@ export default { */ this.$emit('contextUpdate', payLoad) }) + EventBus.on('dataset-clicked', (payLoad) => { + /** + * This event is emitted + * when the dataset button or dataset image thumbnail + * from the gallery component is clicked. + * @arg payload + */ + this.$emit('dataset-clicked', payLoad) + }) }, } From da6eb9654ac365084e82244ba2a17c1aa480bb64 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 3 May 2024 09:53:34 +1200 Subject: [PATCH 3/6] Add missing semicolons --- src/components/DatasetCard.vue | 2 +- src/components/ImageGallery.vue | 2 +- src/components/SideBar.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DatasetCard.vue b/src/components/DatasetCard.vue index 8b5fa195..d0b692a6 100644 --- a/src/components/DatasetCard.vue +++ b/src/components/DatasetCard.vue @@ -165,7 +165,7 @@ export default { this.propogateCardAction(payload) }, galleryDatasetClicked: function (payload) { - EventBus.emit('dataset-clicked', payload) // Pass to mapintegratedvuer + EventBus.emit('dataset-clicked', payload); // Pass to mapintegratedvuer }, openDataset: function () { window.open(this.dataLocation, '_blank') diff --git a/src/components/ImageGallery.vue b/src/components/ImageGallery.vue index 1bb1479a..f2783f89 100644 --- a/src/components/ImageGallery.vue +++ b/src/components/ImageGallery.vue @@ -118,7 +118,7 @@ export default { this.$emit('card-clicked', payload) }, datasetClicked: function (payload) { - this.$emit('dataset-clicked', payload) + this.$emit('dataset-clicked', payload); }, createSciCurnchItems: function () { this.updateS3Bucket(this.entry.s3uri) diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue index 706b032e..c751a1d5 100644 --- a/src/components/SideBar.vue +++ b/src/components/SideBar.vue @@ -218,7 +218,7 @@ export default { * from the gallery component is clicked. * @arg payload */ - this.$emit('dataset-clicked', payLoad) + this.$emit('dataset-clicked', payLoad); }) }, } From b7b44113adc33e163722a9f7f8235a7168f1757d Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 3 May 2024 11:53:39 +1200 Subject: [PATCH 4/6] Rename dataset click to datalink click --- src/components/DatasetCard.vue | 6 +++--- src/components/ImageGallery.vue | 6 +++--- src/components/SideBar.vue | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/DatasetCard.vue b/src/components/DatasetCard.vue index d0b692a6..8bf89a31 100644 --- a/src/components/DatasetCard.vue +++ b/src/components/DatasetCard.vue @@ -15,7 +15,7 @@ :dataset-biolucida="biolucidaData" :category="currentCategory" @card-clicked="galleryClicked" - @dataset-clicked="galleryDatasetClicked" + @datalink-clicked="galleryDatalinkClicked" />
@@ -164,8 +164,8 @@ export default { galleryClicked: function (payload) { this.propogateCardAction(payload) }, - galleryDatasetClicked: function (payload) { - EventBus.emit('dataset-clicked', payload); // Pass to mapintegratedvuer + galleryDatalinkClicked: function (payload) { + EventBus.emit('datalink-clicked', payload); // Pass to mapintegratedvuer }, openDataset: function () { window.open(this.dataLocation, '_blank') diff --git a/src/components/ImageGallery.vue b/src/components/ImageGallery.vue index f2783f89..bab86df4 100644 --- a/src/components/ImageGallery.vue +++ b/src/components/ImageGallery.vue @@ -13,7 +13,7 @@ :body-style="bodyStyle" :shadow="shadow" @card-clicked="cardClicked" - @dataset-clicked="datasetClicked" + @datalink-clicked="datalinkClicked" ref="gallery" />
@@ -117,8 +117,8 @@ export default { cardClicked: function (payload) { this.$emit('card-clicked', payload) }, - datasetClicked: function (payload) { - this.$emit('dataset-clicked', payload); + datalinkClicked: function (payload) { + this.$emit('datalink-clicked', payload); }, createSciCurnchItems: function () { this.updateS3Bucket(this.entry.s3uri) diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue index c751a1d5..35b7943b 100644 --- a/src/components/SideBar.vue +++ b/src/components/SideBar.vue @@ -211,14 +211,14 @@ export default { */ this.$emit('contextUpdate', payLoad) }) - EventBus.on('dataset-clicked', (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('dataset-clicked', payLoad); + this.$emit('datalink-clicked', payLoad); }) }, } From aee0f02b86916e7086d6d0954f763ff5115e4edc Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 3 May 2024 11:58:45 +1200 Subject: [PATCH 5/6] Add datalink click event for testing --- src/App.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 3978eb3b..6b930851 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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) + }); }, } From 54a6c694c6d5a7cf3edc9b8e3994ab6e211c6d9d Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 10 May 2024 10:30:53 +1200 Subject: [PATCH 6/6] Update gallery version for PR #70 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d933813b..b3952b5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "@abi-software/map-side-bar", "version": "2.0.1", "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", @@ -51,9 +51,9 @@ } }, "node_modules/@abi-software/gallery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-1.0.0.tgz", - "integrity": "sha512-cVhxBEEbM9SEYphVmjXJI0GJVsyPH9BYWpXuesjTrUGhE5irmWjd25+8YsjYDZ7DNoigQt6mSshZQ2KsTG2SEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-1.1.0.tgz", + "integrity": "sha512-TZCqcqxZdC4wW35KJwBq96yXX8cd7pjGSqvaFLEtWhbe+mqsSrqhgnk/jbvN14/JtOFyo9S7KpBFKvLHFrwWJA==", "dependencies": { "axios": "^1.6.5", "element-plus": "^2.4.4", diff --git a/package.json b/package.json index 898108e8..2e3edf27 100644 --- a/package.json +++ b/package.json @@ -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",