Enhance SPA routing logic - #715
Conversation
|
WHY 16 FILES FOR ROUTING????????????????????????? |
|
@MatthijsSmets I have added spa test resources, which allowed me to test the improved router method. |
|
But I see generated build artifacts? |
|
What if some day another artifact is generated during building, will you add that as well? |
|
These are not generated build artifacts, they function as test stubs. So when generating a new build, they will not be overwritten with new artifacts. |
…essary comments and organizing test methods
381b28c to
3cc97ff
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Spring WebMVC functional routing so Angular SPA deep links (including version/tag paths containing dots and non-numeric suffixes) resolve to index.html instead of 404, and adds a dedicated router test suite plus a small SPA build fixture to validate routing behavior.
Changes:
- Reworked the SPA router to serve classpath static resources and fall back to
index.htmlfor client-side routes. - Added comprehensive unit tests covering deep links, query strings, asset resolution, and excluded API/error paths.
- Added SPA fixture files under test resources and introduced additional Maven dependencies.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pom.xml |
Adds jspecify and bucket4j-core dependencies at the parent level. |
insights-webapp/src/main/java/org/frankframework/insights/InsightsWebappApplication.java |
Updates SPA router logic to serve static resources and fall back to index.html; introduces @NullMarked. |
insights-webapp/src/test/java/org/frankframework/insights/InsightsApplicationSpaRouterTest.java |
New tests validating SPA routing behavior across many routes and asset paths. |
insights-webapp/src/test/resources/spa-fixture/3rdpartylicenses.txt |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/assets/favicon.svg |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/assets/icons/grab-gesture.png |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/chunk-EWTVZH6O.mjs |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/favicon.ico |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/index.html |
Adds SPA fixture index.html used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/main-B7QM4KUC.js |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/main-B7QM4KUC.js.map |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/manifest.webmanifest |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/media/inter-latin.woff2 |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/polyfills-B6TNHZQ6.js |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/robots |
Adds SPA fixture asset used by routing tests. |
insights-webapp/src/test/resources/spa-fixture/styles-5INURTSO.css |
Adds SPA fixture asset used by routing tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Does it have to mimic all the files though? |
…improve resource handling
Okay i have changed it. Now its using the generated frontend artifacts from the ci build to test against. |
|



Now links like:
https://insights.frankframework.org/graph/9.0-nightly?nightly=&range=%5B9.0%5D,%5B9.4%5D,%5B10.0,)
Should be reachable without a 404 error