diff --git a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.html.erb b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.html.erb index 39f348e9655..e47004ffd86 100644 --- a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.html.erb +++ b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.html.erb @@ -17,16 +17,16 @@ it out for now--> href: sort_link("document_type"), sort_direction: sort_direction("document_type"), }, - { - text: "Instances", - href: sort_link("instances"), - sort_direction: sort_direction("instances"), - }, { text: "Views (30 days)", href: sort_link("unique_pageviews"), sort_direction: sort_direction("unique_pageviews"), }, + { + text: "Instances", + href: sort_link("instances"), + sort_direction: sort_direction("instances"), + }, { text: "Lead organisation", href: sort_link("primary_publishing_organisation_title"), diff --git a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb index 5f56dbe7dc8..1beffeaacdf 100644 --- a/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb +++ b/lib/engines/content_block_manager/app/components/content_block_manager/content_block/document/show/host_editions_table_component.rb @@ -40,10 +40,10 @@ def rows text: content_item.document_type.humanize, }, { - text: content_item.instances, + text: content_item.unique_pageviews ? number_to_human(content_item.unique_pageviews, format: "%n%u", precision: 3, significant: true, units: { thousand: "k", million: "m", billion: "b" }) : 0, }, { - text: content_item.unique_pageviews ? number_to_human(content_item.unique_pageviews, format: "%n%u", precision: 3, significant: true, units: { thousand: "k", million: "m", billion: "b" }) : nil, + text: content_item.instances, }, { text: organisation_link(content_item), diff --git a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb index 0e1aab47697..7dc37681824 100644 --- a/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb +++ b/lib/engines/content_block_manager/app/controllers/content_block_manager/content_block/editions/workflow_controller.rb @@ -47,6 +47,11 @@ def update end end + def context + "Edit content block" + end + helper_method :context + private def edit_draft diff --git a/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/review_links.html.erb b/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/review_links.html.erb index 0692f45f7e6..84fa45f29b2 100644 --- a/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/review_links.html.erb +++ b/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/review_links.html.erb @@ -1,5 +1,5 @@ -<% content_for :context, "Manage #{add_indefinite_article @content_block_document.block_type.humanize}" %> -<% content_for :title, "Where the change will appear" %> +<% content_for :context, context %> +<% content_for :title, "Preview #{@content_block_document.block_type.humanize.downcase}" %> <% content_for :title_margin_bottom, 4 %> <% content_for :back_link do %> <%= render "govuk_publishing_components/components/back_link", { @@ -7,7 +7,9 @@ } %> <% end %> -
The new <%= @content_block_document.block_type.humanize.downcase %> will appear on the following content after you publish the change.
++ The list does not include content in PDF or beyond GOV.UK. +
<%= render( @@ -22,7 +24,7 @@ <%= render( ContentBlockManager::ContentBlock::Document::Show::HostEditionsTableComponent.new( is_preview: true, - caption: "Content it appears in", + caption: "List of locations", host_content_items: @host_content_items, current_page: @page, order: @order, diff --git a/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/schedule_publishing.html.erb b/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/schedule_publishing.html.erb index f14239ee1d0..c497b0b9fda 100644 --- a/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/schedule_publishing.html.erb +++ b/lib/engines/content_block_manager/app/views/content_block_manager/content_block/editions/workflow/schedule_publishing.html.erb @@ -1,4 +1,4 @@ -<% content_for :context, "Manage #{add_indefinite_article @content_block_edition.document.block_type.humanize}" %> +<% content_for :context, context %> <% content_for :title, "When do you want to publish the change?" %> <% content_for :title_margin_bottom, 4 %> <% content_for :back_link do %> diff --git a/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb b/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb index 5498583214e..9a1d940bc93 100644 --- a/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb +++ b/lib/engines/content_block_manager/features/step_definitions/content_block_manager_steps.rb @@ -489,7 +489,7 @@ def should_show_edit_form_for_email_address_content_block(document_title, email_ end Then(/^I am shown where the changes will take place$/) do - expect(page).to have_selector("h1", text: "Where the change will appear") + expect(page).to have_selector("h1", text: "Preview email address") @dependent_content.each do |item| assert_text item["title"] diff --git a/lib/engines/content_block_manager/test/components/content_block/document/show/host_editions_table_component_test.rb b/lib/engines/content_block_manager/test/components/content_block/document/show/host_editions_table_component_test.rb index 27e075ce0c2..f53ba13aec6 100644 --- a/lib/engines/content_block_manager/test/components/content_block/document/show/host_editions_table_component_test.rb +++ b/lib/engines/content_block_manager/test/components/content_block/document/show/host_editions_table_component_test.rb @@ -170,7 +170,7 @@ def self.it_returns_unknown_user context "when unique pageviews can't be found" do let(:unique_pageviews) { nil } - it "displays not found" do + it "displays a zero" do render_inline( described_class.new( caption:, @@ -179,7 +179,7 @@ def self.it_returns_unknown_user ), ) - assert_selector "tbody .govuk-table__cell", text: "Not set" + assert_selector "tbody .govuk-table__cell", text: "0" end end