From d931f7f5f1a3aa422aa9079a33748c4fc9e35a8f Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Sat, 25 May 2024 15:01:45 +0200 Subject: [PATCH] Fix files --- eslint.config.js | 2 + src/components/BarcodeScannerDialog.vue | 2 +- src/components/Footer.vue | 4 +- src/components/LocationCard.vue | 2 +- src/components/LocationSelectorDialog.vue | 3 +- src/components/PriceActionMenuButton.vue | 11 ++-- src/components/PriceCard.vue | 66 ++++++++++++++----- src/components/PriceCountChip.vue | 10 ++- .../PriceDeleteConfirmationDialog.vue | 7 +- src/components/PriceEditDialog.vue | 9 ++- src/components/PriceFooterRow.vue | 30 ++++++--- src/components/PriceInputRow.vue | 2 +- src/components/PriceLocationChip.vue | 10 ++- src/components/PriceOwnerChip.vue | 10 ++- src/components/PricePriceRow.vue | 20 ++++-- src/components/PriceProof.vue | 5 +- src/components/ProductBrands.vue | 2 +- src/components/ProductCard.vue | 38 +++++++---- src/components/ProductCategoriesChip.vue | 6 +- src/components/ProductLabelsChip.vue | 6 +- src/components/ProofActionMenuButton.vue | 11 ++-- src/components/ProofCard.vue | 8 ++- .../ProofDeleteConfirmationDialog.vue | 7 +- src/components/ProofEditDialog.vue | 5 +- src/components/ProofFooter.vue | 15 +++-- src/components/ProofPrivateChip.vue | 5 +- src/components/ProofTypeChip.vue | 5 +- src/components/RelativeDateTimeChip.vue | 5 +- src/components/ShareButton.vue | 5 +- src/components/UserCard.vue | 2 +- src/components/UserRecentProofsDialog.vue | 2 +- src/i18n/localeManager.js | 2 - src/store.js | 3 - src/utils.js | 2 +- src/views/AddPriceMultiple.vue | 17 ++--- src/views/AddPriceSingle.vue | 13 ++-- src/views/BrandDetail.vue | 10 +-- src/views/CategoryDetail.vue | 10 +-- src/views/Home.vue | 2 +- src/views/LocationDetail.vue | 12 ++-- src/views/LocationList.vue | 2 +- src/views/PriceList.vue | 2 +- src/views/ProductDetail.vue | 18 ++--- src/views/ProductList.vue | 6 +- src/views/ProofDetail.vue | 6 +- src/views/Search.vue | 6 +- src/views/SignIn.vue | 2 +- src/views/UserDashboardPriceList.vue | 4 +- src/views/UserDetail.vue | 12 ++-- src/views/UserList.vue | 2 +- 50 files changed, 286 insertions(+), 160 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 83715b7ce5c..55576e4373f 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/BarcodeScannerDialog.vue b/src/components/BarcodeScannerDialog.vue index 7ddf98099ab..2d94952a4ee 100644 --- a/src/components/BarcodeScannerDialog.vue +++ b/src/components/BarcodeScannerDialog.vue @@ -27,7 +27,7 @@ diff --git a/src/components/ProofTypeChip.vue b/src/components/ProofTypeChip.vue index 3aa0d55c818..cdc11dbcb97 100644 --- a/src/components/ProofTypeChip.vue +++ b/src/components/ProofTypeChip.vue @@ -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 36bcacfe9c6..6470c108994 100644 --- a/src/components/RelativeDateTimeChip.vue +++ b/src/components/RelativeDateTimeChip.vue @@ -11,7 +11,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 86845d3fc38..437361b8398 100644 --- a/src/components/ShareButton.vue +++ b/src/components/ShareButton.vue @@ -34,7 +34,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 d7e53d56f27..3e9f92a7220 100644 --- a/src/components/UserCard.vue +++ b/src/components/UserCard.vue @@ -14,7 +14,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 f63c2381edf..d0b8fcba749 100644 --- a/src/components/UserRecentProofsDialog.vue +++ b/src/components/UserRecentProofsDialog.vue @@ -26,7 +26,7 @@ import api from '../services/api' export default { components: { - 'ProofCard': defineAsyncComponent(() => import('../components/ProofCard.vue')), + ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')), }, data() { return { diff --git a/src/i18n/localeManager.js b/src/i18n/localeManager.js index 32e745d72b9..578a9f1c470 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 b830eecfaf8..a1823992bbc 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 ff7a6c7f9da..71edcb149e6 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/AddPriceMultiple.vue b/src/views/AddPriceMultiple.vue index 90c75b7657c..c72c13ad238 100644 --- a/src/views/AddPriceMultiple.vue +++ b/src/views/AddPriceMultiple.vue @@ -134,7 +134,7 @@ - + @@ -214,6 +214,7 @@
import('../components/LocationSelectorDialog.vue')), - 'PriceInputRow': defineAsyncComponent(() => import('../components/PriceInputRow.vue')), - 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')), - 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')), - 'BarcodeScannerDialog': defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')), - 'BarcodeManualInputDialog': defineAsyncComponent(() => import('../components/BarcodeManualInputDialog.vue')), - 'UserRecentProofsDialog': defineAsyncComponent(() => import('../components/UserRecentProofsDialog.vue')), + LocationSelectorDialog: defineAsyncComponent(() => import('../components/LocationSelectorDialog.vue')), + PriceInputRow: defineAsyncComponent(() => import('../components/PriceInputRow.vue')), + PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue')), + ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')), + BarcodeScannerDialog: defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')), + BarcodeManualInputDialog: defineAsyncComponent(() => import('../components/BarcodeManualInputDialog.vue')), + UserRecentProofsDialog: defineAsyncComponent(() => import('../components/UserRecentProofsDialog.vue')), }, data() { return { diff --git a/src/views/AddPriceSingle.vue b/src/views/AddPriceSingle.vue index cfa5817f92c..7b562f9e9d7 100644 --- a/src/views/AddPriceSingle.vue +++ b/src/views/AddPriceSingle.vue @@ -76,6 +76,7 @@
import('../components/PriceInputRow.vue')), - 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')), - 'BarcodeScannerDialog': defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')), - 'BarcodeManualInputDialog': defineAsyncComponent(() => import('../components/BarcodeManualInputDialog.vue')), - 'LocationSelectorDialog': defineAsyncComponent(() => import('../components/LocationSelectorDialog.vue')), - 'UserRecentProofsDialog': defineAsyncComponent(() => import('../components/UserRecentProofsDialog.vue')), + PriceInputRow: defineAsyncComponent(() => import('../components/PriceInputRow.vue')), + ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')), + BarcodeScannerDialog: defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')), + BarcodeManualInputDialog: defineAsyncComponent(() => import('../components/BarcodeManualInputDialog.vue')), + LocationSelectorDialog: defineAsyncComponent(() => import('../components/LocationSelectorDialog.vue')), + UserRecentProofsDialog: defineAsyncComponent(() => import('../components/UserRecentProofsDialog.vue')), }, data() { return { diff --git a/src/views/BrandDetail.vue b/src/views/BrandDetail.vue index 31d9ad834d5..bc19d4dbfbb 100644 --- a/src/views/BrandDetail.vue +++ b/src/views/BrandDetail.vue @@ -52,11 +52,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 { diff --git a/src/views/CategoryDetail.vue b/src/views/CategoryDetail.vue index 20cfefc0603..752f9c19a99 100644 --- a/src/views/CategoryDetail.vue +++ b/src/views/CategoryDetail.vue @@ -52,11 +52,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 { diff --git a/src/views/Home.vue b/src/views/Home.vue index 40548be9c48..5791df2972a 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -70,7 +70,7 @@ import api from '../services/api' export default { components: { - 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')), + OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')), }, data() { return { diff --git a/src/views/LocationDetail.vue b/src/views/LocationDetail.vue index 78874980085..f7d00fa4ce4 100644 --- a/src/views/LocationDetail.vue +++ b/src/views/LocationDetail.vue @@ -48,12 +48,12 @@ import constants from '../constants' export default { components: { - 'LocationCard': defineAsyncComponent(() => import('../components/LocationCard.vue')), - 'FilterMenu': defineAsyncComponent(() => import('../components/FilterMenu.vue')), - 'OrderMenu': defineAsyncComponent(() => import('../components/OrderMenu.vue')), - 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')), - 'OpenStreetMapLink': defineAsyncComponent(() => import('../components/OpenStreetMapLink.vue')), - 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue')), + LocationCard: defineAsyncComponent(() => import('../components/LocationCard.vue')), + FilterMenu: defineAsyncComponent(() => import('../components/FilterMenu.vue')), + OrderMenu: defineAsyncComponent(() => import('../components/OrderMenu.vue')), + PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue')), + OpenStreetMapLink: defineAsyncComponent(() => import('../components/OpenStreetMapLink.vue')), + ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue')), }, data() { return { diff --git a/src/views/LocationList.vue b/src/views/LocationList.vue index 85b7d2e0531..bfb24e30286 100644 --- a/src/views/LocationList.vue +++ b/src/views/LocationList.vue @@ -31,7 +31,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 87002ae4750..981e837c772 100644 --- a/src/views/PriceList.vue +++ b/src/views/PriceList.vue @@ -23,7 +23,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 3a9076ce7f8..82f308f71c3 100644 --- a/src/views/ProductDetail.vue +++ b/src/views/ProductDetail.vue @@ -70,15 +70,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 { diff --git a/src/views/ProductList.vue b/src/views/ProductList.vue index ce9d7864ec6..4f70576a8d1 100644 --- a/src/views/ProductList.vue +++ b/src/views/ProductList.vue @@ -34,9 +34,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 { diff --git a/src/views/ProofDetail.vue b/src/views/ProofDetail.vue index ad90394dd18..4e1f5e69da8 100644 --- a/src/views/ProofDetail.vue +++ b/src/views/ProofDetail.vue @@ -38,9 +38,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 07cbab9976d..8c811778cc2 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -53,8 +53,8 @@ import api from '../services/api' export default { components: { - 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')), - 'BarcodeScannerDialog': defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')) + ProductCard: defineAsyncComponent(() => import('../components/ProductCard.vue')), + BarcodeScannerDialog: defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')) }, data() { return { @@ -110,7 +110,7 @@ export default { }) }, getProductLatestPrices() { - this.productList.forEach((product, index) => { + this.productList.forEach((product) => { if (product.price_count && !product.latest_price) { this.getPrices(product) } diff --git a/src/views/SignIn.vue b/src/views/SignIn.vue index 288e3a6c4f9..b97e91cb459 100644 --- a/src/views/SignIn.vue +++ b/src/views/SignIn.vue @@ -47,7 +47,7 @@ import api from '../services/api' export default { components: { - 'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')), + OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')), }, data() { return { diff --git a/src/views/UserDashboardPriceList.vue b/src/views/UserDashboardPriceList.vue index cdc835e9948..3ae0950fe87 100644 --- a/src/views/UserDashboardPriceList.vue +++ b/src/views/UserDashboardPriceList.vue @@ -43,8 +43,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/UserDetail.vue b/src/views/UserDetail.vue index ba9d1b0a6f1..f556c5b1448 100644 --- a/src/views/UserDetail.vue +++ b/src/views/UserDetail.vue @@ -45,12 +45,12 @@ import constants from '../constants' export default { components: { - 'UserCard': defineAsyncComponent(() => import('../components/UserCard.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')), - 'ShareButton': defineAsyncComponent(() => import('../components/ShareButton.vue')) + UserCard: defineAsyncComponent(() => import('../components/UserCard.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')), + ShareButton: defineAsyncComponent(() => import('../components/ShareButton.vue')) }, data() { return { diff --git a/src/views/UserList.vue b/src/views/UserList.vue index 27cb50e3172..99356accc3c 100644 --- a/src/views/UserList.vue +++ b/src/views/UserList.vue @@ -31,7 +31,7 @@ import api from '../services/api' export default { components: { - 'UserCard': defineAsyncComponent(() => import('../components/UserCard.vue')), + UserCard: defineAsyncComponent(() => import('../components/UserCard.vue')), }, data() { return {