Skip to content

Commit

Permalink
Remove code related to Policies
Browse files Browse the repository at this point in the history
Trello card: 
https://trello.com/c/P9Fmi7wX/213-remove-now-unnecessary-code-relating-to-policies-and-policy-areas

As part of the work for the new Single Taxonomy, Policies are being
unpublished, therefore code related to Policies is not needed anymore.
  • Loading branch information
Alan Gabbianelli committed Sep 26, 2018
1 parent 4881cc6 commit 3707d2d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Related Navigation
description: Component showing related content, including topics, guidance, collections and policies (where applicable)
description: Component showing related content, including topics, guidance and collections
accessibility_criteria: |
- Should have a role of 'navigation' on any navigation elements inside the component
- Should be marked up as navigation and not as tangential content
Expand Down Expand Up @@ -41,16 +41,6 @@ examples:
- title: The future of jobs and skills
base_path: /government/collections/the-future-of-jobs-and-skills
document_type: document_collection
with_policies:
data:
links:
related_policies:
- title: Further education and training
base_path: /government/policies/further-education-and-training
document_type: policy
- title: Primary school education
base_path: /government/policies/primary-school-education
document_type: policy
with_topical_events:
data:
links:
Expand Down Expand Up @@ -151,10 +141,6 @@ examples:
- title: The future of jobs and skills
base_path: /government/collections/the-future-of-jobs-and-skills
document_type: document_collection
related_policies:
- title: Further education and training
base_path: /government/policies/further-education-and-training
document_type: policy
world_locations:
- title: South Sudan
base_path: /world/south-sudan/news
Expand Down
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 @@ -90,10 +90,6 @@ def related_organisations
filter_link_type(content_store_response.dig("links", "organisations").to_a, "organisation")
end

def related_policies
filter_link_type(content_store_response.dig("links", "related_policies").to_a, "policy")
end

def related_statistical_data_sets
filter_link_type(content_store_response.dig("links", "related_statistical_data_sets").to_a, "statistical_data_set")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class RelatedNavigationHelper
related_guides
topics
collections
policies
topical_events
world_locations
statistical_data_sets
Expand All @@ -24,7 +23,6 @@ def related_navigation
"related_guides" => related_guides,
"collections" => related_collections,
"topics" => related_topics,
"policies" => related_policies,
"topical_events" => related_topical_events,
"world_locations" => related_world_locations,
"statistical_data_sets" => related_statistical_data_sets,
Expand Down Expand Up @@ -106,11 +104,6 @@ def filter_link_type(group, type)
end
end

def related_policies
policies = filter_link_type("related_policies", "policy")
build_links_for_sidebar(policies)
end

def related_statistical_data_sets
statistical_data_sets = filter_link_type("related_statistical_data_sets", "statistical_data_set")
build_links_for_sidebar(statistical_data_sets)
Expand Down
25 changes: 1 addition & 24 deletions spec/components/related_navigation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,6 @@ def construct_links(type, base_path, title, document_type = nil)
assert_select ".gem-c-related-navigation__section-link[href=\"/government/collections/the-future-of-jobs-and-skills\"]", text: 'The future of jobs and skills'
end

it "renders policy section when passed policy items" do
content_item = {}
content_item["links"] = construct_links(
"related_policies",
"/government/policies/further-education-and-training",
"Further education and training",
"policy"
)
render_component(content_item)

assert_select ".gem-c-related-navigation__sub-heading", text: 'Policy'
assert_select ".gem-c-related-navigation__section-link[href=\"/government/policies/further-education-and-training\"]", text: 'Further education and training'
end

it "renders topical events section when passed topical event items" do
content_item = {}
content_item["links"] = construct_links(
Expand Down Expand Up @@ -191,20 +177,11 @@ def construct_links(type, base_path, title, document_type = nil)
ordered_related_items = construct_links(
"ordered_related_items", "/apprenticeships", "Apprenticeships"
)
related_policies = construct_links(
"related_policies",
"/government/policies/further-education-and-training",
"Further education and training",
"policy"
)
content_item["links"] = ordered_related_items.merge(related_policies)
content_item["links"] = ordered_related_items
render_component(content_item)

assert_select ".gem-c-related-navigation__main-heading", text: 'Related content'
assert_select ".gem-c-related-navigation__section-link--other[href=\"/apprenticeships\"]", text: 'Apprenticeships'

assert_select ".gem-c-related-navigation__sub-heading", text: 'Policy'
assert_select ".gem-c-related-navigation__section-link[href=\"/government/policies/further-education-and-training\"]", text: 'Further education and training'
end

it "link tracking is enabled" do
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def contextual_navigation
"Travel advice Afghanistan" => "/foreign-travel-advice/afghanistan",
"HMRC contact" => "/government/organisations/hm-revenue-customs/contact/agent-dedicated-line-self-assessment-or-paye-for-individuals",
"AAIB report (specialist document)" => "/aaib-reports/aaib-investigation-to-airbus-helicopters-ec120b-colibri-g-swng",
"Guidance with a policy" => "/government/publications/helping-british-nationals-overseas-our-service-on-twitter-fcotravel--2",
}

if params[:base_path]
Expand Down
11 changes: 0 additions & 11 deletions spec/lib/presenters/related_navigation_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def payload_for(schema, content_item)
"related_guides" => [],
"collections" => [],
"topics" => [],
"policies" => [],
"topical_events" => [],
"world_locations" => [],
"statistical_data_sets" => [],
Expand Down Expand Up @@ -104,15 +103,6 @@ def payload_for(schema, content_item)
"document_type" => "mainstream_browse_page"
}
],
"related_policies" => [
{
"content_id" => "32c1b93d-2553-47c9-bc3c-fc5b513ecc32",
"locale" => "en",
"base_path" => "/related-policy",
"title" => "related policy",
"document_type" => "policy"
}
],
"world_locations" => [
{
"content_id" => "32c1b93d-2553-47c9-bc3c-fc5b513ecc32",
Expand All @@ -127,7 +117,6 @@ def payload_for(schema, content_item)
"related_guides" => [],
"collections" => [{ path: "/related-collection", text: "related collection" }],
"topics" => [{ path: "/browse/something", text: "A mainstream browse page" }, { path: "/related-topic", text: "related topic" }],
"policies" => [{ path: "/related-policy", text: "related policy" }],
"related_contacts" => [],
"related_external_links" => [],
"topical_events" => [{ path: "/related-topical-event", text: "related topical event" }],
Expand Down

0 comments on commit 3707d2d

Please sign in to comment.