Skip to content

Migrate Maps page module to React#87

Open
devin-ai-integration[bot] wants to merge 2 commits into
demo-prepfrom
devin/1780370287-migrate-maps-to-react
Open

Migrate Maps page module to React#87
devin-ai-integration[bot] wants to merge 2 commits into
demo-prepfrom
devin/1780370287-migrate-maps-to-react

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 2, 2026

Copy link
Copy Markdown

Summary

Migrates src/app/pages/maps/ from AngularJS controllers+templates to React components, keeping the existing UI-Router abstract parent + 4 child states for sidebar navigation.

New React components in src/app/react/pages/:

  • GoogleMapsPage — initializes google.maps.Map in a useEffect
  • LeafletMapsPage — initializes Leaflet L.map with tile layer, marker, popup
  • MapBubblesPage — AmCharts bubble map with 150+ country data points; receives baConfig/layoutPaths as props for color mapping and image paths
  • MapLinesPage — AmCharts line map with London/Vilnius flight connections; same prop injection

Bridge pattern: mapsReact.js defines 4 directives (<gmap-react>, <leaflet-react>, <map-bubbles-react>, <map-lines-react>) that call BlurAdminReact.mountReactApp(Component, element, props). The AmCharts directives inject baConfig and layoutPaths via Angular DI and pass them as props — never accessed from window.

Build infrastructure (shared across all React migrations):

  • gulp/inject.js: excludes src/app/react/** from script injection
  • gulp/server.js: adds build/react to serve and serve:e2e base dirs
  • gulp/build.js: adds copyReactBundle task to the build pipeline
  • src/index.html: adds <script src="bundle.js"> after inject blocks
  • webpack.react.config.js: removes externals (React 19 has no UMD builds; React/ReactDOM now bundled)

All 36 E2E tests pass (maps.spec.ts): routing, headings, panel titles, map container IDs, tile rendering, AmCharts SVG + attribution, Leaflet markers/popups/zoom/attribution, breadcrumbs, and sidebar navigation.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/e1555ba14fc448c799e78d3cc531b41b
Requested by: @DhrovS


Open in Devin Review

- Create 4 React components: GoogleMapsPage, LeafletMapsPage, MapBubblesPage, MapLinesPage
- Create bridge directives in mapsReact.js to mount React components via mountReactApp
- Inject baConfig and layoutPaths via Angular DI for AmCharts map components
- Update maps.module.js child states to use React bridge directive templates
- Export new components from src/app/react/index.jsx
- Update gulp/inject.js to exclude src/app/react/** from script injection
- Update gulp/server.js to serve build/react/ directory
- Add copyReactBundle task to gulp/build.js
- Add bundle.js script tag to src/index.html
- Remove webpack externals to bundle React/ReactDOM (no UMD builds in React 19)
- Rebuild bundle.js with all map components included
- All 36 E2E tests pass
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

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.

1 participant