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 @@ @@ -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 @@ @@ -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 @@ - - @@ -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 @@