Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove taxon-list app component from collections #3844

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Nov 12, 2024

What

  • Remove the taxon-list app component
  • Update taxon_list_helper.rb to work with the document-list component
  • Replaced taxon-list app component with either the list or document-list gem components in several view templates
  • Update tests for world location and world wide taxons to check that the "title", "link" and "description" for each search result/tagged content is included on the page

Why

  • The taxon-list component is no longer required, it was originally created for an AB Test on https://www.gov.uk/education/funding-and-finance-for-students#/education/student-grants-bursaries-scholarships. This page is now using the document-list component from the govuk_publishing_components gem
  • The taxon-list component also wraps each link in a heading element, we checked with an accessibility specialist to get advice on removing the heading element and agreed that this change looks like a better option. For example, on pages such as /world/afghanistan this would result in 50+ headings on the page which is likely too many. It also adds an additional layer in the accessibility tree which is likely more time consuming to navigate

Visual changes

Spacing is increased slightly for list items when using the document-list component

https://collections-pr-3844.herokuapp.com/world/afghanistan (accordion.html.erb)

Before After
Screenshot 2024-11-26 at 15 21 02 Screenshot 2024-11-26 at 15 21 10

https://collections-pr-3844.herokuapp.com/world/living-in-afghanistan (tagged_content_list.html.erb)

Before After
accordion-before accordion-after

https://collections-pr-3844.herokuapp.com/government/ministers/secretary-of-state-for-foreign-commonwealth-and-development-affairs (past_role_holders.html.erb) - No visual changes

Trello card

@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 November 12, 2024 15:01 Inactive
@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 November 13, 2024 16:57 Inactive
@MartinJJones MartinJJones force-pushed the remove-taxon-list-component branch from 2f2209b to b2059e5 Compare November 18, 2024 09:40
@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 November 18, 2024 09:40 Inactive
@MartinJJones MartinJJones force-pushed the remove-taxon-list-component branch 6 times, most recently from de8930b to 35057dc Compare November 27, 2024 10:42
@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 November 27, 2024 11:39 Inactive
@MartinJJones MartinJJones force-pushed the remove-taxon-list-component branch from 35057dc to 9832a2a Compare November 27, 2024 14:11
@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 November 27, 2024 14:11 Inactive
@MartinJJones MartinJJones changed the title Remove taxon-list component Remove taxon-list app component from collections Nov 27, 2024
Remove all files relating to the taxon-list component the taxon-list component as it is no longer required.

The component was originally created for an AB Test on https://www.gov.uk/education/funding-and-finance-for-students#/education/student-grants-bursaries-scholarships

This page is now using the document-list component from the govuk_publishing_components gem
Update data structure returned from `taxon_list_params` method

Updated the structure to work with the document-list gem component, setting `full_size_description: true` ensures the font-size is set to 19px for the description when present - https://components.publishing.service.gov.uk/component-guide/document_list/with_full_size_description_text
- Use the `document-list` component from the gem instead of the `taxon-list` app component in the `tagged_content_list.html.erb` and `accordion.html.erb` view templates
- By using the document-list component, the list will change from an ordered list to an unordered list, this feels like a slight improvement as the content presented does not appear to be in order of sequence/importance
- `heading_level` variable removed from the `tagged_content_list.html.erb` template, the document-list component does not support headings and is not required here

This approach is also consistent with other places the document-list component is used, for example:

- [Education, training and skills - GOV.UK](https://www.gov.uk/education)  (collections)
- [Find contact details for services - GOV.UK](https://www.gov.uk/contact)  (feedback)
- [Travel or do business in Europe: Brexit guidance](https://www.gov.uk/government/collections/brexit-guidance) (government-frontend)
- set `disable_ga4: true` to disable GA4 tracking
  - in the accordion.html.erb this prevents duplicate events from firing as this is already built into the accordion component
  - GA4 was not enabled previously in the tagged_content_list.html.erb
Replace the `taxon-list` component with the `list` component from the govuk_publishing_components gem.

`list_type: "number"` has been used to ensure an ordered list is used to match the current HTML structure
Updated the tests to check that the "title", "link" and "description" for each search result/tagged content is included on the page
@MartinJJones MartinJJones force-pushed the remove-taxon-list-component branch from fe70206 to 7aa60ee Compare December 4, 2024 15:51
@MartinJJones MartinJJones reopened this Dec 4, 2024
@govuk-ci govuk-ci temporarily deployed to collections-pr-3844 December 4, 2024 16:09 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants