Skip to content

Migrate maps page module to React 19#91

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

Migrate maps page module to React 19#91
devin-ai-integration[bot] wants to merge 4 commits into
demo-prepfrom
devin/1780378344-migrate-maps-react

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Summary

Migrates the AngularJS maps page module (Google Maps, Leaflet, Bubble, Line) to React 19, keeping the four UI-Router routes (#/maps/gmap, /leaflet, /bubble, /line) and exact DOM/IDs the framework-agnostic e2e suite depends on. The maps.spec.ts suite (36 tests) passes against the migrated module.

Each AngularJS controller+template pair becomes a React page under src/app/react/pages/, rendered inside the shared <Panel>. The map libraries are initialized in useEffect (with a small poll for the global to load) and torn down on unmount:

  • GoogleMapsPagenew google.maps.Map(...), container cleared on unmount
  • LeafletPageL.map(...) + OSM tiles + marker popup, map.remove() on unmount
  • MapBubblesPage / MapLinesPage → amCharts AmMap, map.clear() on unmount

Each child state now renders a bridge directive (mapsReact.js) instead of templateUrl/controller:

template: '<google-maps-react></google-maps-react>'  // + leaflet/bubble/line variants

The amCharts pages need theme colors and asset paths, so the bridge injects baConfig and layoutPaths and passes them as props — the components never read them off window. The now-unused *Ctrl.js / *.html files are removed.

This is the first module migrated on this branch, so it also adds the shared React build wiring (previously absent):

  • gulp/inject.js & gulp/scripts.js: exclude src/app/react/**/*.js (ES modules bundled by webpack, not standalone AngularJS scripts)
  • gulp/server.js: serve build/react in serve/serve:e2e
  • gulp/build.js: copyReactBundle task copies build/react/bundle.js into dist, added to build
  • src/index.html: <script src="bundle.js"></script>
  • rebuilt build/react/bundle.js exporting the four new pages

Verified locally with gulp serve:e2e (Node 10) + playwright test e2e/maps.spec.ts (Node 20): 36/36 passing.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/cbb14e99d718435b8fe96bf8ab345da3


Open in Devin Review

Convert the AngularJS maps module (Google Maps, Leaflet, Bubble, Line)
to React 19 components mounted via react2angular-style bridge directives.
Map libraries initialize in useEffect with cleanup on unmount; baConfig
and layoutPaths are injected through the bridge, not read off window.

Also wire up the shared React build integration (gulp inject/scripts/
server/build + index.html bundle script) which was not yet present.
@devin-ai-integration

devin-ai-integration Bot commented Jun 2, 2026

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[bot]

This comment was marked as resolved.

Address Devin Review: check the cancelled flag inside the inner
setTimeout callbacks in MapLinesPage and MapBubblesPage so the chart
is not created/written after the component has unmounted.
@DhrovS

DhrovS commented Jun 2, 2026

Copy link
Copy Markdown

Can we add a globe spinner to just the maps module when it loads?

@devin-ai-integration

Copy link
Copy Markdown
Author

Added a globe spinner scoped to just the maps module (commit a2bf1a9).

  • New src/app/react/components/GlobeSpinner.jsx: an absolutely-positioned overlay with a rotating ion-earth globe icon + "Loading map…" text.
  • Each of the 4 map pages (Google, Leaflet, Bubble, Line) now starts with loading = true, renders the spinner over the map container, and sets loading = false once its map instance finishes initializing. The map div is wrapped in a position: relative container so the overlay covers only that page's map.
  • Nothing outside the maps module is touched.

All 36 tests in e2e/maps.spec.ts still pass (the overlay hides on load and doesn't affect any selector).

devin-ai-integration[bot]

This comment was marked as resolved.

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