diff --git a/ts/components/MapProxiedArcgisTile.vue b/ts/components/MapProxiedArcgisTile.vue
index 72c67ed6..a967845c 100644
--- a/ts/components/MapProxiedArcgisTile.vue
+++ b/ts/components/MapProxiedArcgisTile.vue
@@ -97,8 +97,7 @@ const initializeMap = () => {
type: "raster",
});
- emit("load", { map: getCurrentInstance() });
-
+ /*
map.value.on("click", (e) => {
emit("map-click", {
lng: e.lngLat.lng,
@@ -107,6 +106,7 @@ const initializeMap = () => {
point: e.point,
});
});
+ */
});
} catch (e) {
console.error("hey dummy", e);
@@ -150,21 +150,6 @@ const setMarkers = (newMarkers) => {
}
};
-const getCurrentInstance = () => {
- // Return an object with the public methods
- return {
- addLayer,
- addSource,
- jumpTo,
- on,
- once,
- queryRenderedFeatures,
- fitBounds,
- setLayoutProperty,
- setMarkers,
- };
-};
-
// Expose methods to parent components
defineExpose({
addLayer,
@@ -188,10 +173,3 @@ onBeforeUnmount(() => {
}
});
-
-
diff --git a/ts/components/ReviewPoolColumnDetail.vue b/ts/components/ReviewPoolColumnDetail.vue
index c3a2459b..8361096b 100644
--- a/ts/components/ReviewPoolColumnDetail.vue
+++ b/ts/components/ReviewPoolColumnDetail.vue
@@ -34,9 +34,11 @@
@@ -48,9 +50,11 @@
@@ -61,9 +65,11 @@
-
+
-
+
@@ -100,10 +107,11 @@
@@ -116,12 +124,14 @@
@@ -129,12 +139,11 @@
@@ -142,10 +151,19 @@
diff --git a/ts/components/ReviewPoolColumnList.vue b/ts/components/ReviewPoolColumnList.vue
index 8ff9aaa7..badacd68 100644
--- a/ts/components/ReviewPoolColumnList.vue
+++ b/ts/components/ReviewPoolColumnList.vue
@@ -1,3 +1,20 @@
+
@@ -28,7 +45,7 @@
:key="task.id"
class="entry-item"
:class="{ active: selectedTaskID === task.id }"
- @click="selectTask(task)"
+ @click="emit('doSelectTask', task.id)"
>
@@ -45,11 +62,15 @@
diff --git a/ts/view/Communication.vue b/ts/view/Communication.vue
index e9615ddb..9054b685 100644
--- a/ts/view/Communication.vue
+++ b/ts/view/Communication.vue
@@ -77,9 +77,9 @@ onMounted(() => {
});
// Refs
-const currentPhotoIndex = ref(0);
-const error = ref(null);
-const loading = ref(true);
+const currentPhotoIndex = ref
(0);
+const error = ref(null);
+const loading = ref(true);
const mapBounds = ref(null);
const mapMarkers = ref([]);
const selectedId = ref(null);
diff --git a/ts/view/review/Pool.vue b/ts/view/review/Pool.vue
index a730fca5..740d9e5e 100644
--- a/ts/view/review/Pool.vue
+++ b/ts/view/review/Pool.vue
@@ -24,23 +24,6 @@ body {
border-left: 1px solid #dee2e6;
padding: 20px;
}
-
-.entry-item {
- padding: 15px;
- border-bottom: 1px solid #e9ecef;
- cursor: pointer;
- transition: background-color 0.2s;
-}
-
-.entry-item:hover {
- background-color: #f8f9fa;
-}
-
-.entry-item.active {
- background-color: #e7f3ff;
- border-left: 4px solid #0d6efd;
-}
-
.placeholder-box {
background-color: #e9ecef;
border: 2px dashed #adb5bd;
@@ -80,6 +63,7 @@ body {
-
+
@@ -184,12 +175,17 @@ const props = withDefaults(defineProps(), {
});
// State
-const totalPending = ref(0);
-const selectedTaskID = ref(null);
-const originalValues = ref>({});
-const loading = ref(true);
-const submitting = ref(false);
+const selectedTaskChanges = ref({
+ location: {},
+ pool: {},
+});
const error = ref(null);
+const loading = ref(true);
+const mapBounds = ref(null);
+const mapMarkers = ref([]);
+const selectedTaskID = ref(null);
+const submitting = ref(false);
+const totalPending = ref(0);
const reviewTask = useReviewTaskStore();
const user = useUserStore();
@@ -215,7 +211,7 @@ const changes = computed(() => {
];
fields.forEach((field) => {
- if (form[field.key] !== originalValues.value[field.key]) {
+ if (selectedTaskChanges[field.key] !== selectedTask.value[field.key]) {
updated.push(field.label);
} else {
unchanged.push(field.label);
@@ -236,22 +232,17 @@ async function fetchTasks() {
}
// Helper Functions
// Task Selection
-function selectTask(task: Task): void {
- console.log("Selected task", task);
- selectedTask.value = task;
+function selectTask(id: int): void {
+ console.log("Selected task", id);
+ selectedTaskID.value = id;
- // Populate form with task values
- form.latitude = task.location.latitude;
- form.longitude = task.location.longitude;
- form.condition = task.condition || "";
- form.ownerContact = task.ownerContact || "";
- form.residentContact = task.residentContact || "";
- form.poolShape = task.poolShape || "";
-
- // Store original values for change tracking
- originalValues.value = { ...form };
+ selectedTaskChanges.value = {
+ location: {},
+ pool: {},
+ };
// Update map
+ const task = reviewTask.byID(id);
updateMap(task);
}
@@ -299,8 +290,8 @@ function updatePoolLocation(event: MapClickEvent): void {
}).setLngLat([event.detail.lng, event.detail.lat]),
]);
- form.latitude = event.detail.lat;
- form.longitude = event.detail.lng;
+ selectedTaskChanges.latitude = event.detail.lat;
+ selectedTaskChanges.longitude = event.detail.lng;
}
// Submit Review
@@ -314,18 +305,9 @@ async function submitReview(action: "committed" | "discarded"): Promise {
const payload: any = {
task_id: selectedTask.value.id,
status: action,
- updates: {},
+ updates: selectedTaskChanges,
};
- // Include changed fields in the payload
- if (action === "committed") {
- (Object.keys(form) as Array).forEach((key) => {
- if (form[key] !== originalValues.value[key]) {
- payload.updates[key] = form[key];
- }
- });
- }
-
const response = await fetch("/api/review/pool", {
method: "POST",
headers: {
@@ -353,12 +335,6 @@ async function submitReview(action: "committed" | "discarded"): Promise {
selectTask(reviewTask.all[nextIndex]);
} else {
selectedTask.value = null;
- form.condition = "";
- form.ownerContact = "";
- form.residentContact = "";
- form.poolShape = "";
- form.latitude = 0;
- form.longitude = 0;
originalValues.value = {};
}