From e68fb69cebe8efbd32eb18ada8d7a38f3531ed9b Mon Sep 17 00:00:00 2001 From: Mateusz Russak Date: Mon, 19 Feb 2024 13:07:32 +0100 Subject: [PATCH] chore: changes according to code review --- ui/package-lock.json | 2 +- ui/package.json | 2 +- .../core_components/embeds/CoreGoogleMaps.vue | 41 ++++++++----------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/ui/package-lock.json b/ui/package-lock.json index b968e1e45..44f6727fd 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -34,7 +34,7 @@ "prettier": "^3.0.1", "vite": "^4.4.9", "vite-plugin-monaco-editor": "^1.1.0", - "volar-service-vetur": "latest" + "volar-service-vetur": "*" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/ui/package.json b/ui/package.json index c82ad70df..fe0c50bf6 100644 --- a/ui/package.json +++ b/ui/package.json @@ -36,6 +36,6 @@ "prettier": "^3.0.1", "vite": "^4.4.9", "vite-plugin-monaco-editor": "^1.1.0", - "volar-service-vetur": "latest" + "volar-service-vetur": "*" } } diff --git a/ui/src/core_components/embeds/CoreGoogleMaps.vue b/ui/src/core_components/embeds/CoreGoogleMaps.vue index e8a46bed5..3f1d39a9c 100644 --- a/ui/src/core_components/embeds/CoreGoogleMaps.vue +++ b/ui/src/core_components/embeds/CoreGoogleMaps.vue @@ -125,32 +125,28 @@ const buildMarkers = async () => { if (!fields.markers.value) return; const { AdvancedMarkerElement } = await google.maps.importLibrary("marker") as google.maps.MarkerLibrary; clearMarkers(); - try { - const markersData = fields.markers.value as ({ lat: number; lng: number; name: string; }[]) - markersData.forEach((markerData) => { - const marker = new AdvancedMarkerElement({ - position: { - lat: markerData.lat, - lng: markerData.lng, - }, - map, - title: markerData.name, - }); + const markersData = fields.markers.value as ({ lat: number; lng: number; name: string; }[]) + markersData.forEach((markerData) => { + const marker = new AdvancedMarkerElement({ + position: { + lat: markerData.lat, + lng: markerData.lng, + }, + map, + title: markerData.name, + }); - markers.push(marker); + markers.push(marker); - marker.addListener('click', () => { - const event = new CustomEvent("gmap-marker-click", { - detail: { - payload: markerData, - }, - }); - rootEl.value.dispatchEvent(event); + marker.addListener('click', () => { + const event = new CustomEvent("gmap-marker-click", { + detail: { + payload: markerData, + }, }); + rootEl.value.dispatchEvent(event); }); - } catch (e) { - console.log(e); - } + }); }; const clearMarkers = () => { @@ -214,7 +210,6 @@ watch(fields.mapId, initMap); left: 0; width: 100%; height: 100%; - background-color: rgba(0, 0, 0, 0); } .CoreGoogleMaps.beingEdited.selected .mask {