From f5c076983b7fd15c6f0a7320041594f299d691a4 Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Tue, 28 Jan 2025 13:11:23 +0000 Subject: [PATCH] Replace title component with heading - should still be a h1 and visually identical - heading has no margin top, so matches the previous margin_top: 0 option on title - title component is being retired and margin_top option has already been removed --- app/assets/stylesheets/application.scss | 1 - app/views/layouts/design_system.html.erb | 7 ++++--- test/integration/edition_edit_test.rb | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6c7a84b5f..31c46da81 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -35,7 +35,6 @@ $govuk-page-width: 1140px; @import 'govuk_publishing_components/components/summary-list'; @import 'govuk_publishing_components/components/table'; @import 'govuk_publishing_components/components/textarea'; -@import 'govuk_publishing_components/components/title'; @import "tags"; @import "downtimes"; @import "options_sidebar"; diff --git a/app/views/layouts/design_system.html.erb b/app/views/layouts/design_system.html.erb index 7bbce706f..7e5948d01 100644 --- a/app/views/layouts/design_system.html.erb +++ b/app/views/layouts/design_system.html.erb @@ -37,11 +37,12 @@ <% if yield(:title).present? %>
- <%= render "govuk_publishing_components/components/title", { - title: yield(:title), + <%= render "govuk_publishing_components/components/heading", { + text: yield(:title), context: yield(:title_context), - margin_top: 0, margin_bottom: 6, + font_size: "xl", + heading_level: 1, } %>
diff --git a/test/integration/edition_edit_test.rb b/test/integration/edition_edit_test.rb index c3d27e498..e49794f9c 100644 --- a/test/integration/edition_edit_test.rb +++ b/test/integration/edition_edit_test.rb @@ -74,7 +74,7 @@ class EditionEditTest < IntegrationTest end should "show 'Metadata' header and an update button" do - within :css, ".gem-c-heading" do + within :css, ".gem-c-heading h2" do assert page.has_text?("Metadata") end assert page.has_button?("Update") @@ -139,7 +139,7 @@ class EditionEditTest < IntegrationTest end should "show 'Unpublish' header and 'Continue' button" do - within :css, ".gem-c-heading" do + within :css, ".gem-c-heading h2" do assert page.has_text?("Unpublish") end assert page.has_button?("Continue") @@ -215,7 +215,7 @@ class EditionEditTest < IntegrationTest end should "show 'Admin' header and not show 'Skip fact check' button" do - within :css, ".gem-c-heading" do + within :css, ".gem-c-heading h2" do assert page.has_text?("Admin") end assert page.has_no_button?("Skip fact check") @@ -235,7 +235,7 @@ class EditionEditTest < IntegrationTest end should "show 'Admin' header and not show 'Skip fact check' button" do - within :css, ".gem-c-heading" do + within :css, ".gem-c-heading h2" do assert page.has_text?("Admin") end assert page.has_no_button?("Skip fact check") @@ -262,7 +262,7 @@ class EditionEditTest < IntegrationTest end should "show 'Admin' header and an 'Skip fact check' button" do - within :css, ".gem-c-heading" do + within :css, ".gem-c-heading h2" do assert page.has_text?("Admin") end assert page.has_button?("Skip fact check")