From 6e588d26c8099a072ef368a1d1550c2c8bc4db42 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Sun, 27 Oct 2024 01:11:29 +0200 Subject: [PATCH] temp --- src/components/LocationInputRow.vue | 19 ++++++++++++++++++- src/components/ProofEditDialog.vue | 10 ++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/LocationInputRow.vue b/src/components/LocationInputRow.vue index e4627cadc65..8235ae0f306 100644 --- a/src/components/LocationInputRow.vue +++ b/src/components/LocationInputRow.vue @@ -4,8 +4,21 @@

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

+ + + + + {{ getLocationTitle(currentLocation, true, true, true) }} + -
+ + +
{{ $t('AddPriceSingle.WhereWhen.Find') }} @@ -43,6 +56,10 @@ export default { location_osm_type: null }) }, + currentLocation: { + type: Object, + default: null + }, maxRecentLocations: { type: Number, default: 3 diff --git a/src/components/ProofEditDialog.vue b/src/components/ProofEditDialog.vue index 2a459f22e98..6e771527f31 100644 --- a/src/components/ProofEditDialog.vue +++ b/src/components/ProofEditDialog.vue @@ -15,6 +15,7 @@ + @@ -44,6 +45,7 @@ export default { components: { ProofCard: defineAsyncComponent(() => import('../components/ProofCard.vue')), ProofTypeInputRow: defineAsyncComponent(() => import('../components/ProofTypeInputRow.vue')), + LocationInputRow: defineAsyncComponent(() => import('../components/LocationInputRow.vue')), ProofMetadataInputRow: defineAsyncComponent(() => import('../components/ProofMetadataInputRow.vue')), }, props: { @@ -57,6 +59,9 @@ export default { return { updateProofForm: { type: null, + location_id: null, + location_osm_id: null, + location_osm_type: null, date: null, currency: null, receipt_price_count: null, @@ -67,8 +72,9 @@ export default { }, computed: { formFilled() { - let keys = ['type', 'date', 'currency'] - return Object.values(this.updateProofForm).filter(k => keys.includes(k)).every(k => !!this.updateProofForm[k]) + let keysOSM = Object.keys(this.updateProofForm).filter(k => !['location_id', 'receipt_price_count', 'receipt_price_total'].includes(k)) + let keysONLINE = Object.keys(this.updateProofForm).filter(k => !['location_osm_id', 'location_osm_type', 'receipt_price_count', 'receipt_price_total'].includes(k)) + return Object.keys(this.updateProofForm).filter(k => keysOSM.includes(k)).every(k => !!this.updateProofForm[k]) || Object.keys(this.updateProofForm).filter(k => keysONLINE.includes(k)).every(k => !!this.updateProofForm[k]) }, }, mounted() {