From 12a4cf4a67fab46140e957c571dd8da16871f464 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 d1527d49b9..47c9759548 100644 --- a/src/components/LocationInputRow.vue +++ b/src/components/LocationInputRow.vue @@ -4,6 +4,17 @@

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

+ + + + + {{ getLocationTitle(currentLocation, true, true, true) }} + {{ getLocationTitle(location, true, true, true) }} -
+ + +
{{ $t('AddPriceSingle.WhereWhen.Find') }} @@ -50,6 +63,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 2a459f22e9..6e771527f3 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() {