diff --git a/.replit b/.replit index 9b52848..75d108a 100644 --- a/.replit +++ b/.replit @@ -21,7 +21,7 @@ externalPort = 3001 [[ports]] localPort = 41295 -externalPort = 6000 +externalPort = 5173 [[ports]] localPort = 41343 @@ -43,10 +43,6 @@ externalPort = 5000 localPort = 43267 externalPort = 3003 -[[ports]] -localPort = 45047 -externalPort = 5173 - [env] PORT = "5000" diff --git a/replit.md b/replit.md index e7cd54f..cf41ac5 100644 --- a/replit.md +++ b/replit.md @@ -86,6 +86,31 @@ To prevent timezone-related bugs, especially when assigning shifts, dates should - Graceful fallback for sites without coordinates - **Impact**: Planning Mobile now fully functional with interactive map for patrol/inspection route planning +### Planning Mobile - Interactive Features (October 23, 2025) +- **Issue**: Planning Mobile needed interactive map controls and patrol route sequencing workflow +- **Critical Bug Fix - Geocoding**: + - **Problem**: Toast showed "Indirizzo: undefined" when geocoding sites + - **Root Cause**: `apiRequest()` returns Response object, not parsed JSON + - **Fix**: Added `const result = await response.json()` after apiRequest in both handleGeocode() and handleGeocodeEdit() + - **Impact**: Geocoding now correctly displays full address from Nominatim (e.g., "Via Tiburtina, Roma, Lazio, Italia") +- **New Features**: + - **Zoom-to-Site**: + - MapController component with useMap() hook for programmatic map control + - Navigation button on each site card triggers flyTo() animation (zoom level 16) + - Toast feedback: "Mappa centrata - Visualizzazione di [nome sito]" + - **Guard Assignment**: + - "Assegna Guardia" button on site cards + - Validates guard selection from dropdown + - Toast feedback: "[Sito] assegnato a [Nome Cognome Guardia]" + - **Patrol Route Sequencing**: + - Click markers on map to build patrol route sequence + - Visual feedback: Green "Tappa N" badges on markers and site cards + - Dedicated UI section showing route in construction with numbered sequence + - Remove/clear/save route controls + - Auto-reset route when changing guard or location + - **Note**: Backend persistence (save to database) not yet implemented - marked as TODO for future development +- **Impact**: Operators can now interact with the map, assign guards to sites, and visually plan patrol routes by clicking sites in sequence + ### Sites Form Fix - ServiceTypeId Integration (October 2025) - **Issue**: Sites form used hardcoded `shiftType` enum values instead of dynamic service types from the database - **Solution**: