diff --git a/docs/navigation-links.md b/docs/navigation-links.md deleted file mode 100644 index 9983141d8..000000000 --- a/docs/navigation-links.md +++ /dev/null @@ -1,64 +0,0 @@ -# Navigation links in B variant of ContentPagesNav - -### Screenshots -![Navigation links](assets/navigation-links-screenshot.png) - -### Configuration - -#### Overview -The configuration of which kinds of links appear for which kinds of content is governed by -[config/taxonomy_navigation_links_out.yml](../config/taxonomy_navigation_links_out.yml) - -This file dictates which kinds of content are shown at three hierarchical levels: document type, subgroup - and supergroup. It allows rules to be created that can cover all three levels. -Perhaps counterintuitively, document_type is at the top of the hierarchy with supergroup at the bottom. -This means a document_type rule overrides a subgroup rule, which in turn overrides a supergroup rule - -This is desirable as it means we can have fine grained control over what links we show for a particular document_type - or subgroup while being able to fall back for general supergroup level rules for the large number of content items - that will match a supergroup. For example, for an `open_consultation` we can show links to `policy_and_engagement` - and `decisions` - -#### Structure - -Each entry in all three levels of the hierarchy must have a key which content items will be matched to if they -have that value for their document_type, content_purpose_subgroup or content_purpose_supergroup. The value for this -key must have the following entries - - `title`: the name of the part of the subgroup or supergroup we want to show, e.g. `services` - or `news` - - `type`: the type of the part of the subgroup or supergroup we want to show e.g. `content_purpose_supergroup` - or `content_purpose_subgroup` - - `supergroup`: The supergroup of the part of the subgroup or supergroup we want to show, regardless of whether or - not what we're showing is itself a supergroup e.g. `services` or `policy_and_engagement` - -#### Showing no links -If you don't want to show any related taxonomy links for a particular document type, this can be defined in the config as follows: - -``` -document_type: - fatality_notice: [] - ``` - -#### Example -``` - document_type: - fatality_notice: [] - ... - open_consultation: - - title: policy_and_engagement - type: content_purpose_supergroup - supergroup: policy_and_engagement - - title: decisions - type: content_purpose_subgroup - supergroup: transparency - ``` - - -### Fetching -This is likely to change in the future so this is only a high level overview. - -When displaying a content item, the app will consult the configuration file to determine what (if any) supergroups -should be displayed for the content item, which will be scoped to include any subgroups if present. - -Rummager is queried for either the most popular or most recent content for that supergroup. If any content items -are returned, a relevant navigation section with those items will be rendered. diff --git a/test/controllers/content_items_controller_test.rb b/test/controllers/content_items_controller_test.rb index 091609e1e..3b31df16b 100644 --- a/test/controllers/content_items_controller_test.rb +++ b/test/controllers/content_items_controller_test.rb @@ -2,7 +2,6 @@ class ContentItemsControllerTest < ActionController::TestCase include GdsApi::TestHelpers::ContentStore - include GdsApi::TestHelpers::Rummager include GovukAbTesting::MinitestHelpers test 'routing handles paths with no format or locale' do diff --git a/test/integration/specialist_document_test.rb b/test/integration/specialist_document_test.rb index 73b461e2c..9b38be92f 100644 --- a/test/integration/specialist_document_test.rb +++ b/test/integration/specialist_document_test.rb @@ -1,12 +1,6 @@ require 'test_helper' class SpecialistDocumentTest < ActionDispatch::IntegrationTest - include GdsApi::TestHelpers::Rummager - - setup do - stub_any_rummager_search - end - test "random but valid specialist documents do not error" do setup_and_visit_random_content_item(document_type: 'aaib_report') setup_and_visit_random_content_item(document_type: 'raib_report') @@ -177,9 +171,6 @@ def assert_nested_content_item(heading) end test 'renders a link to statutory instruments finder' do - # Statutory instruments are tagged to taxonomy so stub rummager request for similar content - # which is triggered by the sidebar component. - stub_request(:get, /\/search.json/).to_return(status: 200, body: "{}", headers: {}) setup_and_visit_content_item('eu-withdrawal-act-2018-statutory-instruments') assert page.has_css?("a[href='/eu-withdrawal-act-2018-statutory-instruments']", diff --git a/test/support/govuk_content_schema_examples.rb b/test/support/govuk_content_schema_examples.rb index efe981c48..f27ffb209 100644 --- a/test/support/govuk_content_schema_examples.rb +++ b/test/support/govuk_content_schema_examples.rb @@ -1,5 +1,4 @@ require 'gds_api/test_helpers/content_store' -require 'gds_api/test_helpers/rummager' # Include this module to get access to the GOVUK Content Schema examples in the # tests.