create new universal js config file to include into the skill wheel t…#659
create new universal js config file to include into the skill wheel t…#659
Conversation
There was a problem hiding this comment.
Pull request overview
This PR centralizes the Radial Bar Chart (“Skills Wheel”) configuration and render helper into a shared static JS file, then updates templates to use that shared function rather than repeating the config inline.
Changes:
- Added
main/static/main/js/radial-bar-chart-config.jsto holdradialBarChartConfigandrenderRadialBarChart(...). - Updated three templates to load the shared JS and call
renderRadialBarChart(...)instead of duplicating the config object. - Reduced inline JS duplication across the Skills Wheel pages/snippets.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| main/templates/main/user_skill_profile.html | Loads shared chart config JS and switches to renderRadialBarChart(...). |
| main/templates/main/snippets/hero.html | Loads shared chart config JS and reuses renderRadialBarChart(...) for the homepage hero wheel. |
| main/templates/main/pages/roles.html | Loads shared chart config JS and reuses renderRadialBarChart(...) to render all sample role wheels. |
| main/static/main/js/radial-bar-chart-config.js | New shared chart configuration + render helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
I'm not sure this is the right place for this. The static files are assets that are built by NPM, so I'm not sure if there is meant to be anything directly committed to here.
| No profiles | ||
| {% endif %} | ||
| </section> | ||
| <script defer src="{% static 'js/radial-bar-chart-config.js' %}"></script> |
There was a problem hiding this comment.
I was imagining that we'd be able to remove the <script> element entirely and put it in a html template snippet that we could pass values to.
Description
I removed the common bits of JS code and moved them to a JS file in the static folder and Included it in the skill profile page, roles and index page (hero.html)
Fixes #595
Type of change
Key checklist
python -m pytest)mkdocs serve)pre-commit run --all-files)Further checks