From 0c0300efceb5dbe0aa7ed6c9e86028a6f8222dd3 Mon Sep 17 00:00:00 2001 From: renee-png Date: Sun, 7 Jun 2026 20:40:52 -0400 Subject: [PATCH] RV/Boat Lots: internal lot map with directory-unit links Add a Map tab that reuses the reservation-map pin picker. Staff drop/label pins per lot and optionally link a directory unit (pin.linked_amenity_id = unit id). Config persists per association in rv_boat_lot_maps. GoogleMapPicker generalized with optional linkLabel + allowLinkAnyStatus (defaults preserve the amenity reservation-map behavior). Co-Authored-By: Claude Opus 4.8 --- .../association/GoogleMapPicker.tsx | 12 +++-- src/pages/RVBoatLotsPage.tsx | 54 +++++++++++++++++++ .../20260607234500_rv_boat_lot_maps.sql | 16 ++++++ 3 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 supabase/migrations/20260607234500_rv_boat_lot_maps.sql diff --git a/src/components/association/GoogleMapPicker.tsx b/src/components/association/GoogleMapPicker.tsx index 8291022..b203331 100644 --- a/src/components/association/GoogleMapPicker.tsx +++ b/src/components/association/GoogleMapPicker.tsx @@ -24,9 +24,13 @@ interface Props { formAmenities: { id: string; name: string }[]; lockedView?: { lat: number; lng: number; zoom: number } | null; onLockedViewChange?: (v: { lat: number; lng: number; zoom: number } | null) => void; + /** Noun used in the pin-link dropdown ("form" by default, e.g. "unit"). */ + linkLabel?: string; + /** When true, the link dropdown shows regardless of pin status. */ + allowLinkAnyStatus?: boolean; } -export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange }: Props) { +export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange, linkLabel = "form", allowLinkAnyStatus = false }: Props) { const mapRef = useRef(null); const mapInstance = useRef(null); const markersRef = useRef([]); @@ -245,7 +249,7 @@ export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChang - {pin.status === "available" && formAmenities.length > 0 && ( + {(allowLinkAnyStatus || pin.status === "available") && formAmenities.length > 0 && (