From 60eb6b9bbf35bd1e9ef132b3258c145d4aa37f26 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 10 Apr 2026 23:57:47 +0000 Subject: [PATCH] Use class heirarchy for different report types. --- ts/components/CommunicationColumnDetail.vue | 6 - ts/components/PublicReportCardNuisance.vue | 82 ++++++ ts/components/PublicReportCardWater.vue | 110 ++++++++ ts/components/PublicreportCard.vue | 207 +------------- ts/rmo/components/NuisanceReportDetail.vue | 4 +- ts/rmo/content/compliance/Address.vue | 7 +- ts/rmo/content/compliance/Contact.vue | 15 +- ts/rmo/content/compliance/Evidence.vue | 14 +- ts/rmo/content/compliance/Permission.vue | 45 ++-- ts/rmo/content/compliance/Submit.vue | 33 ++- ts/rmo/view/Compliance.vue | 108 +++----- ts/rmo/view/StatusByID.vue | 6 +- ts/type/api.ts | 282 ++++++++++++++++---- 13 files changed, 539 insertions(+), 380 deletions(-) create mode 100644 ts/components/PublicReportCardNuisance.vue create mode 100644 ts/components/PublicReportCardWater.vue diff --git a/ts/components/CommunicationColumnDetail.vue b/ts/components/CommunicationColumnDetail.vue index 80349b9d..5e5056da 100644 --- a/ts/components/CommunicationColumnDetail.vue +++ b/ts/components/CommunicationColumnDetail.vue @@ -91,13 +91,7 @@ interface Props { const emit = defineEmits(); const props = defineProps(); -const nuisance = computed(() => { - return props.selectedCommunication?.public_report?.nuisance || null; -}); const session = useSessionStore(); -const water = computed(() => { - return props.selectedCommunication?.public_report?.water || null; -}); function openPhotoViewer(index: number) { emit("viewImage", index); } diff --git a/ts/components/PublicReportCardNuisance.vue b/ts/components/PublicReportCardNuisance.vue new file mode 100644 index 00000000..60f51aa6 --- /dev/null +++ b/ts/components/PublicReportCardNuisance.vue @@ -0,0 +1,82 @@ + + diff --git a/ts/components/PublicReportCardWater.vue b/ts/components/PublicReportCardWater.vue new file mode 100644 index 00000000..ce40e152 --- /dev/null +++ b/ts/components/PublicReportCardWater.vue @@ -0,0 +1,110 @@ + + diff --git a/ts/components/PublicreportCard.vue b/ts/components/PublicreportCard.vue index 60b61e09..541f6de5 100644 --- a/ts/components/PublicreportCard.vue +++ b/ts/components/PublicreportCard.vue @@ -67,13 +67,13 @@ -
+
    -
  • +
  • Reporter is the owner of the property
  • -
  • +
  • Reporter has asked to be kept confidential
@@ -82,196 +82,12 @@
- -
-
- Nuisance Details -
-
-
-
- -
    -
  • Early
  • -
  • Daytime
  • -
  • Evening
  • -
  • Night
  • -
-
-
- -
-
    -
  • Backyard
  • -
  • Frontyard
  • -
  • Garden
  • -
  • Other
  • -
  • Pool
  • -
-
-
-
- -
    -
  • Container
  • -
  • Gutter
  • -
  • - Sprinklers & Gutters -
  • -
-
-
- -
- {{ report.nuisance?.source_description || "none" }} -
-
-
- -
- {{ report.nuisance?.duration }} -
-
-
- -
- {{ report.nuisance?.additional_info || "No additional notes" }} -
-
-
-
+
+
- -
-
- Standing Water Details -
-
-
- -
-
    -
  • Gate
  • -
  • Fence
  • -
  • Locked
  • -
  • Dog
  • -
  • Other access obstacle
  • -
-
-
-
- -
- {{ report.water?.access_comments }} -
-
- -
- - - Larvae - - - - Pupae - - - - Adult Mosquitoes - -
-
- -
- {{ report.water?.comments }} -
-
-
- -
- {{ report.water?.owner.name || "not given" }} -
-
-
- - -
-
+
+
@@ -313,10 +129,15 @@ diff --git a/ts/rmo/content/compliance/Address.vue b/ts/rmo/content/compliance/Address.vue index 8551d035..4d285fb6 100644 --- a/ts/rmo/content/compliance/Address.vue +++ b/ts/rmo/content/compliance/Address.vue @@ -30,20 +30,19 @@ import { computed, ref } from "vue"; import { router } from "@/rmo/router"; -import type { District } from "@/type/api"; +import type { District, PublicReport } from "@/type/api"; import HeaderCompliance from "@/rmo/components/HeaderCompliance.vue"; import ProgressBarCompliance from "@/rmo/components/ProgressBarCompliance.vue"; import AddressAndMapLocator from "@/rmo/components/AddressAndMapLocator.vue"; -import { Compliance } from "@/rmo/view/Compliance.vue"; import { Camera } from "@/type/map"; interface Emits { (e: "doAddress"): void; - (e: "update:modelValue", value: Compliance): void; + (e: "update:modelValue", value: PublicReport): void; } interface Props { district: District; - modelValue: Compliance; + modelValue: PublicReport; } const emit = defineEmits(); const error = ref(""); diff --git a/ts/rmo/content/compliance/Contact.vue b/ts/rmo/content/compliance/Contact.vue index b96bffcd..6f5a3423 100644 --- a/ts/rmo/content/compliance/Contact.vue +++ b/ts/rmo/content/compliance/Contact.vue @@ -45,7 +45,7 @@ id="contact-name" name="name" placeholder="Enter your name" - v-model="modelValue.contact.name" + v-model="modelValue.reporter.name" />
@@ -61,7 +61,7 @@ id="contact-phone" name="phone" placeholder="(555) 123-4567" - v-model="modelValue.contact.phone" + v-model="modelValue.reporter.phone" />
@@ -72,7 +72,7 @@ class="form-check-input" type="checkbox" id="can-text" - v-model="modelValue.contact.can_text" + v-model="modelValue.reporter.can_text" />
-
+
Important: Our staff will only enter if the dog @@ -166,7 +165,7 @@ type="radio" id="access-with-owner" :value="PermissionAccess.WITH_OWNER" - v-model="modelValue.permission.access" + v-model="modelValue.access" class="mt-1" />