Skip to content

feat: [#293] Add Active Shipments World Map Widget#470

Merged
dinahmaccodes merged 2 commits into
Navin-xmr:mainfrom
Happybello365:feature/293-shipments-world-map
Jul 6, 2026
Merged

feat: [#293] Add Active Shipments World Map Widget#470
dinahmaccodes merged 2 commits into
Navin-xmr:mainfrom
Happybello365:feature/293-shipments-world-map

Conversation

@Happybello365

Copy link
Copy Markdown
Contributor

Summary

Closes #293

Adds an interactive world map to the company dashboard showing all IN_TRANSIT shipments as color-coded markers.

Changes

  • Dependencies: react-leaflet@5, leaflet, @types/leaflet, react-leaflet-cluster
  • ShipmentsMapWidget.tsx: Interactive map widget using OpenStreetMap tiles (no API key)
    • Fetches IN_TRANSIT shipments with GPS via shipmentApi.getAllInTransitWithGps()
    • Color-coded markers: 🔵 blue = on-track, 🟠 orange = delayed, 🔴 red = anomaly
    • Marker clustering via react-leaflet-cluster when zoomed out
    • Click popup shows tracking number, route, and link to ShipmentDetail
    • Responsive height: 400px desktop / 250px mobile
    • cancelled flag in useEffect cleanup prevents memory leaks on unmount
  • index.ts: Barrel export for ShipmentsMap/ folder

Tested

  • Zero TypeScript errors in all changed files
  • Zero ESLint warnings in ShipmentsMap/ folder
  • All peer dependencies satisfied (react-leaflet@5 supports React 19 + react-leaflet-cluster@4)

- Install react-leaflet@5, leaflet, @types/leaflet, react-leaflet-cluster
- ShipmentsMapWidget: renders IN_TRANSIT shipments as color-coded markers
  - blue = on-track, orange = delayed, red = anomaly
  - MarkerClusterGroup for zoom-out clustering
  - Click popup with tracking number, route, and ShipmentDetail link
  - OpenStreetMap tiles (no API key required)
  - 400px desktop / 250px mobile height
  - Cleanup flag prevents memory leaks on unmount
- Add index.ts barrel export for ShipmentsMap folder
@dinahmaccodes

Copy link
Copy Markdown
Collaborator

hmm
you have a bit of conflicts

@dinahmaccodes

Copy link
Copy Markdown
Collaborator

please resolve conflicts @Happybello365

@dinahmaccodes
dinahmaccodes merged commit 12dc235 into Navin-xmr:main Jul 6, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants