From 3f587911044a30e4c7dc1d11073a5d106e99df29 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:52:30 +0100 Subject: [PATCH 1/4] Add type=module to javascript_include_tag references --- app/views/layouts/application.html.erb | 2 +- app/views/shared/_webchat.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 976e47209..4529560b7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -52,7 +52,7 @@ <% end %> <%= stylesheet_link_tag "application", :media => "all", integrity: false %> - <%= javascript_include_tag "application", integrity: false %> + <%= javascript_include_tag "application", integrity: false, type: "module" %> <%= javascript_include_tag 'es6-components', type: "module" %> <%= csrf_meta_tags %> <%= render 'govuk_publishing_components/components/meta_tags', content_item: @content_item.content_item %> diff --git a/app/views/shared/_webchat.html.erb b/app/views/shared/_webchat.html.erb index 368cee9d1..0e4c865ee 100644 --- a/app/views/shared/_webchat.html.erb +++ b/app/views/shared/_webchat.html.erb @@ -34,4 +34,4 @@

<% # This is inline in the source however slimmer will optimize this. %> -<%= javascript_include_tag "webchat", integrity: false %> +<%= javascript_include_tag "webchat", integrity: false, type: "module" %> From cd416a3d48ee49074fda027d3f27ad1fa6d7cdf7 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:52:37 +0100 Subject: [PATCH 2/4] Fix JS crashing on development index page --- app/views/development/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/development/index.html.erb b/app/views/development/index.html.erb index 402dca73b..24a0efd6f 100644 --- a/app/views/development/index.html.erb +++ b/app/views/development/index.html.erb @@ -9,7 +9,7 @@
-
+
<%= render 'govuk_publishing_components/components/title', title: 'government-frontend' %> <% html = capture do %> From eb5ee8d0d9ffca5ec9f5683c9e2ec087d433ff53 Mon Sep 17 00:00:00 2001 From: AshGDS <8880610+AshGDS@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:53:15 +0100 Subject: [PATCH 3/4] Use .govuk-frontend-supported instead of .js-enabled --- app/assets/stylesheets/components/_published-dates.scss | 4 ++-- app/assets/stylesheets/helpers/_sticky-element-container.scss | 2 +- app/assets/stylesheets/views/_service_manual_guide.scss | 2 +- app/assets/stylesheets/views/_worldwide-organisation.scss | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/components/_published-dates.scss b/app/assets/stylesheets/components/_published-dates.scss index 0a50c4330..7857060c3 100644 --- a/app/assets/stylesheets/components/_published-dates.scss +++ b/app/assets/stylesheets/components/_published-dates.scss @@ -9,7 +9,7 @@ .app-c-published-dates__toggle { display: none; - .js-enabled & { + .govuk-frontend-supported & { display: inline-block; } } @@ -41,7 +41,7 @@ border-top: 1px solid $govuk-border-colour; } -.js-enabled .app-c-published-dates .js-hidden { +.govuk-frontend-supported .app-c-published-dates .js-hidden { display: none; visibility: hidden; } diff --git a/app/assets/stylesheets/helpers/_sticky-element-container.scss b/app/assets/stylesheets/helpers/_sticky-element-container.scss index 5e9f47d85..db8597841 100644 --- a/app/assets/stylesheets/helpers/_sticky-element-container.scss +++ b/app/assets/stylesheets/helpers/_sticky-element-container.scss @@ -1,4 +1,4 @@ -.js-enabled .sticky-element { +.govuk-frontend-supported .sticky-element { position: absolute; bottom: 0; diff --git a/app/assets/stylesheets/views/_service_manual_guide.scss b/app/assets/stylesheets/views/_service_manual_guide.scss index 0521500e9..7b669ec8b 100644 --- a/app/assets/stylesheets/views/_service_manual_guide.scss +++ b/app/assets/stylesheets/views/_service_manual_guide.scss @@ -12,7 +12,7 @@ @import "../modules/sticky"; @import "../modules/typography"; -.js-enabled { +.govuk-frontend-supported { .app-change-history__past { &.govuk-list { // stylelint-disable-next-line max-nesting-depth diff --git a/app/assets/stylesheets/views/_worldwide-organisation.scss b/app/assets/stylesheets/views/_worldwide-organisation.scss index a60ecf2df..bcb013e31 100644 --- a/app/assets/stylesheets/views/_worldwide-organisation.scss +++ b/app/assets/stylesheets/views/_worldwide-organisation.scss @@ -3,7 +3,7 @@ margin-bottom: govuk-spacing(3); } -.js-enabled { +.govuk-frontend-supported { .worldwide-organisation-header { .show-other-content { all: inherit; From b8917d61443a2ce4d3dd3ea5946685c7dbaaed79 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Thu, 15 Aug 2024 16:57:26 +0100 Subject: [PATCH 4/4] Bump to latest components gem --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 33c7df6e2..0f27e1767 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,7 +164,7 @@ GEM govuk_personalisation (0.16.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (41.1.1) + govuk_publishing_components (42.0.0) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown