Skip to content

Commit

Permalink
Fix GOVUK Frontend initialisation bug
Browse files Browse the repository at this point in the history
The frontend JS was not being initalised as it was outdated and copied and pasted from an old version.

This is now changed to bring in the JS directly from the node modules ensuring it works for any future updates
  • Loading branch information
DilwoarH committed Oct 29, 2024
1 parent 794126b commit 166ce4b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2,905 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ frontend:
rsync -r assets/images static/
cp node_modules/maplibre-gl/dist/maplibre-gl.css static/stylesheets/maplibre-gl.css
mkdir -p static/govuk/assets
cp node_modules/govuk-frontend/govuk/all.js node_modules/govuk-frontend/govuk/all.js.map static/govuk
cp -r node_modules/govuk-frontend/govuk/assets/* static/govuk/assets

frontend-all: clean frontend
Expand Down
2 changes: 1 addition & 1 deletion application/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{% endblock libraryScripts %}

{% block govScripts %}
<script src="{{ assetPath | default('/assets') }}/javascripts/govuk/govuk-frontend.js"></script>
<script src="{{ assetPath | default('/assets') }}/govuk/all.js"></script>
<script>
// initiate all GOVUK components
window.GOVUKFrontend.initAll();
Expand Down
Loading

0 comments on commit 166ce4b

Please sign in to comment.