From de4359e6235f96b6948a143e50250582ad9fb6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Odini?= Date: Fri, 4 Oct 2024 09:44:09 +0200 Subject: [PATCH] refactor(Proofs): show image_thumb instead of (full) file image (#924) --- src/components/ProofActionMenuButton.vue | 8 ++++++++ src/components/ProofCard.vue | 7 +++++-- src/components/ProofChip.vue | 2 +- src/i18n/locales/en.json | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/ProofActionMenuButton.vue b/src/components/ProofActionMenuButton.vue index b60153c2ae7..ec865839cee 100644 --- a/src/components/ProofActionMenuButton.vue +++ b/src/components/ProofActionMenuButton.vue @@ -11,6 +11,9 @@ {{ $t('Common.Details') }} + + {{ $t('Common.ImageFull') }} + {{ $t('Common.Edit') }} @@ -82,6 +85,11 @@ export default { } }, computed: { + getProofFullUrl() { + // return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.webp' // PRICE_TAG + // return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.webp' // RECEIPT + return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${this.proof.file_path}` + }, getProofDetailUrl() { return `/proofs/${this.proof.id}` }, diff --git a/src/components/ProofCard.vue b/src/components/ProofCard.vue index e3458cad4dd..163cfdea7d8 100644 --- a/src/components/ProofCard.vue +++ b/src/components/ProofCard.vue @@ -64,8 +64,11 @@ export default { } }, getProofUrl(proof) { - // return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.webp' // PRICE_TAG - // return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.webp' // RECEIPT + // return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.400.webp' // PRICE_TAG + // return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.400.webp' // RECEIPT + if (proof.image_thumb_path) { + return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${proof.image_thumb_path}` + } return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${proof.file_path}` }, close() { diff --git a/src/components/ProofChip.vue b/src/components/ProofChip.vue index 3626b112f41..c0713cb475b 100644 --- a/src/components/ProofChip.vue +++ b/src/components/ProofChip.vue @@ -8,7 +8,7 @@ @click="openDialog" > - + diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 600a331f503..fa503af707a 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -199,6 +199,7 @@ "Help": "Help", "History": "History", "Image": "Image", + "ImageFull": "Full-size image", "LinkCopySuccess": "Link copied", "LocationCount": "{count} locations", "Map": "Map",