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 03773a4 commit f891a80
Show file tree
Hide file tree
Showing 71 changed files with 1,186 additions and 822 deletions.
6 changes: 1 addition & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ GitHub Actions:

Price addition:
- 'src/views/AddPriceHome.vue'

Multiple price addition:
- 'src/views/AddPriceSingle.vue'
- 'src/views/AddPriceMultiple.vue'

Brands:
Expand All @@ -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'

Expand All @@ -36,4 +33,3 @@ User dashboard:

⚙️ Settings:
- 'src/views/UserSettings.vue'

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
11 changes: 7 additions & 4 deletions src/components/BarcodeManualInputDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<v-dialog persistent>
<v-card>
<v-card-title>
{{ $t('BarcodeManualInput.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close"></v-btn>
{{ $t('BarcodeManualInput.Title') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
</v-card-title>

<v-divider></v-divider>
<v-divider />

<v-card-text>
<v-form @submit.prevent="onSubmit">
Expand All @@ -18,13 +18,15 @@
prepend-inner-icon="mdi-barcode"
:hint="barcodeForm.barcode.length.toString()"
persistent-hint
></v-text-field>
/>

<v-btn
type="submit"
class="mt-2"
:disabled="!formFilled"
>{{ $t('BarcodeManualInput.Submit') }}</v-btn>
>
{{ $t('BarcodeManualInput.Submit') }}
</v-btn>
</v-form>
</v-card-text>
</v-card>
Expand All @@ -33,6 +35,7 @@

<script>
export default {
emits: ['barcode', 'close'],
data() {
return {
barcodeForm: {
Expand Down
15 changes: 8 additions & 7 deletions src/components/BarcodeScannerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<v-dialog scrollable persistent>
<v-card>
<v-card-title>
{{ $t('BarcodeScanner.Scan') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close"></v-btn>
{{ $t('BarcodeScanner.Scan') }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
</v-card-title>

<v-divider></v-divider>
<v-divider />

<v-card-text>
<div id="reader" width="500px"></div>
<div id="reader" width="500px" />
</v-card-text>

<v-divider></v-divider>
<v-divider />

<v-card-actions class="justify-end">
<div>
Expand All @@ -27,7 +27,7 @@
</template>

<script>
import { Html5Qrcode, Html5QrcodeScanType, Html5QrcodeSupportedFormats } from 'html5-qrcode'
import { Html5Qrcode, Html5QrcodeScanType } from 'html5-qrcode'
const config = {
fps: 10,
Expand All @@ -39,6 +39,7 @@ const config = {
}
export default {
emits: ['barcode', 'close'],
data() {
return {
scanner: null,
Expand All @@ -52,11 +53,11 @@ export default {
this.scanner = new Html5Qrcode('reader')
this.scanner.start({ facingMode: 'environment' }, config, this.onScanSuccess, this.onScanFailure)
},
onScanSuccess(decodedText, decodedResult) {
onScanSuccess(decodedText, decodedResult) { // eslint-disable-line no-unused-vars
this.$emit('barcode', decodedText)
this.close()
},
onScanFailure(error) {
onScanFailure(error) { // eslint-disable-line no-unused-vars
// console.warn(`Code scan error = ${error}`)
},
close() {
Expand Down
10 changes: 5 additions & 5 deletions src/components/ChangeCurrencyDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<v-dialog>
<v-card>
<v-card-title>
{{ $t("ChangeCurrencyDialog.Title") }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close"></v-btn>
{{ $t("ChangeCurrencyDialog.Title") }} <v-btn style="float:right;" variant="text" density="compact" icon="mdi-close" @click="close" />
</v-card-title>

<v-divider></v-divider>
<v-divider />

<v-card-text>
<v-row>
Expand All @@ -15,7 +15,7 @@
:label="$t('ChangeCurrencyDialog.Currency')"
:items="userFavoriteCurrencies"
hide-details="auto"
></v-select>
/>
</v-col>
<v-col cols="12">
<v-btn class="mb-2" size="small" prepend-icon="mdi-cog-outline" @click="goToSettings">
Expand All @@ -28,7 +28,7 @@
</v-row>
</v-card-text>

<v-divider></v-divider>
<v-divider />

<v-card-actions>
<v-btn elevation="1" @click="selectedCurrency">
Expand All @@ -43,6 +43,7 @@
import { useAppStore } from '../store'
export default {
emits: ['newCurrencySelected', 'close'],
data() {
return {
userFavoriteCurrencies: [],
Expand All @@ -51,7 +52,6 @@ export default {
},
computed: {
},
emits: ['newCurrencySelected', 'close'],
mounted() {
this.getCurrencyData()
},
Expand Down
15 changes: 10 additions & 5 deletions src/components/FilterMenu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-menu scroll-strategy="close">
<template v-slot:activator="{ props }">
<template #activator="{ props }">
<v-btn v-bind="props" size="x-small" class="mr-2" rounded="xl" prepend-icon="mdi-filter-variant" :append-icon="getCurrentFilterIcon" :active="currentFilterOrSource">
{{ $t('Common.Filter') }}
</v-btn>
Expand All @@ -10,8 +10,10 @@
{{ $t('Common.' + filter.value) }}
</v-list-item>
<v-sheet v-if="showSource">
<v-divider></v-divider>
<v-list-subheader class="text-uppercase">{{ $t('Common.Source') }}</v-list-subheader>
<v-divider />
<v-list-subheader class="text-uppercase">
{{ $t('Common.Source') }}
</v-list-subheader>
<v-list-item v-for="source in productSourceList" :key="source.key" :slim="true" :active="currentSource === source.key" @click="selectSource(source.key)">
<v-icon>{{ source.icon }}</v-icon>
{{ source.value }}
Expand All @@ -26,7 +28,10 @@ import constants from '../constants'
export default {
props: {
currentFilter: String,
currentFilter: {
type: String,
default: null
},
currentSource: {
type: String,
default: null
Expand All @@ -41,6 +46,7 @@ export default {
default: false
}
},
emits: ['update:currentFilter', 'update:currentSource'],
data() {
return {
productSourceList: constants.PRODUCT_SOURCE_LIST,
Expand All @@ -63,7 +69,6 @@ export default {
return source ? source.icon : ''
},
},
emits: ['update:currentFilter', 'update:currentSource'],
methods: {
selectFilter(filter) {
this.$emit('update:currentFilter', filter)
Expand Down
28 changes: 19 additions & 9 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,31 @@
<v-row>
<v-col cols="12" md="6" align="center">
<i18n-t keypath="Footer.TagLine" tag="span">
<template #name>{{ APP_NAME }}</template>
<template #name>
{{ APP_NAME }}
</template>
<template #url>
<OpenFoodFactsLink display="link"></OpenFoodFactsLink>
<OpenFoodFactsLink display="link" />
</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">
<br>
<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-tooltip activator="parent" open-on-click location="top">
{{ source.name }}
</v-tooltip>
</v-btn>
</v-col>
<v-col cols="12" md="6" align="center">
<v-btn class="mx-2" variant="text" href="https://prices.openfoodfacts.org" target="_blank">{{ $t('Footer.About') }}</v-btn>
<v-btn class="mx-2" variant="text" to="/stats">{{ $t('Footer.Stats') }}</v-btn>
<v-btn class="mx-2" variant="text" href="https://github.com/openfoodfacts/open-prices-frontend" target="_blank">Github</v-btn>
<v-btn class="mx-2" variant="text" href="https://prices.openfoodfacts.org" target="_blank">
{{ $t('Footer.About') }}
</v-btn>
<v-btn class="mx-2" variant="text" to="/stats">
{{ $t('Footer.Stats') }}
</v-btn>
<v-btn class="mx-2" variant="text" href="https://github.com/openfoodfacts/open-prices-frontend" target="_blank">
Github
</v-btn>
</v-col>
</v-row>
</v-footer>
Expand All @@ -29,7 +39,7 @@ import constants from '../constants'
export default {
components: {
'OpenFoodFactsLink': defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
OpenFoodFactsLink: defineAsyncComponent(() => import('../components/OpenFoodFactsLink.vue')),
},
data() {
return {
Expand Down
40 changes: 26 additions & 14 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
<template>
<v-app-bar :elevation="1" style="background-color: rgb(242, 233, 228);">
<v-app-bar-nav-icon @click.stop="showDrawerMenu = !showDrawerMenu"></v-app-bar-nav-icon>
<v-app-bar-nav-icon @click.stop="showDrawerMenu = !showDrawerMenu" />
<v-app-bar-title>
<span style="cursor:pointer" @click="$router.push('/')">
<img src="/favicon.svg" height="28" width="28" style="vertical-align:bottom">
{{ APP_NAME }}
</span>
</v-app-bar-title>
<template v-if="!username" v-slot:append>
<v-btn v-if="!$vuetify.display.smAndUp" icon="mdi-login" to="/sign-in" :aria-label="$t('Header.SignIn')"></v-btn>
<v-btn v-else prepend-icon="mdi-login" to="/sign-in" :aria-label="$t('Header.SignIn')">{{ $t('Header.SignIn') }}</v-btn>
<template v-if="!username" #append>
<v-btn v-if="!$vuetify.display.smAndUp" icon="mdi-login" to="/sign-in" :aria-label="$t('Header.SignIn')" />
<v-btn v-else prepend-icon="mdi-login" to="/sign-in" :aria-label="$t('Header.SignIn')">
{{ $t('Header.SignIn') }}
</v-btn>
</template>
<template v-else v-slot:append>
<template v-else #append>
<v-menu scroll-strategy="close">
<template v-slot:activator="{ props }">
<v-btn v-if="!$vuetify.display.smAndUp" v-bind="props" icon="mdi-account-circle"></v-btn>
<v-btn v-else v-bind="props" class="text-lowercase" prepend-icon="mdi-account-circle">{{ username }}</v-btn>
<template #activator="{ props }">
<v-btn v-if="!$vuetify.display.smAndUp" v-bind="props" icon="mdi-account-circle" />
<v-btn v-else v-bind="props" class="text-lowercase" prepend-icon="mdi-account-circle">
{{ username }}
</v-btn>
</template>
<v-list>
<v-list-item class="d-sm-none" :slim="true" prepend-icon="mdi-account" disabled>{{ username }}</v-list-item>
<v-divider class="d-sm-none"></v-divider>
<v-list-item :slim="true" prepend-icon="mdi-view-dashboard-outline" to="/dashboard" :aria-label="$t('Header.Dashboard')">{{ $t('Header.Dashboard') }}</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-cog-outline" to="/settings" :aria-label="$t('Header.Settings')">{{ $t('Header.Settings') }}</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-logout" @click="signOut" :aria-label="$t('Header.SignOut')">{{ $t('Header.SignOut') }}</v-list-item>
<v-list-item class="d-sm-none" :slim="true" prepend-icon="mdi-account" disabled>
{{ username }}
</v-list-item>
<v-divider class="d-sm-none" />
<v-list-item :slim="true" prepend-icon="mdi-view-dashboard-outline" to="/dashboard" :aria-label="$t('Header.Dashboard')">
{{ $t('Header.Dashboard') }}
</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-cog-outline" to="/settings" :aria-label="$t('Header.Settings')">
{{ $t('Header.Settings') }}
</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-logout" :aria-label="$t('Header.SignOut')" @click="signOut">
{{ $t('Header.SignOut') }}
</v-list-item>
</v-list>
</v-menu>
</template>
</v-app-bar>

<v-navigation-drawer v-model="showDrawerMenu" temporary>
<v-list :items="getDrawerMenuItems"></v-list>
<v-list :items="getDrawerMenuItems" />
</v-navigation-drawer>
</template>

Expand Down
7 changes: 4 additions & 3 deletions src/components/LocationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
:title="getLocationTitle(location)"
:subtitle="location ? location.osm_display_name : ''"
:prepend-icon="location ? 'mdi-map-marker-outline' : 'mdi-map-marker-remove-variant'"
@click="goToLocation(location)">
@click="goToLocation(location)"
>
<v-card-text v-if="location">
<PriceCountChip :count="location.price_count" :withLabel="true"></PriceCountChip>
<PriceCountChip :count="location.price_count" :withLabel="true" />
<v-chip label size="small" density="comfortable" class="mr-1" title="OpenStreetMap tag">
{{ location.osm_tag_key }}:{{ location.osm_tag_value }}
</v-chip>
Expand All @@ -19,7 +20,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
Loading

0 comments on commit f891a80

Please sign in to comment.