+
-
@@ -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();