Skip to content

Commit

Permalink
Fix files
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed May 25, 2024
1 parent dfdc95f commit d931f7f
Show file tree
Hide file tree
Showing 50 changed files with 286 additions and 160 deletions.
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/components/BarcodeScannerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</template>

<script>
import { Html5Qrcode, Html5QrcodeScanType, Html5QrcodeSupportedFormats } from 'html5-qrcode'
import { Html5Qrcode, Html5QrcodeScanType } from 'html5-qrcode'
const config = {
fps: 10,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</template>
</i18n-t>
<br />
<v-btn v-for="source in sourceList" class="mr-1" size="x-small" rounded="xl" active :prepend-icon="source.icon" :href="source.url" target="_blank">
<v-btn v-for="source in sourceList" :key="source.source" class="mr-1" size="x-small" rounded="xl" active :prepend-icon="source.icon" :href="source.url" target="_blank">
{{ source.label }}
<v-tooltip activator="parent" open-on-click location="top">{{ source.name }}</v-tooltip>
</v-btn>
Expand All @@ -29,7 +29,7 @@ import constants from '../constants'
export default {
components: {
'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/LocationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import utils from '../utils.js'
export default {
components: {
'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
},
props: {
location: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/LocationSelectorDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
class="mb-2"
width="100%"
v-for="location in results"
:key="getLocationUniqueID(location)"
elevation="1"
@click="selectLocation(location)">
<v-card-text>
Expand All @@ -57,7 +58,7 @@
<v-col cols="12" sm="6" style="min-height:200px">
<l-map ref="map" v-model:zoom="mapZoom" :center="mapCenter" :use-global-leaflet="false" @ready="initMap">
<l-tile-layer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" layer-type="base" name="OpenStreetMap"></l-tile-layer>
<l-marker v-for="location in results" :lat-lng="getLocationLatLng(location)">
<l-marker v-for="location in results" :key="getLocationUniqueID(location)" :lat-lng="getLocationLatLng(location)">
<l-popup>
<h4>{{ getLocationTitle(location, true, false, false) }}</h4>
{{ getLocationTitle(location, false, true, true) }}<br />
Expand Down
11 changes: 7 additions & 4 deletions src/components/PriceActionMenuButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ import { defineAsyncComponent } from 'vue'
export default {
components: {
'PriceEditDialog': defineAsyncComponent(() => import('../components/PriceEditDialog.vue')),
'PriceDeleteConfirmationDialog': defineAsyncComponent(() => import('../components/PriceDeleteConfirmationDialog.vue'))
PriceEditDialog: defineAsyncComponent(() => import('../components/PriceEditDialog.vue')),
PriceDeleteConfirmationDialog: defineAsyncComponent(() => import('../components/PriceDeleteConfirmationDialog.vue'))
},
props: {
'price': null,
'style': {
price: {
type: Object,
default: null
},
style: {
type: String,
default: 'position:absolute;bottom:6px;right:0;'
}
Expand Down
66 changes: 48 additions & 18 deletions src/components/PriceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,56 @@ import utils from '../utils.js'
export default {
components: {
'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
'ProductBrands': defineAsyncComponent(() => import('../components/ProductBrands.vue')),
'ProductQuantityChip': defineAsyncComponent(() => import('../components/ProductQuantityChip.vue')),
'ProductMissingChip': defineAsyncComponent(() => import('../components/ProductMissingChip.vue')),
'PriceOrigins': defineAsyncComponent(() => import('../components/PriceOrigins.vue')),
'PriceLabels': defineAsyncComponent(() => import('../components/PriceLabels.vue')),
'PricePriceRow': defineAsyncComponent(() => import('../components/PricePriceRow.vue')),
'PriceFooterRow': defineAsyncComponent(() => import('../components/PriceFooterRow.vue'))
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
ProductBrands: defineAsyncComponent(() => import('../components/ProductBrands.vue')),
ProductQuantityChip: defineAsyncComponent(() => import('../components/ProductQuantityChip.vue')),
ProductMissingChip: defineAsyncComponent(() => import('../components/ProductMissingChip.vue')),
PriceOrigins: defineAsyncComponent(() => import('../components/PriceOrigins.vue')),
PriceLabels: defineAsyncComponent(() => import('../components/PriceLabels.vue')),
PricePriceRow: defineAsyncComponent(() => import('../components/PricePriceRow.vue')),
PriceFooterRow: defineAsyncComponent(() => import('../components/PriceFooterRow.vue'))
},
props: {
'price': null,
'product': null,
'hideProductImage': false,
'hideProductTitle': false,
'hideProductDetails': false,
'hidePriceDate': false,
'hidePriceFooterRow': false,
'hidePriceLocation': false,
'hidePriceProof': false,
'readonly': false
price: {
type: Object,
default: null
},
product: {
type: Object,
default: null
},
hideProductImage: {
type: Boolean,
default: false
},
hideProductTitle: {
type: Boolean,
default: false
},
hideProductDetails: {
type: Boolean,
default: false
},
hidePriceDate: {
type: Boolean,
default: false
},
hidePriceFooterRow: {
type: Boolean,
default: false
},
hidePriceLocation: {
type: Boolean,
default: false
},
hidePriceProof: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
},
data() {
return {
Expand Down
10 changes: 8 additions & 2 deletions src/components/PriceCountChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
<script>
export default {
props: {
'count': null,
'withLabel': false
count: {
type: Number,
default: null
},
withLabel: {
type: Boolean,
default: false
},
},
methods: {
getColor() {
Expand Down
7 changes: 5 additions & 2 deletions src/components/PriceDeleteConfirmationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ import api from '../services/api'
export default {
components: {
'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue'))
PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue'))
},
props: {
'price': null,
price: {
type: Object,
default: null
},
},
data() {
return {
Expand Down
9 changes: 6 additions & 3 deletions src/components/PriceEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ import api from '../services/api'
export default {
components: {
'PriceCard': defineAsyncComponent(() => import('../components/PriceCard.vue')),
'PriceInputRow': defineAsyncComponent(() => import('../components/PriceInputRow.vue')),
PriceCard: defineAsyncComponent(() => import('../components/PriceCard.vue')),
PriceInputRow: defineAsyncComponent(() => import('../components/PriceInputRow.vue')),
},
props: {
price: null,
price: {
type: Object,
default: null
},
},
data() {
return {
Expand Down
30 changes: 21 additions & 9 deletions src/components/PriceFooterRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,29 @@ import { useAppStore } from '../store'
export default {
components: {
'PriceLocationChip': defineAsyncComponent(() => import('../components/PriceLocationChip.vue')),
'PriceOwnerChip': defineAsyncComponent(() => import('../components/PriceOwnerChip.vue')),
'RelativeDateTimeChip': defineAsyncComponent(() => import('../components/RelativeDateTimeChip.vue')),
'PriceProof': defineAsyncComponent(() => import('../components/PriceProof.vue')),
'PriceActionMenuButton': defineAsyncComponent(() => import('../components/PriceActionMenuButton.vue')),
PriceLocationChip: defineAsyncComponent(() => import('../components/PriceLocationChip.vue')),
PriceOwnerChip: defineAsyncComponent(() => import('../components/PriceOwnerChip.vue')),
RelativeDateTimeChip: defineAsyncComponent(() => import('../components/RelativeDateTimeChip.vue')),
PriceProof: defineAsyncComponent(() => import('../components/PriceProof.vue')),
PriceActionMenuButton: defineAsyncComponent(() => import('../components/PriceActionMenuButton.vue')),
},
props: {
'price': null,
'hidePriceLocation': false,
'hidePriceProof': false,
'readonly': false
price: {
type: Object,
default: null
},
hidePriceLocation: {
type: Boolean,
default: false
},
hidePriceProof: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
},
computed: {
...mapStores(useAppStore),
Expand Down
2 changes: 1 addition & 1 deletion src/components/PriceInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { defineAsyncComponent } from 'vue'
export default {
components: {
'ChangeCurrencyDialog': defineAsyncComponent(() => import('../components/ChangeCurrencyDialog.vue')),
ChangeCurrencyDialog: defineAsyncComponent(() => import('../components/ChangeCurrencyDialog.vue')),
},
props: {
priceForm: null, // price, currency, price_is_discounted, price_without_discount
Expand Down
10 changes: 8 additions & 2 deletions src/components/PriceLocationChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 8 additions & 2 deletions src/components/PriceOwnerChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
<script>
export default {
props: {
'price': null,
'readonly': false
price: {
type: Object,
default: null
},
readonly: {
type: Boolean,
default: false
},
},
methods: {
goToUser() {
Expand Down
20 changes: 16 additions & 4 deletions src/components/PricePriceRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,22 @@ import utils from '../utils.js'
export default {
props: {
'price': null,
'productQuantity': null,
'productQuantityUnit': constants.PRODUCT_QUANTITY_UNIT_G,
'hidePriceDate': false
price: {
type: Object,
default: null
},
productQuantity: {
type: Number,
default: null
},
productQuantityUnit: {
type: String,
default: constants.PRODUCT_QUANTITY_UNIT_G
},
hidePriceDate: {
type: Boolean,
default: false
},
},
data() {
return {}
Expand Down
5 changes: 4 additions & 1 deletion src/components/PriceProof.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default {
ProofCard,
},
props: {
'proof': null,
proof: {
type: Object,
default: null
},
},
data() {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductBrands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { defineAsyncComponent } from 'vue'
export default {
components: {
'ProductBrandsDialog': defineAsyncComponent(() => import('../components/ProductBrandsDialog.vue')),
ProductBrandsDialog: defineAsyncComponent(() => import('../components/ProductBrandsDialog.vue')),
},
props: {
productBrands: String,
Expand Down
38 changes: 25 additions & 13 deletions src/components/ProductCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,33 @@ import { useAppStore } from '../store'
export default {
components: {
'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
'ProductBrands': defineAsyncComponent(() => import('../components/ProductBrands.vue')),
'ProductQuantityChip': defineAsyncComponent(() => import('../components/ProductQuantityChip.vue')),
'ProductCategoriesChip': defineAsyncComponent(() => import('../components/ProductCategoriesChip.vue')),
'ProductLabelsChip': defineAsyncComponent(() => import('../components/ProductLabelsChip.vue')),
'ProductMissingChip': defineAsyncComponent(() => import('../components/ProductMissingChip.vue')),
'ProductBarcodeChip': defineAsyncComponent(() => import('../components/ProductBarcodeChip.vue')),
'PricePriceRow': defineAsyncComponent(() => import('../components/PricePriceRow.vue')),
'PriceFooterRow': defineAsyncComponent(() => import('../components/PriceFooterRow.vue')),
PriceCountChip: defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
ProductBrands: defineAsyncComponent(() => import('../components/ProductBrands.vue')),
ProductQuantityChip: defineAsyncComponent(() => import('../components/ProductQuantityChip.vue')),
ProductCategoriesChip: defineAsyncComponent(() => import('../components/ProductCategoriesChip.vue')),
ProductLabelsChip: defineAsyncComponent(() => import('../components/ProductLabelsChip.vue')),
ProductMissingChip: defineAsyncComponent(() => import('../components/ProductMissingChip.vue')),
ProductBarcodeChip: defineAsyncComponent(() => import('../components/ProductBarcodeChip.vue')),
PricePriceRow: defineAsyncComponent(() => import('../components/PricePriceRow.vue')),
PriceFooterRow: defineAsyncComponent(() => import('../components/PriceFooterRow.vue')),
},
props: {
'product': null,
'latestPrice': null,
'hideProductBarcode': false,
'readonly': false
product: {
type: Object,
default: null
},
latestPrice: {
type: Object,
default: null
},
hideProductBarcode: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
},
data() {
return {
Expand Down
Loading

0 comments on commit d931f7f

Please sign in to comment.