From a0328b1ebbd93cb40efc67cb21fb927f18db7618 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 23 Oct 2023 16:38:34 +0100 Subject: [PATCH 1/3] Include missing component JavaScript - scripts were not being included for these components even though they are in use in this application --- app/assets/javascripts/application.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 3a439839d..fdd109291 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -3,6 +3,8 @@ //= 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 From 4511b945f616d9d97a1d9d66faa09cf74991ee3f Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 23 Oct 2023 16:45:47 +0100 Subject: [PATCH 2/3] Remove component style override - style added 20px margin top to the intervention component - component is already wrapped in an element that has 20px margin top, so this rule did nothing - applications shouldn't style components, changes should be made directly to components or component options --- app/assets/stylesheets/components/_banner.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/assets/stylesheets/components/_banner.scss b/app/assets/stylesheets/components/_banner.scss index 1c3b1cba8..c8fafbf9d 100644 --- a/app/assets/stylesheets/components/_banner.scss +++ b/app/assets/stylesheets/components/_banner.scss @@ -40,7 +40,3 @@ max-width: 30em; padding-top: govuk-spacing(2); } - -.gem-c-intervention { - margin-top: govuk-spacing(4); -} From a846908d0cb471f284dbf9f3b186b898bb583e06 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 30 Oct 2023 13:32:42 +0000 Subject: [PATCH 3/3] Remove metadata component style override - and replace with new option from the component - inverse option for metadata automatically had extra spacing around it, this was being removed by this style override - can be seen on pages such as https://www.gov.uk/guidance/the-highway-code --- app/assets/stylesheets/views/_manual.scss | 9 --------- app/presenters/content_item/manual.rb | 1 + test/presenters/content_item/manual_test.rb | 3 ++- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/views/_manual.scss b/app/assets/stylesheets/views/_manual.scss index a19c6c05b..98d7cb91d 100644 --- a/app/assets/stylesheets/views/_manual.scss +++ b/app/assets/stylesheets/views/_manual.scss @@ -42,15 +42,6 @@ &.hmrc { background: govuk-organisation-colour("hm-revenue-customs"); } - - .gem-c-metadata--inverse { - background: none; - padding: 0; - - .gem-c-metadata__list { - margin: 0; - } - } } .section-list { diff --git a/app/presenters/content_item/manual.rb b/app/presenters/content_item/manual.rb index b2a92cf89..26e515376 100644 --- a/app/presenters/content_item/manual.rb +++ b/app/presenters/content_item/manual.rb @@ -33,6 +33,7 @@ def manual_metadata first_published: published, other: other_metadata, inverse: true, + inverse_compress: true, } end diff --git a/test/presenters/content_item/manual_test.rb b/test/presenters/content_item/manual_test.rb index 589a5794b..6cb60e321 100644 --- a/test/presenters/content_item/manual_test.rb +++ b/test/presenters/content_item/manual_test.rb @@ -66,10 +66,11 @@ def initialize(schema_name = "manual") expected_metadata = { from: ["blah"], first_published: "23 March 2022", - inverse: true, other: { I18n.t("manuals.updated") => "23 March 2022, #{I18n.t('manuals.see_all_updates')}", }, + inverse: true, + inverse_compress: true, } assert_equal expected_metadata, item.manual_metadata end