From 5a516284261c5acd1e1b352730cb2148c061c414 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 5 Sep 2024 16:21:09 +0200 Subject: [PATCH] refactor: homogenise getShareLinkUrl. Add missing data-name --- src/components/LocationActionMenuButton.vue | 7 ++++++- src/components/LocationCard.vue | 1 + src/components/PriceActionMenuButton.vue | 5 ++++- src/components/ProductActionMenuButton.vue | 7 ++++++- src/components/ProductCard.vue | 2 +- src/components/ProofCard.vue | 2 +- src/components/UserActionMenuButton.vue | 7 ++++++- src/components/UserCard.vue | 1 + src/views/UserDashboardPriceList.vue | 5 ++++- 9 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/components/LocationActionMenuButton.vue b/src/components/LocationActionMenuButton.vue index 4f8fb01d2b6..9acddaa4f5a 100644 --- a/src/components/LocationActionMenuButton.vue +++ b/src/components/LocationActionMenuButton.vue @@ -3,7 +3,7 @@ mdi-dots-vertical - + @@ -28,6 +28,11 @@ export default { type: String, default: 'position:absolute;bottom:6px;right:0;' } + }, + computed: { + getShareLinkUrl() { + return `/locations/${this.location.id}` + } } } diff --git a/src/components/LocationCard.vue b/src/components/LocationCard.vue index d89b3493d45..845ceb41125 100644 --- a/src/components/LocationCard.vue +++ b/src/components/LocationCard.vue @@ -3,6 +3,7 @@ :title="getLocationTitle(location)" :subtitle="location ? location.osm_display_name : ''" :prepend-icon="location ? 'mdi-map-marker-outline' : 'mdi-map-marker-remove-variant'" + data-name="location-card" @click="goToLocation(location)" > diff --git a/src/components/PriceActionMenuButton.vue b/src/components/PriceActionMenuButton.vue index ec2748957d7..aa880a6acbd 100644 --- a/src/components/PriceActionMenuButton.vue +++ b/src/components/PriceActionMenuButton.vue @@ -18,7 +18,7 @@ {{ $t('Common.Price') }} - + {{ $t('Common.Details') }} @@ -115,6 +115,9 @@ export default { showPriceShare() { return this.$route.path === this.getPriceDetailUrl }, + getShareLinkUrl() { + return this.getPriceDetailUrl + }, userIsPriceOwner() { return this.username && (this.price.owner === this.username) } diff --git a/src/components/ProductActionMenuButton.vue b/src/components/ProductActionMenuButton.vue index a1170fb8f91..43ed9d29a31 100644 --- a/src/components/ProductActionMenuButton.vue +++ b/src/components/ProductActionMenuButton.vue @@ -4,7 +4,7 @@ - + @@ -30,6 +30,11 @@ export default { type: String, default: 'position:absolute;bottom:6px;right:0;' } + }, + computed: { + getShareLinkUrl() { + return `/products/${this.product.code}` + } } } diff --git a/src/components/ProductCard.vue b/src/components/ProductCard.vue index 0ab069400f0..97233b046c7 100644 --- a/src/components/ProductCard.vue +++ b/src/components/ProductCard.vue @@ -1,5 +1,5 @@