Skip to content

Commit

Permalink
Remove specialist topics from presenters
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrino committed Mar 18, 2024
1 parent 34d88aa commit dfb2992
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
4 changes: 0 additions & 4 deletions lib/govuk_publishing_components/presenters/content_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ def related_statistical_data_sets
filter_link_type(content_store_response.dig("links", "related_statistical_data_sets").to_a, "statistical_data_set")
end

def related_topics
filter_link_type(content_store_response.dig("links", "topics").to_a, "topic")
end

def related_topical_events
filter_link_type(content_store_response.dig("links", "topical_events").to_a, "topical_event")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class RelatedNavigationHelper
MAX_SECTION_LENGTH = 5
DEFINED_SECTIONS = %w[
related_guides
topics
collections
topical_events
world_locations
Expand All @@ -32,7 +31,6 @@ def related_navigation_contents
}
when :footer
{
"topics" => related_topics_or_taxons,
"topical_events" => related_topical_events,
"world_locations" => related_world_locations,
"statistical_data_sets" => related_statistical_data_sets,
Expand All @@ -44,7 +42,6 @@ def related_navigation_contents
"related_items" => related_items,
"related_guides" => related_guides,
"collections" => related_document_collections,
"topics" => related_topics_or_taxons,
"topical_events" => related_topical_events,
"world_locations" => related_world_locations,
"statistical_data_sets" => related_statistical_data_sets,
Expand Down Expand Up @@ -142,28 +139,6 @@ def related_taxons
@related_taxons ||= content_item_links_for("taxons", only: "taxon")
end

def related_topics_or_taxons
return related_topics if related_topics.any?
return related_taxons if related_taxons.any?

[]
end

def related_topics
@related_topics ||= begin
mainstream_browse_page_links = content_item_links_for("mainstream_browse_pages", only: "mainstream_browse_page")
topic_links = content_item_links_for("topics", only: "topic")

return topic_links if topic_links.present? && mainstream_browse_page_links.empty?

mainstream_browse_page_links + topic_links.find_all do |topic_link|
mainstream_browse_page_links.none? do |mainstream_browse_page_link|
mainstream_browse_page_link[:text] == topic_link[:text]
end
end
end
end

def related_topical_events
content_item_links_for("topical_events", only: "topical_event")
end
Expand Down

0 comments on commit dfb2992

Please sign in to comment.