From cd2be2698b7f10aa16928529f1b3342f46551625 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 21 Jun 2024 01:01:40 +0200 Subject: [PATCH] refactor(proof add): forgot to commit currency field. ref #639 --- src/components/ProofInputRow.vue | 4 ++-- src/i18n/locales/en.json | 1 + src/router.js | 2 +- src/views/ProofAddSingle.vue | 27 +++++++++++++++++++++++---- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/components/ProofInputRow.vue b/src/components/ProofInputRow.vue index 87a193cf5b..fc3f827b67 100644 --- a/src/components/ProofInputRow.vue +++ b/src/components/ProofInputRow.vue @@ -15,7 +15,7 @@ {{ $t('AddPriceSingle.PriceDetails.Gallery') }} {{ $t('AddPriceSingle.PriceDetails.SelectFromGallery') }} - + {{ $t('AddPriceSingle.PriceDetails.RecentProof') }} {{ $t('AddPriceSingle.PriceDetails.SelectRecentProof') }} @@ -104,7 +104,7 @@ export default { type: Object, default: () => ({ proof_id: null, date: utils.currentDate() }) }, - hideRecentProofOption: { + hideRecentProofChoice: { type: Boolean, default: false }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 70dae58253..ff920a6822 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -110,6 +110,7 @@ "AddPrice": "Add a price", "AddToOFF": "Add to {name}", "Country": "Country", + "Currency": "Currency", "Language": "Languages", "Locations": "Locations", "Date": "Date", diff --git a/src/router.js b/src/router.js index e7b04e4cbb..357893b027 100644 --- a/src/router.js +++ b/src/router.js @@ -12,7 +12,7 @@ const routes = [ { path: '/settings', name: 'settings', component: () => import('./views/UserSettings.vue'), meta: { title: 'Settings', requiresAuth: true } }, { path: '/search', name: 'search', component: () => import('./views/Search.vue'), meta: { title: 'Search', icon: 'mdi-magnify', drawerMenu: true }}, { path: '/prices', name: 'prices', component: () => import('./views/PriceList.vue'), meta: { title: 'LatestPrices', icon: 'mdi-tag-multiple-outline', drawerMenu: true }}, - { path: '/prices/add', name: 'price-add', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', icon: 'mdi-plus', drawerMenu: true, color: 'primary', requiresAuth: true }}, + { path: '/prices/add', name: 'add-price', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', icon: 'mdi-plus', drawerMenu: true, color: 'primary', requiresAuth: true }}, { path: '/prices/add/single', name: 'add-price-single', component: () => import('./views/AddPriceSingle.vue'), meta: { title: 'Add a single price (price tag)', requiresAuth: true }}, { path: '/prices/add/multiple/price-tag', name: 'add-price-multiple-price-tag', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (price tags)', requiresAuth: true }}, { path: '/prices/add/multiple/receipt', name: 'add-price-multiple-receipt', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'Add multiple prices (receipt)', requiresAuth: true }}, diff --git a/src/views/ProofAddSingle.vue b/src/views/ProofAddSingle.vue index d2a860244e..4224fcb6a8 100644 --- a/src/views/ProofAddSingle.vue +++ b/src/views/ProofAddSingle.vue @@ -44,7 +44,7 @@ - + @@ -64,14 +64,29 @@

- {{ $t('AddPriceSingle.WhereWhen.Date') }} + {{ $t('Common.Date') }}

+ + + +

+ {{ $t('Common.Currency') }} +

+ + + @@ -117,6 +132,7 @@ export default { type: 'PRICE_TAG', proof_id: null, date: utils.currentDate(), + currency: null, }, loading: false, } @@ -132,7 +148,7 @@ export default { return Object.keys(this.addProofSingleForm).filter(k => keys.includes(k)).every(k => !!this.addProofSingleForm[k]) }, proofDetailsFormFilled() { - let keys = ['date'] + let keys = ['date', 'currency'] return Object.keys(this.addProofSingleForm).filter(k => keys.includes(k)).every(k => !!this.addProofSingleForm[k]) }, formFilled() { @@ -149,6 +165,9 @@ export default { }, disableProofDetailsForm() { return !this.proofTypeFormFilled || !this.proofImageFormFilled + }, + userFavoriteCurrencies() { + return this.appStore.getUserFavoriteCurrencies } }, methods: {