From f891a806ea67f7dbb76b590a44876554b85a13cd Mon Sep 17 00:00:00 2001
From: Raphael Odini
Date: Sat, 25 May 2024 15:01:45 +0200
Subject: [PATCH] Fix files
---
.github/labeler.yml | 6 +-
eslint.config.js | 2 +
src/components/BarcodeManualInputDialog.vue | 11 +-
src/components/BarcodeScannerDialog.vue | 15 +-
src/components/ChangeCurrencyDialog.vue | 10 +-
src/components/FilterMenu.vue | 15 +-
src/components/Footer.vue | 28 ++-
src/components/Header.vue | 40 ++--
src/components/LocationCard.vue | 7 +-
src/components/LocationSelectorDialog.vue | 63 +++--
src/components/OpenFoodFactsAddMenu.vue | 20 +-
src/components/OrderMenu.vue | 9 +-
src/components/PriceActionMenuButton.vue | 35 ++-
src/components/PriceAddButton.vue | 3 +-
src/components/PriceCard.vue | 96 +++++---
src/components/PriceCountChip.vue | 12 +-
.../PriceDeleteConfirmationDialog.vue | 27 ++-
src/components/PriceEditDialog.vue | 37 +--
src/components/PriceFooterRow.vue | 40 ++--
src/components/PriceInputRow.vue | 46 ++--
src/components/PriceLabels.vue | 7 +-
src/components/PriceLocationChip.vue | 12 +-
src/components/PriceOrigins.vue | 6 +-
src/components/PriceOwnerChip.vue | 12 +-
src/components/PricePriceRow.vue | 22 +-
src/components/PriceProof.vue | 14 +-
src/components/ProductBarcodeChip.vue | 9 +-
src/components/ProductBrands.vue | 17 +-
src/components/ProductBrandsDialog.vue | 10 +-
src/components/ProductCard.vue | 72 +++---
src/components/ProductCategoriesChip.vue | 14 +-
src/components/ProductCategoriesDialog.vue | 10 +-
src/components/ProductLabelsChip.vue | 13 +-
src/components/ProductLabelsDialog.vue | 10 +-
src/components/ProductQuantityChip.vue | 22 +-
src/components/ProofActionMenuButton.vue | 35 ++-
src/components/ProofCard.vue | 20 +-
.../ProofDeleteConfirmationDialog.vue | 27 ++-
src/components/ProofEditDialog.vue | 19 +-
src/components/ProofFooter.vue | 25 +-
src/components/ProofPrivateChip.vue | 7 +-
src/components/ProofTypeChip.vue | 9 +-
src/components/RelativeDateTimeChip.vue | 11 +-
src/components/ShareButton.vue | 15 +-
src/components/UserCard.vue | 7 +-
src/components/UserRecentProofsDialog.vue | 12 +-
src/i18n/localeManager.js | 2 -
src/store.js | 3 -
src/utils.js | 2 +-
src/views/AddPriceHome.vue | 30 ++-
src/views/AddPriceMultiple.vue | 216 ++++++++++--------
src/views/AddPriceSingle.vue | 170 ++++++++------
src/views/BrandDetail.vue | 53 +++--
src/views/CategoryDetail.vue | 53 +++--
src/views/Home.vue | 30 ++-
src/views/LocationDetail.vue | 64 +++---
src/views/LocationList.vue | 12 +-
src/views/PriceList.vue | 12 +-
src/views/ProductDetail.vue | 84 +++----
src/views/ProductList.vue | 34 +--
src/views/ProofDetail.vue | 30 +--
src/views/Search.vue | 39 ++--
src/views/SignIn.vue | 17 +-
src/views/Stats.vue | 10 +-
src/views/User.vue | 9 -
src/views/UserDashboard.vue | 8 +-
src/views/UserDashboardPriceList.vue | 18 +-
src/views/UserDashboardProofList.vue | 21 +-
src/views/UserDetail.vue | 52 +++--
src/views/UserList.vue | 12 +-
src/views/UserSettings.vue | 68 +++---
71 files changed, 1186 insertions(+), 822 deletions(-)
delete mode 100644 src/views/User.vue
diff --git a/.github/labeler.yml b/.github/labeler.yml
index eaf6a94fca..e6c79fcbf6 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -5,8 +5,7 @@ GitHub Actions:
Price addition:
- 'src/views/AddPriceHome.vue'
-
-Multiple price addition:
+- 'src/views/AddPriceSingle.vue'
- 'src/views/AddPriceMultiple.vue'
Brands:
@@ -21,13 +20,11 @@ Brands:
🔍 Search:
- 'src/views/Search.vue'
-- 'src/views/SignIn.vue'
Stats:
- 'src/views/Stats.vue'
User:
-- 'src/views/User.vue'
- 'src/views/UserList.vue'
- 'src/views/UserDetail.vue'
@@ -36,4 +33,3 @@ User dashboard:
⚙️ Settings:
- 'src/views/UserSettings.vue'
-
diff --git a/eslint.config.js b/eslint.config.js
index 83715b7ce5..55576e4373 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -9,6 +9,8 @@ export default [
},
{
rules: {
+ 'no-unused-vars': 'warn',
+ 'vue/no-mutating-props': ['error', { 'shallowOnly': true }],
'vue/no-reserved-component-names': 'off',
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off',
diff --git a/src/components/BarcodeManualInputDialog.vue b/src/components/BarcodeManualInputDialog.vue
index 243db3c575..203fc6ef2e 100644
--- a/src/components/BarcodeManualInputDialog.vue
+++ b/src/components/BarcodeManualInputDialog.vue
@@ -2,10 +2,10 @@
- {{ $t('BarcodeManualInput.Title') }}
+ {{ $t('BarcodeManualInput.Title') }}
-
+
@@ -18,13 +18,15 @@
prepend-inner-icon="mdi-barcode"
:hint="barcodeForm.barcode.length.toString()"
persistent-hint
- >
+ />
{{ $t('BarcodeManualInput.Submit') }}
+ >
+ {{ $t('BarcodeManualInput.Submit') }}
+
@@ -33,6 +35,7 @@
diff --git a/src/components/PriceLabels.vue b/src/components/PriceLabels.vue
index a67da31ace..6f6126ce48 100644
--- a/src/components/PriceLabels.vue
+++ b/src/components/PriceLabels.vue
@@ -2,7 +2,7 @@
{{ label.name }}
-
+
@@ -12,7 +12,10 @@ import LabelTags from '../data/labels-tags.json'
export default {
props: {
- priceLabels: Array
+ priceLabels: {
+ type: Array,
+ default: () => []
+ }
},
computed: {
priceLabelsTagsList() {
diff --git a/src/components/PriceLocationChip.vue b/src/components/PriceLocationChip.vue
index 0d7da2f0da..aa2c5de624 100644
--- a/src/components/PriceLocationChip.vue
+++ b/src/components/PriceLocationChip.vue
@@ -1,6 +1,6 @@
-
+
{{ priceLocationTitle }}
{{ priceLocationEmoji }}
@@ -11,8 +11,14 @@ import utils from '../utils.js'
export default {
props: {
- 'price': null,
- 'readonly': false
+ price: {
+ type: Object,
+ default: null
+ },
+ readonly: {
+ type: Boolean,
+ default: false
+ },
},
computed: {
priceLocationTitle() {
diff --git a/src/components/PriceOrigins.vue b/src/components/PriceOrigins.vue
index bc615d87f3..5edb2c6a0c 100644
--- a/src/components/PriceOrigins.vue
+++ b/src/components/PriceOrigins.vue
@@ -9,7 +9,11 @@ import OriginTags from '../data/origins-tags.json'
export default {
props: {
- priceOrigins: Array
+ priceOrigins: {
+ type: Array,
+ default: () => []
+
+ }
},
computed: {
priceOriginTagName() {
diff --git a/src/components/PriceOwnerChip.vue b/src/components/PriceOwnerChip.vue
index bb4a8cdc28..2b48f66970 100644
--- a/src/components/PriceOwnerChip.vue
+++ b/src/components/PriceOwnerChip.vue
@@ -1,6 +1,6 @@
-
+
{{ price.owner }}
@@ -8,8 +8,14 @@
diff --git a/src/components/ProductBrands.vue b/src/components/ProductBrands.vue
index 5c657d53b6..35ee05c2f1 100644
--- a/src/components/ProductBrands.vue
+++ b/src/components/ProductBrands.vue
@@ -10,14 +10,16 @@
-
+ :brands="getProductBrandsList"
+ @close="productBrandsDialog = false"
+ />
{{ $t('ProductCard.BrandLower') }}
- {{ $t('ProductCard.BrandMissing') }}
+
+ {{ $t('ProductCard.BrandMissing') }}
+
@@ -26,10 +28,13 @@ import { defineAsyncComponent } from 'vue'
export default {
components: {
- 'ProductBrandsDialog': defineAsyncComponent(() => import('../components/ProductBrandsDialog.vue')),
+ ProductBrandsDialog: defineAsyncComponent(() => import('../components/ProductBrandsDialog.vue')),
},
props: {
- productBrands: String,
+ productBrands: {
+ type: String,
+ default: null
+ },
readonly: {
type: Boolean,
default: false
diff --git a/src/components/ProductBrandsDialog.vue b/src/components/ProductBrandsDialog.vue
index e7233e7311..45d3e83930 100644
--- a/src/components/ProductBrandsDialog.vue
+++ b/src/components/ProductBrandsDialog.vue
@@ -2,10 +2,10 @@
- {{ $t('ProductCard.Brands') }}
+ {{ $t('ProductCard.Brands') }}
-
+
@@ -19,8 +19,12 @@
diff --git a/src/components/ProofTypeChip.vue b/src/components/ProofTypeChip.vue
index 3aa0d55c81..d42eddcd17 100644
--- a/src/components/ProofTypeChip.vue
+++ b/src/components/ProofTypeChip.vue
@@ -1,10 +1,10 @@
-
+
{{ proofTypeName }}
-
+
@@ -18,7 +18,10 @@ import constants from '../constants'
export default {
props: {
- 'proof': null,
+ proof: {
+ type: Object,
+ default: null
+ },
},
data() {
return {
diff --git a/src/components/RelativeDateTimeChip.vue b/src/components/RelativeDateTimeChip.vue
index 36bcacfe9c..ae62116b2c 100644
--- a/src/components/RelativeDateTimeChip.vue
+++ b/src/components/RelativeDateTimeChip.vue
@@ -1,8 +1,10 @@
-
+
{{ getRelativeDateTimeFormatted(dateTime) }}
- {{ getDateTimeFormatted(dateTime) }}
+
+ {{ getDateTimeFormatted(dateTime) }}
+
@@ -11,7 +13,10 @@ import utils from '../utils.js'
export default {
props: {
- 'dateTime': null
+ dateTime: {
+ type: String,
+ default: null
+ },
},
methods: {
getDateTimeFormatted(dateTimeString) {
diff --git a/src/components/ShareButton.vue b/src/components/ShareButton.vue
index 86845d3fc3..3f3dd64922 100644
--- a/src/components/ShareButton.vue
+++ b/src/components/ShareButton.vue
@@ -7,8 +7,8 @@
color="teal"
icon="mdi-share-variant"
:title="$t('ShareButton.Title')"
- @click="shareViaWebShare">
-
+ @click="shareViaWebShare"
+ />
+ @click="shareViaWebShare"
+ >
{{ $t('ShareButton.Title') }}
+ :timeout="2000"
+ >
{{ $t('ShareButton.LinkCopySuccess') }}
@@ -34,7 +36,10 @@ import constants from '../constants'
export default {
props: {
- 'overrideUrl': null,
+ overrideUrl: {
+ type: String,
+ default: null
+ },
},
data() {
return {
diff --git a/src/components/UserCard.vue b/src/components/UserCard.vue
index d7e53d56f2..1dcd2b4a2d 100644
--- a/src/components/UserCard.vue
+++ b/src/components/UserCard.vue
@@ -2,9 +2,10 @@
+ @click="goToUser(user)"
+ >
-
+
@@ -14,7 +15,7 @@ import { defineAsyncComponent } from 'vue'
export default {
components: {
- 'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
+ PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
},
props: {
user: {
diff --git a/src/components/UserRecentProofsDialog.vue b/src/components/UserRecentProofsDialog.vue
index f63c2381ed..da66841e7a 100644
--- a/src/components/UserRecentProofsDialog.vue
+++ b/src/components/UserRecentProofsDialog.vue
@@ -2,15 +2,15 @@
- {{ $t('UserRecentProofsDialog.SelectRecentProof') }}
+ {{ $t('UserRecentProofsDialog.SelectRecentProof') }}
-
+
-
-
+
+
@@ -26,8 +26,9 @@ import api from '../services/api'
export default {
components: {
- 'ProofCard': defineAsyncComponent(() => import('../components/ProofCard.vue')),
+ ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')),
},
+ emits: ['recentProofSelected', 'close'],
data() {
return {
userProofList: [],
@@ -37,7 +38,6 @@ export default {
selectedProof: null,
}
},
- emits: ['recentProofSelected', 'close'],
computed: {
...mapStores(useAppStore),
username() {
diff --git a/src/i18n/localeManager.js b/src/i18n/localeManager.js
index 32e745d72b..578a9f1c47 100644
--- a/src/i18n/localeManager.js
+++ b/src/i18n/localeManager.js
@@ -156,8 +156,6 @@ const localeManager = {
const enKeys = Object.keys(enFlat)
const localeKeys = Object.keys(localeFlat)
- const enValues = Object.values(enFlat)
- const localeValues = Object.values(localeFlat)
let identicalValues = 0
let missingKeys = 0
for (let i = 0; i < enKeys.length; i++) {
diff --git a/src/store.js b/src/store.js
index b830eecfaf..a1823992bb 100644
--- a/src/store.js
+++ b/src/store.js
@@ -51,9 +51,6 @@ export const useAppStore = defineStore('app', {
this.user.username = null
this.user.token = null
},
- setLastCurrencyUsed(currency) {
- this.user.last_currency_used = currency
- },
addRecentLocation(location) {
this.user.recent_locations = utils.addObjectToArray(this.user.recent_locations, location, true)
},
diff --git a/src/utils.js b/src/utils.js
index ff7a6c7f9d..71edcb149e 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -224,7 +224,7 @@ function getMapCenter(results, source='nominatim') {
if (source === 'photon') {
return [results[0].geometry.coordinates[1], results[0].geometry.coordinates[0]]
}
- return [results[0].lat, results[0][lon]]
+ return [results[0].lat, results[0].lon]
}
diff --git a/src/views/AddPriceHome.vue b/src/views/AddPriceHome.vue
index bed6b47af2..9defe5fde9 100644
--- a/src/views/AddPriceHome.vue
+++ b/src/views/AddPriceHome.vue
@@ -9,14 +9,14 @@
:title="$t('AddPriceHome.SingleProductMode.Title')"
:subtitle="$t('AddPriceHome.SingleProductMode.Subtitle')"
prepend-icon="mdi-barcode"
- to="/add/single">
-
+ to="/add/single"
+ />
-
-
-
+
+
+
@@ -24,16 +24,16 @@
:title="$t('AddPriceHome.MultipleProductMode.Title')"
:subtitle="$t('AddPriceHome.MultipleProductMode.Subtitle')"
prepend-icon="mdi-library-shelves"
- to="/add/multiple/price-tag">
-
+ to="/add/multiple/price-tag"
+ />
-
+ to="/add/multiple/receipt"
+ />
@@ -41,17 +41,23 @@
v-model="signinSuccessMessage"
color="success"
:timeout="2000"
- >{{ $t('AddPriceHome.SignedIn') }}
+ >
+ {{ $t('AddPriceHome.SignedIn') }}
+
{{ $t('AddPriceHome.PriceCreated') }}
+ >
+ {{ $t('AddPriceHome.PriceCreated') }}
+
{{ $t('AddPriceHome.Thanks') }}
+ >
+ {{ $t('AddPriceHome.Thanks') }}
+
diff --git a/src/views/AddPriceSingle.vue b/src/views/AddPriceSingle.vue
index cfa5817f92..48c84bd7f6 100644
--- a/src/views/AddPriceSingle.vue
+++ b/src/views/AddPriceSingle.vue
@@ -5,24 +5,24 @@
-
-
-
+ :style="productFormFilled ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
+ >
+
+
-
+
-
-
-
+
+
+
{{ pm.value }}
@@ -39,28 +39,28 @@
-
+ />
+
+ />
+ />
+ />
@@ -96,31 +97,34 @@
:title="$t('AddPriceSingle.PriceDetails.Title')"
prepend-icon="mdi-tag-outline"
height="100%"
- :style="priceProofFormFilled ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'">
-
-
+ :style="priceProofFormFilled ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
+ >
+
+
-
+
-
-
-
+
+
+
{{ cpp.value }}
-
- {{ $t('AddPriceSingle.PriceDetails.Proof') }}
+
+
+ {{ $t('AddPriceSingle.PriceDetails.Proof') }}
+
-
+
{{ $t('AddPriceSingle.PriceDetails.Picture') }}
{{ $t('AddPriceSingle.PriceDetails.TakePicture') }}
-
+
{{ $t('AddPriceSingle.PriceDetails.Gallery') }}
{{ $t('AddPriceSingle.PriceDetails.SelectFromGallery') }}
@@ -129,24 +133,24 @@
{{ $t('AddPriceSingle.PriceDetails.SelectRecentProof') }}
-
+ />
-
+ />
{{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }}
{{ $t('AddPriceSingle.PriceDetails.ProofSelected') }}
@@ -156,7 +160,7 @@
-
+
@@ -169,34 +173,44 @@
:title="$t('AddPriceSingle.WhereWhen.Title')"
prepend-icon="mdi-map-marker-outline"
height="100%"
- :style="locationDateFormFilled ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'">
-
-
+ :style="locationDateFormFilled ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
+ >
+
+
-
+
- {{ $t('AddPriceSingle.WhereWhen.Location') }}
+
+ {{ $t('AddPriceSingle.WhereWhen.Location') }}
+
-
+ class="mb-2"
+ :style="isSelectedLocation(location) ? 'border: 1px solid #4CAF50' : 'border: 1px solid transparent'"
+ @click="setLocationData(location)"
+ >
+
{{ getLocationTitle(location, true, true, true) }}
-
- {{ $t('AddPriceSingle.WhereWhen.Find') }}
- {{ $t('AddPriceSingle.WhereWhen.SelectLocation') }}
+
+
+ {{ $t('AddPriceSingle.WhereWhen.Find') }}
+
+
+ {{ $t('AddPriceSingle.WhereWhen.SelectLocation') }}
+
- {{ $t('AddPriceSingle.WhereWhen.Date') }}
+
+ {{ $t('AddPriceSingle.WhereWhen.Date') }}
+
+ />
@@ -211,7 +225,9 @@
:color="formFilled ? 'success' : ''"
:loading="createPriceLoading"
:disabled="!formFilled"
- >{{ $t('AddPriceSingle.Create') }}
+ >
+ {{ $t('AddPriceSingle.Create') }}
+
@@ -220,42 +236,48 @@
v-model="proofDateSuccessMessage"
color="info"
:timeout="2000"
- >{{ $t('AddPriceSingle.PriceDetails.ProofDateChanged') }}
+ >
+ {{ $t('AddPriceSingle.PriceDetails.ProofDateChanged') }}
+
{{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }}
+ >
+ {{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }}
+
{{ $t('AddPriceSingle.PriceDetails.ProofSelected') }}
+ >
+ {{ $t('AddPriceSingle.PriceDetails.ProofSelected') }}
+
+ />
+ />
+ />
+ />
diff --git a/src/views/BrandDetail.vue b/src/views/BrandDetail.vue
index 31d9ad834d..651bb1641c 100644
--- a/src/views/BrandDetail.vue
+++ b/src/views/BrandDetail.vue
@@ -3,10 +3,11 @@
+ prepend-icon="mdi-factory"
+ >
-
+
{{ $t('BrandDetail.BrandProductTotal', { count: brandProductTotal }) }}
@@ -16,31 +17,35 @@
-
-
+
+
-
+
- {{ $t('BrandDetail.TopProducts') }}
-
-
-
+
+ {{ $t('BrandDetail.TopProducts') }}
+
+
+
+
-
-
+
+
- {{ $t('BrandDetail.LoadMore') }}
+
+ {{ $t('BrandDetail.LoadMore') }}
+
@@ -52,11 +57,11 @@ import api from '../services/api'
export default {
components: {
- 'FilterMenu': defineAsyncComponent(() => import('../components/FilterMenu.vue')),
- 'OrderMenu': defineAsyncComponent(() => import('../components/OrderMenu.vue')),
- 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')),
- 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
- 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue'))
+ FilterMenu: defineAsyncComponent(() => import('../components/FilterMenu.vue')),
+ OrderMenu: defineAsyncComponent(() => import('../components/OrderMenu.vue')),
+ ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')),
+ OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
+ ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue'))
},
data() {
return {
@@ -80,6 +85,13 @@ export default {
return defaultParams
},
},
+ watch: {
+ $route (newBrand, oldBrand) {
+ if (oldBrand && newBrand && newBrand.name == 'brand-detail' && oldBrand.fullPath != newBrand.fullPath) {
+ this.initBrand()
+ }
+ }
+ },
mounted() {
this.currentFilter = this.$route.query[constants.FILTER_PARAM] || this.currentFilter
this.currentOrder = this.$route.query[constants.ORDER_PARAM] || this.currentOrder
@@ -115,13 +127,6 @@ export default {
// this.initBrand() will be called in watch $route
}
}
- },
- watch: {
- $route (newBrand, oldBrand) {
- if (oldBrand && newBrand && newBrand.name == 'brand-detail' && oldBrand.fullPath != newBrand.fullPath) {
- this.initBrand()
- }
- }
}
}
diff --git a/src/views/CategoryDetail.vue b/src/views/CategoryDetail.vue
index 20cfefc060..43e949ed0c 100644
--- a/src/views/CategoryDetail.vue
+++ b/src/views/CategoryDetail.vue
@@ -3,10 +3,11 @@
+ prepend-icon="mdi-list-box-outline"
+ >
-
+
{{ $t('CategoryDetail.CategoryProductTotal', { count: categoryProductTotal }) }}
@@ -16,31 +17,35 @@
-
-
+
+
-
+
- {{ $t('CategoryDetail.TopProducts') }}
-
-
-
+
+ {{ $t('CategoryDetail.TopProducts') }}
+
+
+
+
-
-
+
+
- {{ $t('CategoryDetail.LoadMore') }}
+
+ {{ $t('CategoryDetail.LoadMore') }}
+
@@ -52,11 +57,11 @@ import api from '../services/api'
export default {
components: {
- 'FilterMenu': defineAsyncComponent(() => import('../components/FilterMenu.vue')),
- 'OrderMenu': defineAsyncComponent(() => import('../components/OrderMenu.vue')),
- 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')),
- 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
- 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue'))
+ FilterMenu: defineAsyncComponent(() => import('../components/FilterMenu.vue')),
+ OrderMenu: defineAsyncComponent(() => import('../components/OrderMenu.vue')),
+ ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')),
+ OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
+ ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue'))
},
data() {
return {
@@ -80,6 +85,13 @@ export default {
return defaultParams
},
},
+ watch: {
+ $route (newCategory, oldCategory) {
+ if (oldCategory && newCategory && newCategory.name == 'category-detail' && oldCategory.fullPath != newCategory.fullPath) {
+ this.initCategory()
+ }
+ }
+ },
mounted() {
this.currentFilter = this.$route.query[constants.FILTER_PARAM] || this.currentFilter
this.currentOrder = this.$route.query[constants.ORDER_PARAM] || this.currentOrder
@@ -115,13 +127,6 @@ export default {
// this.initCategory() will be called in watch $route
}
}
- },
- watch: {
- $route (newCategory, oldCategory) {
- if (oldCategory && newCategory && newCategory.name == 'category-detail' && oldCategory.fullPath != newCategory.fullPath) {
- this.initCategory()
- }
- }
}
}
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 40548be9c4..36f432f6d0 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -1,12 +1,14 @@
- {{ APP_NAME }}
+
+ {{ APP_NAME }}
+
{{ $t('Home.Welcome.Subtitle') }}
-
+
@@ -14,8 +16,8 @@
:title="$t('Home.SearchProduct')"
prepend-icon="mdi-magnify"
height="100%"
- to="/search">
-
+ to="/search"
+ />
-
+ to="/add"
+ >
+
-
+
@@ -41,10 +44,11 @@
-
+ to="/prices"
+ >
+
-
+
{{ todayPriceCount }}
@@ -57,7 +61,9 @@
v-model="settingsSuccessMessage"
color="success"
:timeout="2000"
- >{{ $t('Home.SettingsUpdated') }}
+ >
+ {{ $t('Home.SettingsUpdated') }}
+
diff --git a/src/views/LocationList.vue b/src/views/LocationList.vue
index 85b7d2e053..4df13897ac 100644
--- a/src/views/LocationList.vue
+++ b/src/views/LocationList.vue
@@ -1,7 +1,7 @@
{{ $t('LocationList.Title') }}
-
+
@@ -13,14 +13,16 @@
-
-
+
+
- {{ $t('LocationList.LoadMore') }}
+
+ {{ $t('LocationList.LoadMore') }}
+
@@ -31,7 +33,7 @@ import api from '../services/api'
export default {
components: {
- 'LocationCard': defineAsyncComponent(() => import('../components/LocationCard.vue')),
+ LocationCard: defineAsyncComponent(() => import('../components/LocationCard.vue')),
},
data() {
return {
diff --git a/src/views/PriceList.vue b/src/views/PriceList.vue
index 87002ae475..10fc4f1578 100644
--- a/src/views/PriceList.vue
+++ b/src/views/PriceList.vue
@@ -1,18 +1,20 @@
{{ $t('PriceList.Title') }}
-
+
-
-
+
+
- {{ $t('PriceList.LoadMore') }}
+
+ {{ $t('PriceList.LoadMore') }}
+
@@ -23,7 +25,7 @@ import api from '../services/api'
export default {
components: {
- 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue'))
+ PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue'))
},
data() {
return {
diff --git a/src/views/ProductDetail.vue b/src/views/ProductDetail.vue
index 3a9076ce7f..bbc8a3e302 100644
--- a/src/views/ProductDetail.vue
+++ b/src/views/ProductDetail.vue
@@ -1,16 +1,16 @@
-
+
-
+
-
+
@@ -18,8 +18,8 @@
{{ OFF_NAME }}
-
-
+
+
{{ $t('ProductDetail.CategoryNotFound') }}
@@ -27,35 +27,39 @@
-
+
-
-
-
-
+
+
+
+
-
+
- {{ $t('ProductDetail.LatestPrices') }}
-
-
-
+
+ {{ $t('ProductDetail.LatestPrices') }}
+
+
+
+
-
-
+
+
- {{ $t('ProductDetail.LoadMore') }}
+
+ {{ $t('ProductDetail.LoadMore') }}
+
@@ -70,15 +74,15 @@ import api from '../services/api'
export default {
components: {
- 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')),
- 'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
- 'PriceAddButton': defineAsyncComponent(() => import('../components/PriceAddButton.vue')),
- 'FilterMenu': defineAsyncComponent(() => import('../components/FilterMenu.vue')),
- 'OrderMenu': defineAsyncComponent(() => import('../components/OrderMenu.vue')),
- 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')),
- 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
- 'OpenFoodFactsAddMenu': defineAsyncComponent(() => import('../components/OpenFoodFactsAddMenu.vue')),
- 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue'))
+ ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')),
+ PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
+ PriceAddButton: defineAsyncComponent(() => import('../components/PriceAddButton.vue')),
+ FilterMenu: defineAsyncComponent(() => import('../components/FilterMenu.vue')),
+ OrderMenu: defineAsyncComponent(() => import('../components/OrderMenu.vue')),
+ PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue')),
+ OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
+ OpenFoodFactsAddMenu: defineAsyncComponent(() => import('../components/OpenFoodFactsAddMenu.vue')),
+ ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue'))
},
data() {
return {
@@ -97,12 +101,6 @@ export default {
currentOrder: constants.PRICE_ORDER_LIST[1].key,
}
},
- mounted() {
- this.currentFilter = this.$route.query[constants.FILTER_PARAM] || this.currentFilter
- this.currentOrder = this.$route.query[constants.ORDER_PARAM] || this.currentOrder
- this.getProduct()
- this.initProductPrices()
- },
computed: {
...mapStores(useAppStore),
productIsCategory() {
@@ -127,6 +125,19 @@ export default {
return defaultParams
},
},
+ watch: {
+ $route (newRoute, oldRoute) { // only called when query changes to avoid having an API call when the path changes
+ if (oldRoute.path === newRoute.path && JSON.stringify(oldRoute.query) !== JSON.stringify(newRoute.query)) {
+ this.initProductPrices()
+ }
+ }
+ },
+ mounted() {
+ this.currentFilter = this.$route.query[constants.FILTER_PARAM] || this.currentFilter
+ this.currentOrder = this.$route.query[constants.ORDER_PARAM] || this.currentOrder
+ this.getProduct()
+ this.initProductPrices()
+ },
methods: {
initProductPrices() {
this.productPriceList = []
@@ -172,13 +183,6 @@ export default {
// this.initProductPrices() will be called in watch $route
}
}
- },
- watch: {
- $route (newRoute, oldRoute) { // only called when query changes to avoid having an API call when the path changes
- if (oldRoute.path === newRoute.path && JSON.stringify(oldRoute.query) !== JSON.stringify(newRoute.query)) {
- this.initProductPrices()
- }
- }
}
}
diff --git a/src/views/ProductList.vue b/src/views/ProductList.vue
index ce9d7864ec..f68716032d 100644
--- a/src/views/ProductList.vue
+++ b/src/views/ProductList.vue
@@ -1,7 +1,7 @@
{{ $t('ProductList.Title') }}
-
+
@@ -9,20 +9,22 @@
{{ $t('ProductList.ProductTotal', { count: productTotal }) }}
-
-
+
+
-
-
+
+
- {{ $t('ProductList.LoadMore') }}
+
+ {{ $t('ProductList.LoadMore') }}
+
@@ -34,9 +36,9 @@ import api from '../services/api'
export default {
components: {
- 'FilterMenu': defineAsyncComponent(() => import('../components/FilterMenu.vue')),
- 'OrderMenu': defineAsyncComponent(() => import('../components/OrderMenu.vue')),
- 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')),
+ FilterMenu: defineAsyncComponent(() => import('../components/FilterMenu.vue')),
+ OrderMenu: defineAsyncComponent(() => import('../components/OrderMenu.vue')),
+ ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')),
},
data() {
return {
@@ -63,6 +65,13 @@ export default {
return defaultParams
},
},
+ watch: {
+ $route (newRoute, oldRoute) { // only called when query changes to avoid having an API call when the path changes
+ if (oldRoute.path === newRoute.path && JSON.stringify(oldRoute.query) !== JSON.stringify(newRoute.query)) {
+ this.initProductList()
+ }
+ }
+ },
mounted() {
this.currentFilter = this.$route.query[constants.FILTER_PARAM] || this.currentFilter
this.currentSource = this.$route.query[constants.SOURCE_PARAM] || this.currentSource
@@ -103,13 +112,6 @@ export default {
// this.initProductList() will be called in watch $route
}
}
- },
- watch: {
- $route (newRoute, oldRoute) { // only called when query changes to avoid having an API call when the path changes
- if (oldRoute.path === newRoute.path && JSON.stringify(oldRoute.query) !== JSON.stringify(newRoute.query)) {
- this.initProductList()
- }
- }
}
}
diff --git a/src/views/ProofDetail.vue b/src/views/ProofDetail.vue
index ad90394dd1..411dd60c39 100644
--- a/src/views/ProofDetail.vue
+++ b/src/views/ProofDetail.vue
@@ -1,33 +1,37 @@
-
- {{ $t('ProofDetail.ProofNotFound') }}
+
+
+ {{ $t('ProofDetail.ProofNotFound') }}
+
-
+
-
+
-
+
-
+
{{ $t('ProofDetail.Prices') }}
-
+
-
-
+
+
- {{ $t('ProofDetail.LoadMore') }}
+
+ {{ $t('ProofDetail.LoadMore') }}
+
@@ -38,9 +42,9 @@ import api from '../services/api'
export default {
components: {
- 'PriceAddButton': defineAsyncComponent(() => import('../components/PriceAddButton.vue')),
- 'ProofCard': defineAsyncComponent(() => import('../components/ProofCard.vue')),
- 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')),
+ PriceAddButton: defineAsyncComponent(() => import('../components/PriceAddButton.vue')),
+ ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')),
+ PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue')),
},
data() {
return {
diff --git a/src/views/Search.vue b/src/views/Search.vue
index 07cbab9976..678f0ceb8d 100644
--- a/src/views/Search.vue
+++ b/src/views/Search.vue
@@ -1,7 +1,7 @@
{{ $t('Search.Title') }}
-
+
@@ -16,12 +16,13 @@
:rules="[fieldRequired]"
hide-details="auto"
:loading="loading"
- required>
-
-
+ required
+ >
+
+
-
-
+
+
@@ -33,8 +34,8 @@
-
-
+
+
@@ -43,7 +44,7 @@
v-model="barcodeScannerDialog"
@barcode="setProductCode($event)"
@close="barcodeScannerDialog = false"
- >
+ />
diff --git a/src/views/SignIn.vue b/src/views/SignIn.vue
index 288e3a6c4f..cbffddb9d9 100644
--- a/src/views/SignIn.vue
+++ b/src/views/SignIn.vue
@@ -8,10 +8,11 @@
+ variant="outlined"
+ >
-
+
@@ -22,18 +23,20 @@
:label="$t('SignIn.UsernameLabel')"
type="text"
class="input-lowercase"
- >
+ />
+ />
{{ $t('SignIn.Button') }}
+ >
+ {{ $t('SignIn.Button') }}
+
@@ -47,7 +50,7 @@ import api from '../services/api'
export default {
components: {
- 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
+ OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
},
data() {
return {
@@ -78,7 +81,7 @@ export default {
this.loading = false
}
})
- .catch((error) => {
+ .catch((error) => { // eslint-disable-line no-unused-vars
alert(this.$t('SignIn.ServerError'))
this.loading = false
});
diff --git a/src/views/Stats.vue b/src/views/Stats.vue
index d52c560670..e5a695180b 100644
--- a/src/views/Stats.vue
+++ b/src/views/Stats.vue
@@ -1,7 +1,7 @@
{{ $t('Stats.Title') }}
-
+
@@ -12,11 +12,15 @@
{{ $t('Stats.Total') }} {{ priceTotal }}
- {{ $t('Stats.WithProduct') }} barcode
+ {{ $t('Stats.WithProduct') }}
+ barcode
+
{{ priceWithProduct }}
- {{ $t('Stats.WithoutProduct') }} category
+ {{ $t('Stats.WithoutProduct') }}
+ category
+
{{ priceWithoutProduct }}
diff --git a/src/views/User.vue b/src/views/User.vue
deleted file mode 100644
index f1307d399e..0000000000
--- a/src/views/User.vue
+++ /dev/null
@@ -1,9 +0,0 @@
-
- User: {{ id }}
-
-
-
diff --git a/src/views/UserDashboard.vue b/src/views/UserDashboard.vue
index 698a187f2d..ab3346ea15 100644
--- a/src/views/UserDashboard.vue
+++ b/src/views/UserDashboard.vue
@@ -21,8 +21,8 @@
:subtitle="userPriceTotal"
prepend-icon="mdi-tag-multiple-outline"
height="100%"
- to="/dashboard/prices">
-
+ to="/dashboard/prices"
+ />
-
+ to="/dashboard/proofs"
+ />
diff --git a/src/views/UserDashboardPriceList.vue b/src/views/UserDashboardPriceList.vue
index cdc835e994..c190a89d1c 100644
--- a/src/views/UserDashboardPriceList.vue
+++ b/src/views/UserDashboardPriceList.vue
@@ -11,26 +11,28 @@
{{ $t('UserDashboard.Title') }}
-
+
-
+
{{ $t('UserDashboard.LatestPrices') }}
-
+
-
-
+
+
- {{ $t('UserDashboard.LoadMore') }}
+
+ {{ $t('UserDashboard.LoadMore') }}
+
@@ -43,8 +45,8 @@ import api from '../services/api'
export default {
components: {
- 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue')),
- 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue'))
+ ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue')),
+ PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue'))
},
data() {
return {
diff --git a/src/views/UserDashboardProofList.vue b/src/views/UserDashboardProofList.vue
index 532e24c79c..3dd98f97f8 100644
--- a/src/views/UserDashboardProofList.vue
+++ b/src/views/UserDashboardProofList.vue
@@ -6,7 +6,7 @@
- {{ $t('UserDashboard.UserProofTotal', { count: this.appStore.getUserProofTotal }) }}
+ {{ $t('UserDashboard.UserProofTotal', { count: appStore.getUserProofTotal }) }}
{{ $t('UserDashboard.Title') }}
@@ -14,21 +14,22 @@
-
+
{{ $t('UserDashboard.LatestProofs') }}
-
+
-
-
-
+
+
-
+
- {{ $t('UserDashboard.LoadMore') }}
+
+ {{ $t('UserDashboard.LoadMore') }}
+
@@ -36,7 +37,9 @@
v-model="proofUpdated"
color="success"
:timeout="2000"
- >{{ $t('UserDashboard.ProofUpdated') }}
+ >
+ {{ $t('UserDashboard.ProofUpdated') }}
+
diff --git a/src/views/UserList.vue b/src/views/UserList.vue
index 27cb50e317..5a09563d3f 100644
--- a/src/views/UserList.vue
+++ b/src/views/UserList.vue
@@ -1,7 +1,7 @@
{{ $t('UserList.Title') }}
-
+
@@ -13,14 +13,16 @@
-
-
+
+
- {{ $t('UserList.LoadMore') }}
+
+ {{ $t('UserList.LoadMore') }}
+
@@ -31,7 +33,7 @@ import api from '../services/api'
export default {
components: {
- 'UserCard': defineAsyncComponent(() => import('../components/UserCard.vue')),
+ UserCard: defineAsyncComponent(() => import('../components/UserCard.vue')),
},
data() {
return {
diff --git a/src/views/UserSettings.vue b/src/views/UserSettings.vue
index a64a879d2f..eabbcf8b72 100644
--- a/src/views/UserSettings.vue
+++ b/src/views/UserSettings.vue
@@ -1,21 +1,27 @@
- {{ $t('UserSettings.Title') }}
+
+ {{ $t('UserSettings.Title') }}
+
-
+
- {{ $t('Common.Country') }}
+
+ {{ $t('Common.Country') }}
+
- {{ $t('Common.Language') }}
+ />
+
+ {{ $t('Common.Language') }}
+
+ />
-
- {{ this.languageTranslationCompletion }}
+
+
+ {{ languageTranslationCompletion }}
+
-
+
{{ $t('UserSettings.TranslationHelp') }}
-
+
- {{ $t('Common.Products') }}
-
+
+ {{ $t('Common.Products') }}
+
+
@@ -44,9 +54,11 @@
-
+
- {{ $t('UserSettings.FavoriteCurrencies') }}
+
+ {{ $t('UserSettings.FavoriteCurrencies') }}
+
+ />
@@ -64,7 +76,9 @@
- {{ $t('UserSettings.Save') }}
+
+ {{ $t('UserSettings.Save') }}
+
@@ -92,6 +106,17 @@ export default {
countryList: countryData, // can be used to further filter the country list if needed
}
},
+ computed: {
+ ...mapStores(useAppStore),
+ formFilled() {
+ return Object.values(this.userSettingsForm).every(x => {
+ if (x && Array.isArray(x)) {
+ return x.length > 0
+ }
+ return !!x
+ })
+ },
+ },
watch: {
'userSettingsForm.selectedLanguage': async function () {
if (this.userSettingsForm.selectedLanguage !== null) {
@@ -133,17 +158,6 @@ export default {
}
}
},
- computed: {
- ...mapStores(useAppStore),
- formFilled() {
- return Object.values(this.userSettingsForm).every(x => {
- if (x && Array.isArray(x)) {
- return x.length > 0
- }
- return !!x
- })
- },
- },
async mounted() {
this.languageListCode = await localeManager.getLocales()
this.languageList = this.languageListCode.map(code => {