From b2c5bb6735a81ea31504d1ff8e61b985f92ba668 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 16 Apr 2026 02:48:12 +0000 Subject: [PATCH] Show map on upload detail page Bunch of stuff still doesn't work right. --- ts/view/configuration/UploadDetail.vue | 83 ++++++++++++++++++-------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/ts/view/configuration/UploadDetail.vue b/ts/view/configuration/UploadDetail.vue index 9ac15b6b..9ffd3fc2 100644 --- a/ts/view/configuration/UploadDetail.vue +++ b/ts/view/configuration/UploadDetail.vue @@ -33,9 +33,16 @@ thead tr.header { background-color: #f8f9fa; } -#map { +.map-container { + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); height: 400px; - width: 100%; + margin-bottom: 20px; + margin-top: 20px; + align-items: center; + justify-content: center; + /* Prevent touch scrolling issues */ + touch-action: pan-y pinch-zoom; } .badge.dry { background-color: $info; @@ -146,14 +153,18 @@ tr.has-error {
-
+

loading

-
+
@@ -237,22 +248,22 @@ tr.has-error { v-for="(pool, index) in upload.csv_pool.pools" :key="index" :class="{ - 'has-error': hasError(upload.csv_pool, index), + 'has-error': hasError(pool), }" :style="getRowStyle(pool)" > - + v-if="hasError(pool)" + > + + {{ pool.address?.number }} {{ pool.address?.street }} @@ -310,10 +321,19 @@ tr.has-error { import * as bootstrap from "bootstrap"; import { ref, onMounted, computed } from "vue"; import { useRouter } from "vue-router"; -import MapMultipoint from "@/components/MapMultipoint.vue"; +import MapLocator from "@/components/MapLocator.vue"; +import Tooltip from "@/components/Tooltip.vue"; import { useUploadStore } from "@/store/upload"; import { useSessionStore } from "@/store/session"; -import { CSVPoolDetail, CSVPoolError, Upload, UploadPoolRow } from "@/type/api"; +import { + CSVPoolDetail, + CSVPoolError, + Upload, + UploadPoolError, + UploadPoolRow, +} from "@/type/api"; +import { Camera } from "@/type/map"; +import type { Marker } from "@/types"; interface ErrorMessage { message: string; @@ -325,6 +345,7 @@ interface Props { const props = defineProps(); +const mapCamera = ref(new Camera()); const router = useRouter(); const showIssuesOnly = ref(false); const isSubmitting = ref(false); @@ -445,17 +466,29 @@ const handleCommit = async () => { isSubmitting.value = false; } }; -function hasError(csv: CSVPoolDetail, index: number): boolean { - return !!errorsForLine(csv, index); -} -function errorsForLine(csv: CSVPoolDetail, index: number): CSVPoolError[] { - let results = []; - for (const e of csv.errors) { - if (e.line == index) { - results.push(e); - } +const markers = computed((): Marker[] => { + if (!upload.value?.csv_pool?.pools) { + return []; } - return results; + let markers: Marker[] = []; + upload.value.csv_pool.pools.forEach((p: UploadPoolRow) => { + if (p.address.location) { + markers.push({ + color: "#FF0000", + draggable: true, + id: "x", + location: p.address.location, + }); + } + }); + console.log("updated markers to", markers); + return markers; +}); +function hasError(row: UploadPoolRow): boolean { + return !!errorsForLine(row); +} +function errorsForLine(row: UploadPoolRow): UploadPoolError[] { + return row.errors; } onMounted(() => { initializeMap();