From d3662b824074b253fb3596b89f7598d19239d0ad Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 9 Apr 2026 22:22:27 +0000 Subject: [PATCH] Preserve the locator model This makes it possible to move back-and-forth in the compliance process and still retain data. --- ts/components/AddressSuggestion.vue | 33 +++++++-- ts/rmo/components/AddressAndMapLocator.vue | 78 ++++++++++------------ ts/rmo/content/Nuisance.vue | 18 ++++- ts/rmo/content/Water.vue | 39 ++++++----- ts/rmo/content/compliance/Address.vue | 14 ++-- ts/rmo/view/Compliance.vue | 26 ++++++-- 6 files changed, 127 insertions(+), 81 deletions(-) diff --git a/ts/components/AddressSuggestion.vue b/ts/components/AddressSuggestion.vue index 5cda764e..3097aed0 100644 --- a/ts/components/AddressSuggestion.vue +++ b/ts/components/AddressSuggestion.vue @@ -76,23 +76,22 @@ diff --git a/ts/rmo/view/Compliance.vue b/ts/rmo/view/Compliance.vue index 0ca634f8..a983d4ad 100644 --- a/ts/rmo/view/Compliance.vue +++ b/ts/rmo/view/Compliance.vue @@ -20,13 +20,13 @@ body > .container-fluid { @@ -50,7 +50,7 @@ import { type Permission } from "@/rmo/content/compliance/Permission.vue"; export interface Compliance { comments: string; contact?: Contact; - locator?: Locator; + locator: Locator; images: Image[]; permission?: Permission; } @@ -63,6 +63,23 @@ const districtStore = useStoreDistrict(); const compliance = ref({ comments: "", images: [], + locator: { + address: { + country: "", + gid: "", + locality: "", + number: "", + postal_code: "", + raw: "", + region: "", + street: "", + unit: "", + }, + location: { + latitude: 0, + longitude: 0, + }, + }, }); const props = defineProps(); const district = computedAsync(async (): Promise => { @@ -81,9 +98,8 @@ function doImages(images: Image[]) { console.log("images", images); compliance.value.images = images; } -function doLocator(locator: Locator | undefined) { - console.log("locator", locator); - compliance.value.locator = locator; +function doLocator() { + console.log("locator done", compliance.value.locator); } function doPermission(permission: Permission | undefined) { console.log("permission", permission);