GithubHelp home page GithubHelp logo

alphagov / collections Goto Github PK

View Code? Open in Web Editor NEW
37.0 52.0 18.0 23.96 MB

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

Home Page: https://docs.publishing.service.gov.uk/apps/collections.html

License: MIT License

Ruby 70.49% JavaScript 2.70% HTML 24.47% Gherkin 0.11% Shell 0.10% Dockerfile 0.07% SCSS 2.07%
govuk-publishing-frontend govuk container

collections's Introduction

Collections

Collections serves the GOV.UK navigation pages and organisation pages. Search API is used to make the pages dynamic e.g. the latest changes for Topics, Organisations and Mainstream browse pages.

At time of writing, it also serves the priority campaign pages. See the Campaign pages manual for more details.

Live examples

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".)

Technical documentation

This is a Ruby on Rails app, and should follow our Rails app conventions.

You can use the GOV.UK Docker environment or the local startup.sh script to run the app. Read the guidance on local frontend development to find out more about each approach, before you get started.

If you are using GOV.UK Docker, remember to combine it with the commands that follow. See the GOV.UK Docker usage instructions for examples.

Running the test suite

bundle exec rake

To test a single file:

bundle exec rails test test/unit/application_helper_test.rb

To run JavaScript tests (only):

bundle exec rake jasmine

Pact tests

Collections Organisations API has a pact with GDS API Adapters.

See the guidance on Pact testing for how to run and modify the tests.

Further documentation

Licence

MIT License

collections's People

Contributors

1pretz1 avatar agadufrat avatar alecgibson avatar alex-ju avatar alext avatar andysellick avatar barrucadu avatar beckal avatar brucebolt avatar carvil avatar cbaines avatar chao-xian avatar danacotoran avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dilwoarh avatar edds avatar hannako avatar injms avatar jonathanhallam avatar kevindew avatar leenagupte avatar murilodalri avatar rosa-fox avatar sihugh avatar tetrino avatar theseanything avatar thomasleese avatar tijmenb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collections's Issues

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependencies.

As a result, Dependabot couldn't update any of your dependencies.

This could have been caused by a git reference having been deleted at the source, by an out-of-sync lockfile, or by a bug in Dependabot.

To help diagnose the issue, please try running bundle update --patch locally. If no errors occur, get in touch and we'll help dig into it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Update testing - accordion

Government organisations page search has a big gap

On https://www.gov.uk/government/organisations

If you search for something that happens to be at the bottom of the page, you might be forgiven for thinking your search hasn't found anything, because you might get this result and your browser window might not be tall enough:

Screenshot 2020-09-14 at 08 31 25

The reason for this is that each of the wrappers to each organisation type has a margin bottom of 60px, and the search only hides the individual items within each wrapper, not the wrapper itself:

Screenshot 2020-09-14 at 08 31 40

Surprisingly on mobile, this isn't a problem, even though the margin bottom is still there, each wrapper collapses over the next one.

X-Frame-Options

X-Frame-Options: allowall HTTP header has been enabled on the GDS pages since 2015 by this commit which at best looks unprofessional and at worst opens additional possibilities for fraud by allowing GDS pages to be embedded in frames.

Per my comment under that commit, if there's still need to allow frames for some origins as part of the transition, a much safer allow-from option exists for that purpose.

Convert tests from Minitest to RSpec

Issue

  • We are currently implementing Pact tests between Collections and gds-api-adapters in order to meet the criteria for CD of collections.
  • The pact gem brings in RSpec as a dependency. This will mean Collections runs two test suites, Minitest and RSpec.
  • This is not necessarily bad, eg Smart Answers also has both suites. However in the case of collections it adds a little bit of complexity. Collections uses cucumber for its feature tests, and they fail without patching the Minitest assertions methods.
  • RSpec is the GDS testing frame work of choice, so it is probably worth taking the plunge and converting to Minitest.

TO DO

Regular tests

There is a rake task that can be used to do some of the syntax conversion.

bundle exec rake convert:to_rspec\["test/components","spec/views/components"\]

Convert the following

  • test/components
  • test/controllers
  • test/integration
  • test/lib
  • test/models
  • test/models/schemas
  • test/models/topic
  • test/presenters
  • test/presenters/organisations
  • test/presenters/supergroups
  • test/services
  • test/services/search
  • test/services/supergroup_sections
  • test/unit

Once all tests requiring a specific helper have been ported over to RSpec, move the helpers from test/support ==> spec/support

  • analytics_helper
  • coronavirus_helper
  • coronavirus_landing_page_steps
  • custom_assertions
  • dit_landing_page_helper
  • gds_api_rummager_test_helpers
  • helpers
  • organisation_feed_helpers
  • organisation_helper
  • organisations_helpers
  • rummager_helpers
  • services_and_information_helpers
  • supergroups_helpers
  • taxon_helpers
  • transition_landing_page_steps

Feature tests

Convert features/step_definitions

  • browsing_topics_steps
  • curated_list_steps
  • latest_changes_steps
  • viewing_browse_steps
  • viewing_services_and_information_steps

Convert or remove files in features/support as required

Tidy up

  • remove Dir[Rails.root.join("test/support/**/*.rb")].sort.each { |f| require f } from spec_helper.
  • Remove test_helper

Brexit.cy incorrect/missing lang attributes

The Welsh language version of the Brexit page has large chunks of English language content without appropriate lang attributes which is an accessibility problem. The bits of content which are in English should be identified with lang="en" so that screenreader software reads them out properly.

Additionally, the links in the bottom section (a part of the page which actually is in Welsh) has lang="en" which means it is not read out correctly by AT (for instance on that portion of the page VoiceOver on Mac reads the character â as "a-circumflex" as can be heard in the recording below)

Screen.Recording.2021-12-14.at.17.09.19.mov

https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html

Who maintains machinery of government data and how can I contact them?

Can you please point me in the direction of the person who maintains the organisations database? Sorry if this is the wrong place for this sort of thing, I can't find anything anywhere else!

I am performing a data collection exercise across government and have been using the gov-uk-organisations API. In the course of the exercise I am coming across occasional instances of outdated / incorrect information and I would like to help fix it.

So far I've identified:

  • Directly Operated Railways Ltd no longer exists but is still showing as a live organisation.
  • Bank of England is showing as an ALB of the Treasury Solicitor’s Department, which no longer exists.
  • Assessor of Compensation for Miscarriages of Justice does not have an entry but exists according to MoJ.

Make use of the `prefers-reduced-motion` media query

I opened a similar issue on twbs/bootstrap, I'd be interested to know your thoughts.

Is there any interest in supporting the prefers-reduced-motion media query? It's currently only honoured in Safari (MacOS/iOS), but pretty much, if a user has set in their browser/system preferences they'd like reduce the amount of motion they see, we can know about.

An example implimenation would be replacing browse-columns.js:16 with something more like (thanks @robinwhittleton )

this.animateSpeed = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)") ? 0 : 330;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.