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