Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDPT-1385 Update crown #728

Merged
merged 9 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
34 changes: 22 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/local/govuk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
2 changes: 1 addition & 1 deletion app/views/layouts/_phase_banner.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="govuk-phase-banner">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag ">beta</strong>
<strong class="govuk-tag govuk-phase-banner__content__tag ">Beta</strong>
<span class="govuk-phase-banner__text">
<%=t '.feedback.banner_html', link: about_contact_path %>
</span>
Expand Down
33 changes: 5 additions & 28 deletions app/views/layouts/govuk_template.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@

<meta http-equiv="X-UA-Compatible" content="IE=edge"/>

<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/favicon.ico' %>" type="image/x-icon"/>
<link rel="mask-icon" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-mask-icon.svg' %>" color="blue">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-180x180.png' %>">
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-167x167.png' %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon-152x152.png' %>">
<link rel="apple-touch-icon" href="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-apple-touch-icon.png' %>">
<%= 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' %>

Expand All @@ -36,27 +34,7 @@
<%= content_for?(:skip_link_message) ? yield(:skip_link_message) : 'Skip to main content' %>
</a>

<header class="govuk-header" role="banner" data-module="govuk-header">
<div class="govuk-header__container govuk-width-container">
<div class="govuk-header__logo">
<a href="https://www.gov.uk" class="govuk-header__link govuk-header__link--homepage">
<span class="govuk-header__logotype">
<svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.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0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
<image src="<%= asset_path '/assets/govuk-frontend/govuk/assets/images/govuk-logotype-crown.png' %>" xlink:href="" class="govuk-header__logotype-crown-fallback-image" width="36" height="32"></image>
</svg>
<span class="govuk-header__logotype-text">
GOV.UK
</span>
</span>
</a>
</div>

<div class="govuk-header__content">
<%= yield(:service_name) %>
</div>
</div>
</header>
<%= govuk_header(homepage_url: "https://www.gov.uk", service_name: yield(:service_name), service_url: "#") %>

<div class="govuk-width-container app-width-container--wide">
<%= yield(:phase_banner) %>
Expand Down Expand Up @@ -92,7 +70,6 @@
</footer>

<%= javascript_include_tag 'application', integrity: true, crossorigin: 'anonymous' %>
<script>window.GOVUKFrontend.initAll();</script>

<%= yield :body_end %>
</body>
Expand Down
2 changes: 1 addition & 1 deletion app/views/steps/caution/conditional_end_date/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/steps/caution/known_date/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/steps/conviction/conviction_date/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/steps/conviction/known_date/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)$}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"private": true,
"license": "MIT",
"dependencies": {
"govuk-frontend": "^4.7.0"
"govuk-frontend": "^5.2.0"
}
}
2 changes: 1 addition & 1 deletion spec/helpers/application_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def previous_step_path
expect(
helper.govuk_error_summary(form_object),
).to eq(
'<div class="govuk-error-summary" role="alert" data-module="govuk-error-summary" aria-labelledby="error-summary-title"><h2 id="error-summary-title" class="govuk-error-summary__title">There is a problem on this page</h2><div class="govuk-error-summary__body"><ul class="govuk-list govuk-error-summary__list"><li><a data-turbolinks="false" href="#base-form-base-field-error">can&#39;t be blank</a></li></ul></div></div>',
'<div class="govuk-error-summary" data-module="govuk-error-summary"><div role="alert"><h2 class="govuk-error-summary__title">There is a problem on this page</h2><div class="govuk-error-summary__body"><ul class="govuk-list govuk-error-summary__list"><li><a data-turbolinks="false" href="#base-form-base-field-error">can&#39;t be blank</a></li></ul></div></div></div>',
)
end

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Loading