feat(storm-intel): Storm Intelligence Hub — Phase 1

Adds a new Storm Intel section to the sidebar and routes for ADMIN and OWNER roles.

- StormIntelPage: full-height layout with Leaflet map + storm polygon overlays,
  severity-coded color system, horizontal filter bar (date range / severity / sort),
  and a scrollable storm event list
- Storm detail drawer slides in from right with hail size, est. homes, days ago,
  conversion window indicator (Hot Zone / Warm / Cold / Too Fresh), intel text,
  and quick-action buttons (Create Lead, Open in Dispatch, Assign Canvassers stub)
- Clicking a storm card or map polygon zooms the map to that polygon and opens the drawer
- useStormEvents hook with USE_MOCK flag, date-range cutoff filter, type/severity filter,
  sort by date or severity, and conversionWindow() helper
- api/storm-events.js: NWS api.weather.gov proxy (free, no auth needed), parses
  GeoJSON polygons and hail size from alert descriptions
- MOCK_STORM_EVENTS: 7 realistic Plano TX storm events with accurate polygon coords
- Sidebar: CloudLightning "Storm Intel" entry added for OWNER and ADMIN nav
This commit is contained in:
Satyam-Rastogi
2026-05-18 16:49:37 +05:30
parent 4c1c454681
commit 2e797c89f6
6 changed files with 979 additions and 1 deletions
+17
View File
@@ -36,6 +36,7 @@ import LynkDispatchPage from './pages/LynkDispatchPage';
import EstimatesPage from './pages/EstimatesPage';
import KanbanPage from './pages/KanbanPage';
import LeadProjectPage from './pages/LeadProjectPage';
import StormIntelPage from './pages/StormIntelPage';
// ... (existing imports)
const ProtectedRoute = ({ children, allowedRoles }) => {
@@ -262,6 +263,22 @@ function App() {
</ProtectedRoute>
}
/>
<Route
path="/admin/storm-intel"
element={
<ProtectedRoute allowedRoles={['ADMIN', 'OWNER']}>
<StormIntelPage />
</ProtectedRoute>
}
/>
<Route
path="/owner/storm-intel"
element={
<ProtectedRoute allowedRoles={['OWNER']}>
<StormIntelPage />
</ProtectedRoute>
}
/>
<Route
path="/admin/maps"
element={