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

Use breadcrumbs based on organisation, if no parent linked #4270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

unoduetre
Copy link
Contributor

@unoduetre unoduetre commented Sep 26, 2024

What

The Content Types Discovery team's audit uncovered that corporate_information pages lack a breadcrumb that connects back to the organisation.

Currently corporate information pages without the linked parent use taxon based breadcrumbs. An example would be the following page: https://www.gov.uk/government/organisations/government-actuarys-department/about

This PR fixes that, and if there is no parent linked, it uses the first linked organisation to generate breadcrumbs.

The logic is the following:

  1. if parent is linked to, use it to generate breadcrumbs;
  2. otherwise, if organisations are linked to, use the first one to generate breadcrumbs;
  3. otherwise, if taxons are linked to, use them to generate breadcrumbs;
  4. otherwise use the default breadcrumbs linking to homepage.

Why

So that users can navigate back to the organisation to which this corporate information relates.

Trello ticket

Testing

https://government-frontend-pr-3347.herokuapp.com/government/organisations/government-actuarys-department/about
https://government-frontend-pr-3347.herokuapp.com/government/organisations/department-for-business-energy-and-industrial-strategy/about/personal-information-charter
https://government-frontend-pr-3347.herokuapp.com/government/organisations/standards-and-testing-agency/about
https://government-frontend-pr-3347.herokuapp.com/government/organisations/hm-courts-and-tribunals-service/about

Visual Changes

Before

Screenshot 2024-09-26 at 15-48-50 About us - Government Actuary's Department - GOV UK

After

Screenshot 2024-09-26 at 15-49-17 About us - Government Actuary's Department - GOV UK

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 26, 2024 14:50 Inactive
@unoduetre unoduetre changed the title Use breadcrumbs based on organisation if no parent linked Use breadcrumbs based on organisation, if no parent linked Sep 26, 2024
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 6aa30f8 to 3cd9e50 Compare September 26, 2024 14:53
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 3cd9e50 to 16bbf0e Compare September 26, 2024 14:57
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 26, 2024 14:57 Inactive
@unoduetre unoduetre marked this pull request as ready for review September 26, 2024 15:42
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 16bbf0e to 3abaf50 Compare September 27, 2024 08:19
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 08:19 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 3abaf50 to 69a27bc Compare September 27, 2024 08:49
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 08:49 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 69a27bc to 4dd674a Compare September 27, 2024 08:51
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 08:51 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 4dd674a to 7ecba90 Compare September 27, 2024 09:07
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 09:08 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 7ecba90 to bfc68be Compare September 27, 2024 09:47
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 09:47 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from bfc68be to f3a86f0 Compare September 27, 2024 10:07
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 10:08 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from f3a86f0 to cc89f22 Compare September 27, 2024 12:51
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 September 27, 2024 12:51 Inactive
Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had a quick look and have one thought on the updated breadcrumbs, using the page below as an example:

www.gov.uk/government/organisations/government-actuarys-department/about

The breadcrumbs are updated from Home > Government to Home > Government Actuary's Department which definitely feels like a nice a improvement.

It does appear that this page also has a grandparent, "Departments, agencies and public bodies", I think we should check with a content designer if this should also be included in the breadcrumbs as well, for example:

Home > Departments, agencies and public bodies > Government Actuary's Department

@unoduetre
Copy link
Contributor Author

unoduetre commented Sep 27, 2024

I've had a quick look and have one thought on the updated breadcrumbs, using the page below as an example:

www.gov.uk/government/organisations/government-actuarys-department/about

The breadcrumbs are updated from Home > Government to Home > Government Actuary's Department which definitely feels like a nice a improvement.

It does appear that this page also has a grandparent, "Departments, agencies and public bodies", I think we should check with a content designer if this should also be included in the breadcrumbs as well, for example:

Home > Departments, agencies and public bodies > Government Actuary's Department

Unfortunately, I can't find the information about the higher levels in the content item, so getting this information would require either adding things to the content item (probably with the publishing team's help) or doing a separate call to the api to retrieve that, which seems like an overkill. If we want/can modify the content item in the first place, we can add a parent link instead. This would resolve the issue, as the logic prioritises parent links. Also some examples of corporate information pages in publishing-api have parent links, so there shouldn't be a problem with adding it. So maybe we can ask the publishing team to add the parent link and in the meantime we can use this solution?

@unoduetre
Copy link
Contributor Author

unoduetre commented Sep 27, 2024

Or maybe we could use something like Home > Organisations > Government Actuary's Department
as in the Government Actuary's Department's page the breadcrumbs are Home > Organisations?

@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from cc89f22 to 2768e72 Compare October 15, 2024 09:48
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 October 15, 2024 09:48 Inactive
@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from 2768e72 to cd7167a Compare October 15, 2024 14:37
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 October 15, 2024 14:38 Inactive
@unoduetre
Copy link
Contributor Author

Or maybe we could use something like Home > Organisations > Government Actuary's Department as in the Government Actuary's Department's page the breadcrumbs are Home > Organisations?

This change has now been applied.

Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me from a frontend perspective

@hannako please can you help review the backend changes

@unoduetre unoduetre force-pushed the 2832-fix-corporate-information-pages-should-have-a-parent-of-an-org-page-l branch from cd7167a to bc57a30 Compare October 23, 2024 13:32
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4270 October 23, 2024 13:32 Inactive
Use breadcrumbs based on ancestors, if the document has a linked parent.
Otherwise use breadcrumbs based on the first normal
(non-world) organisation the page is linked to.
If there are no linked organisations use taxon based breadcrumbs,
or if taxons are also not linked to,
the default breadcrumbs pointing to the homepage.
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.

3 participants