Migrate charts page module to React 19 (amCharts, Chart.js, Chartist, Morris)#95
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Migrate charts page module to React 19 (amCharts, Chart.js, Chartist, Morris)#95devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…React 19 Port the AngularJS charts.* sub-modules to React 19 components mounted into AngularJS via bridge directives. Third-party chart libraries (AmCharts, Chart.js, Chartist, Morris) are initialized in useEffect with cleanup that destroys/clears instances on unmount. Theme colors are injected through baConfig (via Angular DI), not read from window. - Add React pages: AmChartsPage, ChartJsPage, ChartistPage, MorrisPage - Add bridge directives and switch UI-Router states to React templates - Wire build: exclude src/app/react from gulp inject, serve build/react, load bundle.js in index.html, copy bundle into dist on build - Rebuild webpack React bundle
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Devin Review: the funnel chart passed the whole layoutPaths object to pathToImages instead of layoutPaths.images.amChart, matching every other chart in the file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the
src/app/pages/charts/module (amCharts, Chart.js, Chartist, Morris) from AngularJS controllers + templates to React 19, mounted into AngularJS via bridge directives. The framework-agnostic Playwright suitee2e/charts.spec.tspasses (42/42) against the migrated module.Each UI-Router state now renders a thin bridge directive instead of
templateUrl+ controller:The directive resolves
window.BlurAdminReact, injectsbaConfigvia Angular DI (never read fromwindow), and mounts the component with React 19createRoot(throughmountReactApp), unmounting on$destroy.New React pages in
src/app/react/pages/:AmChartsPage— Bar/Area/Line/Pie/Funnel/Combined charts via globalAmCharts, themeblur, cleanup viachart.clear().ChartJsPage— 8 canvases (pie/doughnut/polar, radar/line/bar, animated radar/bars) via globalChartv2.4. Replicates theChartJsProviderpalette + option defaults (colors derived frombaConfig, not hardcoded); wave charts animate on a 400ms interval, cleared +chart.destroy()on unmount.ChartistPage— 9 charts via globalChartistwith the original responsive option arrays; cleanup viachart.detach().MorrisPage— Line/Donut/Bar/Area via globalMorris; cleanup clears the container.Third-party libraries are initialized inside
useEffect([])and torn down in the returned cleanup. Exact CSS classes, element IDs and DOM structure from the original templates are preserved so the e2e selectors keep matching.Build wiring (additive, behind the existing webpack-built
bundle.js):gulp/inject.jsexcludessrc/app/react/**/*.js(ES modules bundled by webpack, not standalone scripts).gulp/server.jsaddsbuild/reactto theserve/serve:e2ebase dirs.src/index.htmlloads<script src="bundle.js">after the inject blocks.gulp/build.jsadds acopyReactBundletask (dependency ofbuild) so the bundle lands in dist.build/react/bundle.js.Verification
gulp serve:e2e(Node 10) +npx playwright test e2e/charts.spec.ts(Node 20): 42 passed.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/2b20198567094f049b752bc932da6bfa