Skip to content

Serves GOV.UK navigation pages, browse, topic, step-by-steps & services and information pages.

License

Notifications You must be signed in to change notification settings

alphagov-mirror/collections

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collections

Collections serves the GOV.UK navigation pages and organisation pages.

At time of writing, it also serves the priority campaign pages ie:

See the Campaign pages section below for more information.

Screenshots

Browse page

Browse page

Topic page

Topic page

Subtopic page

Subtopic page

Services and information page

Services and information page

Taxonomy page

Taxonomy page

Worldwide taxonomy page

Worldwide taxonomy page

Organisation index page

Organisation index page

Organisation page

Organisation page

Step by step page

Step by step page

Live examples

APIs

The endpoints and known consumers of this application's APIs are documented in docs/api

Nomenclature

Topics

  • Curated list: a group of content tagged to a subtopic that has been curated into a named list.
  • Topic: a named group of sub-topics. (A deprecated name for this is "specialist sector".)
  • Sub-topic: a group of content within a topic. (A deprecated name for this is "specialist sub-sector".)

Browse pages

Taxonomy

The taxonomy is surfaced on taxon pages, which group together tagged content for that level of the taxonomy into supergroups on the page, e.g: Guidance and Regulation for Funding and finance for students gov.uk/education/funding-and-finance-for-students. Each taxon page also shows a grid of sub-topics at the next level of the taxonomy.

Worldwide taxonomy

The worldwide taxonomy is rendered on different types of pages depending on whether the taxon has any children.

For example:

  • Taxon with children: a content item of type taxon that has child_taxons links. None of those child taxons' links have child_taxons, in which case we display an accordion view: gov.uk/world/afghanistan
  • Taxon without children: a content item of type taxon that doesn't have child_taxons links. In this case we display an leaf view: gov.uk/world/living-in-afghanistan
  • Taxon with associated taxons: a content item of type taxon that has associated_taxons links. In this case the tagged content of the taxon will include content that is directly tagged to it and also content that has been tagged to any of the associated taxons.

Campaign pages

Collections currently renders the following campaign pages:

Transition landing page ( /transition )

All content for the transition landing pages are currently read from yaml files. Welsh and English translations are available.

DIT landing page ( /eubusiness )

All content for the DIT landing pages are currently read from yaml files e.g. for English. See the content item's available translations for the current list.

Coronavirus pages:

Technical documentation

This is a public facing Ruby on Rails application that retrieves browse content from APIs and presents it. There is no underlying persistence layer, and (with the exception of the campaign pages) all content is retrieved from external sources.

Content for taxon pages

Content for taxon pages is returned by Search API based on content_ids for world taxonomy pages and content_ids and supergroups for all other taxonomy pages.

Dependencies

  • content-store, provides:
    • Mainstream browse pages (Root, Top and Second level browse pages)
    • Topics
    • Subtopics and their curated lists
  • search api, provides:
    • latest changes for Topics
    • content tagged to a particular Topic, Mainstream browse page or Organisation
  • email-alert-api, provides:
    • support for subscribing to notifications from a topic

Running the application

  • With startup scripts

./startup.sh

The app should start on http://localhost:3070

./startup.sh --live

This will run the app and point it at the production GOV.UK content-store and static instances.

./startup.sh --dummy

This will run the app and point it at the dummy content store, which serves the content schema examples and random content.

  • With govuk-docker

Once you have installed govuk-docker, do the following

> cd govuk/govuk-docker
> git pull origin master
> make collections

> cd govuk/collections
> govuk-docker-up

Collections will be running locally at collections.dev.gov.uk.

Running the test suite

Use bundle exec rake to run the test suite, excluding JavaScript. Or if you are running in docker, govuk-docker-run bundle exec rake

To test a single file:

govuk-docker-run bundle exec rails test test/unit/application_helper_test.rb

Javascript tests

Use bundle exec rake jasmine:ci to run Jasmine tests

Pact tests

Collections Organisations API has pact tests with gds-api-adapters.

Use bundle exec rake pact:verify to run the pact tests against the master pactfile stored on the pact broker.

If you have made a change to the code that consumes the organisations api, you might want to confirm that collections will still honour its pact. You can do so by running the pact tests against your local gds-api-adapters branch like so:

  • From gds-api-adapters run bundle exec rake to regenerate a new pactfile on you local machine.
  • From collections run bundle exec rake PACT_URI="../gds-api-adapters/spec/pacts/gds_api_adapters-collections_organisation_api.json" pact:verify

License

MIT License

About

Serves GOV.UK navigation pages, browse, topic, step-by-steps & services and information pages.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 72.2%
  • HTML 16.8%
  • JavaScript 5.7%
  • SCSS 4.6%
  • Gherkin 0.4%
  • Shell 0.2%
  • Dockerfile 0.1%