Skip to content

Commit

Permalink
Remove specialist topics from breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
hannako committed Mar 1, 2024
1 parent 7c73901 commit bb3a931
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ def options(navigation)
step_by_step: false,
breadcrumbs: navigation.breadcrumbs,
}
elsif navigation.content_has_a_topic?
{
step_by_step: false,
breadcrumbs: navigation.topic_breadcrumbs,
}
elsif navigation.use_taxon_breadcrumbs?
{
step_by_step: false,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ def taxon_breadcrumbs
@taxon_breadcrumbs ||= ContentBreadcrumbsBasedOnTaxons.call(content_item)
end

def topic_breadcrumbs
@topic_breadcrumbs ||= ContentBreadcrumbsBasedOnTopic.call(content_item)
end

def breadcrumbs
breadcrumbs_based_on_ancestors
end
Expand Down Expand Up @@ -88,10 +84,6 @@ def content_is_a_html_publication?
content_item["document_type"] == "html_publication"
end

def content_has_a_topic?
content_item.dig("links", "topics").present?
end

def content_tagged_to_current_step_by_step?
# TODO: remove indirection here
step_nav_helper.show_header?
Expand Down
4 changes: 2 additions & 2 deletions spec/components/breadcrumbs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ def assert_link_with_text_in(selector, link, text)
it "renders breadcrumb items without link as text" do
render_component(
breadcrumbs: [
{ title: "Topic", url: "/topic" },
{ title: "Education", url: "/education" },
{ title: "Current Page" },
],
)

assert_link_with_text_in(".govuk-breadcrumbs__list-item:first-child", "/topic", "Topic")
assert_link_with_text_in(".govuk-breadcrumbs__list-item:first-child", "/education", "Education")
assert_select(".govuk-breadcrumbs__list-item:last-child", "Current Page")
assert_select(".govuk-breadcrumbs__list-item:last-child a", false)
end
Expand Down
6 changes: 0 additions & 6 deletions spec/components/contextual_breadcrumbs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ def remove_curated_related_item(content_item)
content_item
end

def remove_topics(content_item)
content_item["links"].delete("topics")
content_item
end

def set_parent_titles_to_businesses(content_item)
content_item["links"]["parent"][0]["title"] = "Business and self-employed"
content_item["links"]["parent"][0]["links"]["parent"][0]["title"] = "Licences and licence applications"
Expand Down Expand Up @@ -86,7 +81,6 @@ def set_live_taxons(content_item)
it "renders taxon breadcrumbs if the content_item is tagged to mainstream browse but there is no mainstream browse parent" do
content_item = example_document_for("guide", "guide-with-no-parent")
content_item = set_live_taxons(content_item)
remove_topics(content_item)
render_component(content_item:)
assert_no_selector(".gem-c-step-nav-header")
assert_select "a", text: "Home"
Expand Down
12 changes: 6 additions & 6 deletions spec/components/contextual_footer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ def component_name
it "sets the GA4 type to \"contextual footer\"" do
content_item = {}
content_item["links"] = {
"topics" => [
"taxons" => [
{
"base_path" => "/skating",
"title" => "Skating",
"document_type" => "topic",
"document_type" => "taxon",
},
{
"base_path" => "/paragliding",
"title" => "Paragliding",
"document_type" => "topic",
"document_type" => "taxon",
},
],
}
Expand All @@ -55,16 +55,16 @@ def component_name
it "allows GA4 to be disabled" do
content_item = {}
content_item["links"] = {
"topics" => [
"taxons" => [
{
"base_path" => "/skating",
"title" => "Skating",
"document_type" => "topic",
"document_type" => "taxon",
},
{
"base_path" => "/paragliding",
"title" => "Paragliding",
"document_type" => "topic",
"document_type" => "taxon",
},
],
}
Expand Down

0 comments on commit bb3a931

Please sign in to comment.