From c9d458756c556e0e2a095edfdf11ae56472073b1 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Tue, 9 Apr 2024 10:58:32 +0200 Subject: [PATCH] refactor: rename dialog components (Location, Barcode) --- ...Input.vue => BarcodeManualInputDialog.vue} | 0 ...deScanner.vue => BarcodeScannerDialog.vue} | 0 ...elector.vue => LocationSelectorDialog.vue} | 0 src/views/AddPriceMultiple.vue | 65 +++++++++---------- src/views/AddPriceSingle.vue | 62 +++++++++--------- src/views/Search.vue | 20 +++--- 6 files changed, 72 insertions(+), 75 deletions(-) rename src/components/{BarcodeManualInput.vue => BarcodeManualInputDialog.vue} (100%) rename src/components/{BarcodeScanner.vue => BarcodeScannerDialog.vue} (100%) rename src/components/{LocationSelector.vue => LocationSelectorDialog.vue} (100%) diff --git a/src/components/BarcodeManualInput.vue b/src/components/BarcodeManualInputDialog.vue similarity index 100% rename from src/components/BarcodeManualInput.vue rename to src/components/BarcodeManualInputDialog.vue diff --git a/src/components/BarcodeScanner.vue b/src/components/BarcodeScannerDialog.vue similarity index 100% rename from src/components/BarcodeScanner.vue rename to src/components/BarcodeScannerDialog.vue diff --git a/src/components/LocationSelector.vue b/src/components/LocationSelectorDialog.vue similarity index 100% rename from src/components/LocationSelector.vue rename to src/components/LocationSelectorDialog.vue diff --git a/src/views/AddPriceMultiple.vue b/src/views/AddPriceMultiple.vue index 104feeed14f..f21ebc10336 100644 --- a/src/views/AddPriceMultiple.vue +++ b/src/views/AddPriceMultiple.vue @@ -96,7 +96,7 @@ {{ getNominatimLocationTitle(location, true, true, true) }}
- {{ $t('AddPriceSingle.WhereWhen.Find') }} + {{ $t('AddPriceSingle.WhereWhen.Find') }}

{{ $t('AddPriceSingle.WhereWhen.SelectLocation') }}

{{ $t('AddPriceSingle.WhereWhen.Date') }}

@@ -166,8 +166,8 @@ - {{ $t('AddPriceSingle.ProductInfo.ScanBarcode') }} - {{ $t('AddPriceSingle.ProductInfo.TypeBarcode') }} + {{ $t('AddPriceSingle.ProductInfo.ScanBarcode') }} + {{ $t('AddPriceSingle.ProductInfo.TypeBarcode') }} @@ -284,24 +284,24 @@ :timeout="2000" >{{ $t('AddPriceMultiple.ProductPriceDetails.PriceUploaded') }} - - + - + + @close="barcodeManualInputDialog = false" + > import('../components/LocationSelector.vue')), + 'LocationSelector': defineAsyncComponent(() => import('../components/LocationSelectorDialog.vue')), 'PriceInputRow': defineAsyncComponent(() => import('../components/PriceInputRow.vue')), 'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')), 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')), - 'BarcodeScanner': defineAsyncComponent(() => import('../components/BarcodeScanner.vue')), - 'BarcodeManualInput': defineAsyncComponent(() => import('../components/BarcodeManualInput.vue')), + 'BarcodeScanner': defineAsyncComponent(() => import('../components/BarcodeScannerDialog.vue')), + 'BarcodeManualInputDialog': defineAsyncComponent(() => import('../components/BarcodeManualInputDialog.vue')), 'UserRecentProofsDialog': defineAsyncComponent(() => import('../components/UserRecentProofsDialog.vue')), }, data() { @@ -360,7 +360,7 @@ export default { proofSelectedSuccessMessage: false, proofisSelected: false, // location data - locationSelector: false, + locationSelectorDialog: false, locationSelectedDisplayName: '', // product price data productPriceUploadedList: [], @@ -385,8 +385,8 @@ export default { categoryTags: [], // list of category tags for autocomplete // see initPriceMultipleForm originTags: [], // list of origins tags for autocomplete // see initPriceMultipleForm labelsTags: LabelsTags, - barcodeScanner: false, - barcodeManualInput: false, + barcodeScannerDialog: false, + barcodeManualInputDialog: false, categoryPricePerList: [ {key: 'KILOGRAM', value: this.$t('AddPriceSingle.CategoryPricePer.PerKg'), icon: 'mdi-weight-kilogram'}, {key: 'UNIT', value: this.$t('AddPriceSingle.CategoryPricePer.PerUnit'), icon: 'mdi-numeric-1-circle'} @@ -535,11 +535,8 @@ export default { this.proofImagePreview = null this.addPriceMultipleForm.proof_id = null }, - showLocationSelector() { - this.locationSelector = true - }, - closeLocationSelector(event) { - this.locationSelector = false + showLocationSelectorDialog() { + this.locationSelectorDialog = true }, getNominatimLocationTitle(location, withName=true, withRoad=false, withCity=true) { return utils.getLocationTitle(location, withName, withRoad, withCity) @@ -553,11 +550,11 @@ export default { isSelectedLocation(location) { return this.locationSelectedDisplayName && this.locationSelectedDisplayName === location.display_name }, - showBarcodeScanner() { - this.barcodeScanner = true + showBarcodeScannerDialog() { + this.barcodeScannerDialog = true }, - showBarcodeManualInput() { - this.barcodeManualInput = true + showBarcodeManualInputDialog() { + this.barcodeManualInputDialog = true }, setProductCode(code) { this.productPriceForm.product_code = code diff --git a/src/views/AddPriceSingle.vue b/src/views/AddPriceSingle.vue index df971404de6..0ee18583912 100644 --- a/src/views/AddPriceSingle.vue +++ b/src/views/AddPriceSingle.vue @@ -29,11 +29,11 @@ - + {{ $t('AddPriceSingle.ProductInfo.Scan') }} {{ $t('AddPriceSingle.ProductInfo.ScanBarcode') }} - + {{ $t('AddPriceSingle.ProductInfo.Type') }} {{ $t('AddPriceSingle.ProductInfo.TypeBarcode') }} @@ -45,7 +45,7 @@ type="text" hint="EAN" hide-details="auto" - @click:prepend-inner="showBarcodeScanner" + @click:prepend-inner="showBarcodeScannerDialog" > @@ -185,7 +185,7 @@ {{ getNominatimLocationTitle(location, true, true, true) }}
- {{ $t('AddPriceSingle.WhereWhen.Find') }} + {{ $t('AddPriceSingle.WhereWhen.Find') }}

{{ $t('AddPriceSingle.WhereWhen.SelectLocation') }}

{{ $t('AddPriceSingle.WhereWhen.Date') }}

@@ -231,24 +231,24 @@ :timeout="2000" >{{ $t('AddPriceSingle.PriceDetails.ProofSelected') }} - - + - + + @close="locationSelectorDialog = false" + > import('../components/PriceInputRow.vue')), 'ProductCard': defineAsyncComponent(() => import('../components/ProductCard.vue')), - 'BarcodeScanner': defineAsyncComponent(() => import('../components/BarcodeScanner.vue')), - 'BarcodeManualInput': defineAsyncComponent(() => import('../components/BarcodeManualInput.vue')), - 'LocationSelector': defineAsyncComponent(() => import('../components/LocationSelector.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() { @@ -314,10 +314,10 @@ export default { categoryTags: [], // list of category tags for autocomplete // see initPriceSingleForm originTags: [], // list of origins tags for autocomplete // see initPriceSingleForm labelsTags: LabelsTags, - barcodeScanner: false, - barcodeManualInput: false, + barcodeScannerDialog: false, + barcodeManualInputDialog: false, // location data - locationSelector: false, + locationSelectorDialog: false, locationSelectedDisplayName: '', // proof data userRecentProofsDialog: false, @@ -475,11 +475,11 @@ export default { this.proofImagePreview = null this.addPriceSingleForm.proof_id = null }, - showBarcodeScanner() { - this.barcodeScanner = true + showBarcodeScannerDialog() { + this.barcodeScannerDialog = true }, - showBarcodeManualInput() { - this.barcodeManualInput = true + showBarcodeManualInputDialog() { + this.barcodeManualInputDialog = true }, setProductCode(code) { this.addPriceSingleForm.product_code = code @@ -494,8 +494,8 @@ export default { alert("Error: Open Prices server error") }) }, - showLocationSelector() { - this.locationSelector = true + showLocationSelectorDialog() { + this.locationSelectorDialog = true }, getNominatimLocationTitle(location, withName=true, withRoad=false, withCity=true) { return utils.getLocationTitle(location, withName, withRoad, withCity) diff --git a/src/views/Search.vue b/src/views/Search.vue index 7a97b6e958e..ae89666aae7 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -14,7 +14,7 @@ inputmode="numeric" :prepend-inner-icon="formFilled ? 'mdi-barcode' : 'mdi-barcode-scan'" append-inner-icon="mdi-magnify" - @click:prepend-inner="showBarcodeScanner" + @click:prepend-inner="showBarcodeScannerDialog" @click:append-inner="search" :rules="[fieldRequired]" :loading="loading" @@ -34,12 +34,12 @@ - + @close="barcodeScannerDialog = false" + >