diff --git a/Dockerfile b/Dockerfile index 916c26e2..89699c7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,8 +57,7 @@ RUN bundle exec rake assets:precompile # Copy fonts and images (without digest) along with the digested ones, # as there are some hardcoded references in the `govuk-frontend` files # that will not be able to use the rails digest mechanism. -RUN cp node_modules/govuk-frontend/govuk/assets/fonts/* public/assets/govuk-frontend/govuk/assets/fonts -RUN cp node_modules/govuk-frontend/govuk/assets/images/* public/assets/govuk-frontend/govuk/assets/images +RUN cp -r node_modules/govuk-frontend/dist/govuk/assets/. public/assets/ # tidy up installation RUN apk del build-deps && rm -rf /tmp/* diff --git a/Gemfile b/Gemfile index c65bba4f..eb768f6f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,8 @@ ruby File.read(".ruby-version").strip # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", ">= 1.1.0", require: false -gem "govuk_design_system_formbuilder", "~> 3.1.0" +gem "govuk-components", "~> 5.0" +gem "govuk_design_system_formbuilder" gem "jquery-rails" gem "mimemagic", "~> 0.3.7" gem "pg" diff --git a/Gemfile.lock b/Gemfile.lock index de10f9fc..1959b2b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,7 +95,7 @@ GEM xpath (~> 3.2) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) crass (1.0.6) cucumber (8.0.0) builder (~> 3.2, >= 3.2.4) @@ -152,13 +152,17 @@ GEM ffi (1.15.5) globalid (1.1.0) activesupport (>= 5.0) - govuk_design_system_formbuilder (3.1.0) + govuk-components (5.1.0) + html-attributes-utils (~> 1.0.0, >= 1.0.0) + pagy (~> 6.0) + view_component (>= 3.9, < 3.11) + govuk_design_system_formbuilder (5.1.0) actionview (>= 6.1) activemodel (>= 6.1) activesupport (>= 6.1) - html-attributes-utils (~> 0.9, >= 0.9.2) + html-attributes-utils (~> 1) highline (2.1.0) - html-attributes-utils (0.9.2) + html-attributes-utils (1.0.2) activesupport (>= 6.1.4.4) i18n (1.14.1) concurrent-ruby (~> 1.0) @@ -193,7 +197,7 @@ GEM railties (>= 4) request_store (~> 1.0) logstash-event (1.2.02) - loofah (2.21.3) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -211,8 +215,8 @@ GEM nokogiri (~> 1) rake mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.1) + mini_portile2 (2.8.5) + minitest (5.22.2) msgpack (1.7.1) multi_test (1.1.0) net-imap (0.3.4) @@ -225,9 +229,10 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.15.3) + nokogiri (1.16.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) + pagy (6.5.0) parallel (1.23.0) parser (3.2.2.3) ast (~> 2.4.1) @@ -236,7 +241,7 @@ GEM public_suffix (5.0.1) puma (5.6.4) nio4r (~> 2.0) - racc (1.7.1) + racc (1.7.3) rack (2.2.7) rack-test (2.1.0) rack (>= 1.3) @@ -259,7 +264,7 @@ GEM actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.1.1) + rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) @@ -387,6 +392,10 @@ GEM uglifier (4.2.0) execjs (>= 0.3.0, < 3) unicode-display_width (2.4.2) + view_component (3.10.0) + activesupport (>= 5.2.0, < 8.0) + concurrent-ruby (~> 1.0) + method_source (~> 1.0) virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) @@ -398,7 +407,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.6.13) PLATFORMS ruby @@ -414,7 +423,8 @@ DEPENDENCIES debug dotenv-rails factory_bot_rails - govuk_design_system_formbuilder (~> 3.1.0) + govuk-components (~> 5.0) + govuk_design_system_formbuilder i18n-debug i18n-tasks jquery-rails diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 1ead45d1..941d66ff 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,7 +16,6 @@ // GOV.UK Frontend // https://github.com/alphagov/govuk-frontend/blob/master/docs/installation/installing-with-npm.md // -//= require govuk-frontend/govuk/all //= require moj //= require_tree ./modules diff --git a/app/assets/stylesheets/local/govuk.scss b/app/assets/stylesheets/local/govuk.scss index a77de134..91ff8d8a 100644 --- a/app/assets/stylesheets/local/govuk.scss +++ b/app/assets/stylesheets/local/govuk.scss @@ -3,6 +3,6 @@ // $govuk-new-link-styles: true; $govuk-global-styles: true; -$govuk-assets-path: '/assets/govuk-frontend/govuk/assets/'; +$govuk-assets-path: '/assets/govuk-frontend/dist/govuk/assets/'; -@import 'govuk-frontend/govuk/all'; +@import 'govuk-frontend/dist/govuk/all'; diff --git a/app/views/layouts/_phase_banner.html.erb b/app/views/layouts/_phase_banner.html.erb index c449b942..a1a9be18 100644 --- a/app/views/layouts/_phase_banner.html.erb +++ b/app/views/layouts/_phase_banner.html.erb @@ -1,6 +1,6 @@

- + <%=t '.feedback.banner_html', link: about_contact_path %> diff --git a/app/views/layouts/govuk_template.html.erb b/app/views/layouts/govuk_template.html.erb index ea9c7438..1092f4ff 100644 --- a/app/views/layouts/govuk_template.html.erb +++ b/app/views/layouts/govuk_template.html.erb @@ -10,12 +10,10 @@ - - - - - - + <%= favicon_link_tag asset_path('govuk-frontend/dist/govuk/assets/images/favicon.ico'), sizes: '48x48' %> + <%= favicon_link_tag asset_path('govuk-frontend/dist/govuk/assets/images/favicon.svg'), type: 'image/svg+xml', sizes: 'any' %> + <%= favicon_link_tag asset_path('govuk-frontend/dist/govuk/assets/images/govuk-icon-mask.svg'), rel: 'mask-icon', color: '#0b0c0c' %> + <%= favicon_link_tag asset_path('govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png'), rel: 'apple-touch-icon', type: 'image/png', size: '180x180' %> <%= stylesheet_link_tag 'application', media: 'all', integrity: true, crossorigin: 'anonymous' %> @@ -36,27 +34,7 @@ <%= content_for?(:skip_link_message) ? yield(:skip_link_message) : 'Skip to main content' %> -

+<%= govuk_header(homepage_url: "https://www.gov.uk", service_name: yield(:service_name), service_url: "#") %>
<%= yield(:phase_banner) %> @@ -92,7 +70,6 @@ <%= javascript_include_tag 'application', integrity: true, crossorigin: 'anonymous' %> - <%= yield :body_end %> diff --git a/app/views/steps/caution/conditional_end_date/edit.html.erb b/app/views/steps/caution/conditional_end_date/edit.html.erb index 42a025f8..39fbabc9 100644 --- a/app/views/steps/caution/conditional_end_date/edit.html.erb +++ b/app/views/steps/caution/conditional_end_date/edit.html.erb @@ -6,7 +6,7 @@ <%= govuk_error_summary %> <%= step_form @form_object do |f| %> - <%= f.govuk_date_field :conditional_end_date, maxlength_enabled: true, form_group: { classes: 'app-util--compact-form-group' } do + <%= f.govuk_date_field :conditional_end_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' } do tag.p t('.lead_text'), class: 'govuk-body-m' end %> diff --git a/app/views/steps/caution/known_date/edit.html.erb b/app/views/steps/caution/known_date/edit.html.erb index ea12ed36..e28ed4a8 100644 --- a/app/views/steps/caution/known_date/edit.html.erb +++ b/app/views/steps/caution/known_date/edit.html.erb @@ -6,7 +6,7 @@ <%= govuk_error_summary %> <%= step_form @form_object do |f| %> - <%= f.govuk_date_field :known_date, maxlength_enabled: true, form_group: { classes: 'app-util--compact-form-group' } %> + <%= f.govuk_date_field :known_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' } %> <%= render partial: 'steps/shared/approx_date_checkbox', locals: { form: f, attribute: :approximate_known_date diff --git a/app/views/steps/conviction/compensation_payment_date/edit.html.erb b/app/views/steps/conviction/compensation_payment_date/edit.html.erb index 6d0d3334..7ce054cf 100644 --- a/app/views/steps/conviction/compensation_payment_date/edit.html.erb +++ b/app/views/steps/conviction/compensation_payment_date/edit.html.erb @@ -7,7 +7,7 @@ <%= step_form @form_object do |f| %> <%= f.govuk_date_field :compensation_payment_date, maxlength_enabled: true, - form_group: { classes: 'app-util--compact-form-group' }, + form_group: { class: 'app-util--compact-form-group' }, caption: { text: f.i18n_caption } do tag.p t('.lead_text'), class: 'govuk-body-m' end %> diff --git a/app/views/steps/conviction/conviction_date/edit.html.erb b/app/views/steps/conviction/conviction_date/edit.html.erb index 1e76b464..4c652f7a 100644 --- a/app/views/steps/conviction/conviction_date/edit.html.erb +++ b/app/views/steps/conviction/conviction_date/edit.html.erb @@ -6,7 +6,7 @@ <%= govuk_error_summary %> <%= step_form @form_object do |f| %> - <%= f.govuk_date_field :conviction_date, maxlength_enabled: true, form_group: { classes: 'app-util--compact-form-group' } do + <%= f.govuk_date_field :conviction_date, maxlength_enabled: true, form_group: { class: 'app-util--compact-form-group' } do tag.p t('.lead_text'), class: 'govuk-body-m' end %> diff --git a/app/views/steps/conviction/known_date/edit.html.erb b/app/views/steps/conviction/known_date/edit.html.erb index 1f8e08b7..503973d3 100644 --- a/app/views/steps/conviction/known_date/edit.html.erb +++ b/app/views/steps/conviction/known_date/edit.html.erb @@ -7,7 +7,7 @@ <%= step_form @form_object do |f| %> <%= f.govuk_date_field :known_date, maxlength_enabled: true, - form_group: { classes: 'app-util--compact-form-group' }, + form_group: { class: 'app-util--compact-form-group' }, legend: { text: f.i18n_legend }, caption: { text: f.i18n_caption } do tag.p f.i18n_lead_text, class: 'govuk-body-m' diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index f81c1103..cc656871 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -13,4 +13,4 @@ # folder are already added. # Rails.application.config.assets.precompile += %w( admin.js admin.css ) Rails.application.config.assets.precompile << %r{fonts/[\w-]+\.(?:eot|svg|ttf|woff2?)$} -Rails.application.config.assets.precompile << %r{images/[\w-]+\.(?:png|svg)$} +Rails.application.config.assets.precompile << %r{images/[\w-]+\.(?:png|svg|ico)$} diff --git a/package.json b/package.json index 934b10e2..f5ccce5d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "private": true, "license": "MIT", "dependencies": { - "govuk-frontend": "^4.7.0" + "govuk-frontend": "^5.2.0" } } diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 7f5b31ff..e12e5454 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -93,7 +93,7 @@ def previous_step_path expect( helper.govuk_error_summary(form_object), ).to eq( - '', + '

There is a problem on this page

', ) end diff --git a/yarn.lock b/yarn.lock index adaebc40..8af99253 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -govuk-frontend@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-4.7.0.tgz#69950b6c2e69f435ffe9aa60d8dee232dac977de" - integrity sha512-0OsdCusF5qvLWwKziU8zqxiC0nq6WP0ZQuw51ymZ/1V0tO71oIKMlSLN2S9bm8RcEGSoidPt2A34gKxePrLjvg== +govuk-frontend@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/govuk-frontend/-/govuk-frontend-5.2.0.tgz" + integrity sha512-beD3wztHpkKz6JUpPwnwop1ejb4rTFMPLCutKLCIDmUS4BPpW59ggVUfctsRqHd2Zjw9wxljdRdeIJ8AZFyyTw==