diff --git a/Gemfile.lock b/Gemfile.lock index d128655f1..87d0673cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,7 +162,7 @@ GEM govuk_personalisation (0.16.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (39.2.5) + govuk_publishing_components (40.0.0) govuk_app_config govuk_personalisation (>= 0.7.0) kramdown diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 1b6313e59..7cb2ec743 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,4 +1,5 @@ //= link_tree ../images //= link application.js +//= link es6-components.js //= link webchat.js //= link_tree ../builds diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fdd109291..3110fcc69 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,13 +1,10 @@ //= require govuk_publishing_components/lib -//= require govuk_publishing_components/components/accordion //= require govuk_publishing_components/components/details -//= require govuk_publishing_components/components/error-summary //= require govuk_publishing_components/components/govspeak //= require govuk_publishing_components/components/image-card //= require govuk_publishing_components/components/intervention //= require govuk_publishing_components/components/metadata //= require govuk_publishing_components/components/print-link -//= require govuk_publishing_components/components/radio //= require govuk_publishing_components/components/single-page-notification-button //= require govuk_publishing_components/components/step-by-step-nav diff --git a/app/assets/javascripts/es6-components.js b/app/assets/javascripts/es6-components.js new file mode 100644 index 000000000..d5bc4c711 --- /dev/null +++ b/app/assets/javascripts/es6-components.js @@ -0,0 +1,12 @@ +// These modules from govuk_publishing_components +// depend on govuk-frontend modules. govuk-frontend +// now targets browsers that support `type="module"`. +// +// To gracefully prevent execution of these scripts +// on browsers that don't support ES6, this script +// should be included in a `type="module"` script tag +// which will ensure they are never loaded. + +//= require govuk_publishing_components/components/accordion +//= require govuk_publishing_components/components/error-summary +//= require govuk_publishing_components/components/radio diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 5f3f96f13..1b1c78da7 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,8 +1,4 @@ // The main application stylesheet -$govuk-compatibility-govuktemplate: false; -$govuk-typography-use-rem: false; -$govuk-use-legacy-palette: false; -$govuk-new-link-styles: true; // This flag stops the font from being included in this application's // stylesheet - the font is being served by Static across all of GOV.UK, so is diff --git a/app/assets/stylesheets/components/_contents-list-with-body.scss b/app/assets/stylesheets/components/_contents-list-with-body.scss index e7dc44966..f38e8bf5f 100644 --- a/app/assets/stylesheets/components/_contents-list-with-body.scss +++ b/app/assets/stylesheets/components/_contents-list-with-body.scss @@ -23,7 +23,7 @@ } .app-c-contents-list-with-body__link-wrapper.sticky-element--stuck-to-window { - background-color: govuk-colour("light-grey", $legacy: "grey-3"); + background-color: govuk-colour("light-grey"); bottom: -1px; // 'Fix' for anomalous 1px margin which sporadically appears below this element. left: 0; margin: 0; diff --git a/app/assets/stylesheets/helpers/_parts.scss b/app/assets/stylesheets/helpers/_parts.scss index 4837e7b4a..97d97960c 100644 --- a/app/assets/stylesheets/helpers/_parts.scss +++ b/app/assets/stylesheets/helpers/_parts.scss @@ -9,7 +9,7 @@ margin-bottom: 0; } - border-bottom: 1px solid govuk-colour("mid-grey", $legacy: "grey-2"); + border-bottom: 1px solid govuk-colour("mid-grey"); } .part-navigation { diff --git a/app/assets/stylesheets/views/_manual.scss b/app/assets/stylesheets/views/_manual.scss index d387a4297..d3a94a6f0 100644 --- a/app/assets/stylesheets/views/_manual.scss +++ b/app/assets/stylesheets/views/_manual.scss @@ -61,7 +61,7 @@ list-style: none; &:hover { - background-color: govuk-colour("light-grey", $legacy: "grey-4"); + background-color: govuk-colour("light-grey"); } &:last-child { diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index cb7dc363a..b8a944baf 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -49,6 +49,7 @@ <%= stylesheet_link_tag "application", :media => "all", integrity: false %> <%= javascript_include_tag "application", integrity: false %> + <%= 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/test/integration/service_manual_phase_label_test.rb b/test/integration/service_manual_phase_label_test.rb index d321b3f03..728e36666 100644 --- a/test/integration/service_manual_phase_label_test.rb +++ b/test/integration/service_manual_phase_label_test.rb @@ -29,7 +29,7 @@ class ServiceManualPhaseLabelTest < ActionDispatch::IntegrationTest stub_content_store_has_item(guide["base_path"], guide) visit guide["base_path"] - assert_text("ALPHA") + assert_text("Alpha") end test "No phase label is displayed for a guide without a phase field" do