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 edition links for worldwide organisations #8734

Merged
merged 5 commits into from
Jan 30, 2024
Merged

Conversation

brucebolt
Copy link
Member

@brucebolt brucebolt commented Jan 15, 2024

We are working to make Worldwide Organisation editionable.

Therefore we need to be able to link the links to editions, rather than documents, to prevent draft updates becoming live before publication.

There are multiple steps to deploying the switch to edition links:

  1. merge Use edition links for Worldwide Organisations government-frontend#3055
  2. merge Allow edition links for worldwide organisations publishing-api#2601
  3. merge this PR
  4. republish all existing non-editionable worldwide organisations (this will introduce the edition links into the content items, and remove all the non-edtion links)
  5. merge Remove code for rendering non-edition links for worldwide organisations government-frontend#3057
  6. merge Remove non-edition worldwide organisation links #8778
  7. merge Remove non-edition worldwide organisation links publishing-api#2616

Depends on alphagov/publishing-api#2601.

Trello card

@brucebolt brucebolt force-pushed the add-wworg-edition-links branch from 94b7149 to 5068755 Compare January 15, 2024 10:15
@brucebolt brucebolt force-pushed the add-wworg-edition-links branch 7 times, most recently from 7913e3a to 8adb462 Compare January 22, 2024 10:12
@brucebolt brucebolt changed the title Use edition links for editionable worldwide organisations Use edition links for worldwide organisations Jan 22, 2024
@brucebolt brucebolt force-pushed the add-wworg-edition-links branch 6 times, most recently from 081be05 to 5d7166c Compare January 22, 2024 13:15
@brucebolt brucebolt force-pushed the add-wworg-edition-links branch from 5d7166c to 2feb562 Compare January 22, 2024 14:10
@brucebolt brucebolt marked this pull request as ready for review January 22, 2024 14:15
We are working to make Worldwide Organisation editionable.

Therefore we need to be able to link the links to editions, rather than
documents, to prevent draft updates becoming live before publication.

Depends on alphagov/publishing-api#2601.
We are now using edition links for editionable worldwide organisations.
This makes the same change for non-editionable worldwide organisations.

There will be no user impact as a result of this change, but it will
allow us to compare the output of the two presenters to make sure they
are identical when migrating data from the non-editionable worldwide
organisation to be editionable.

The existing links must be set as an empty array to clear them (as an
nil value does not unset the existing values). Another PR will be raised
to remove the non-edition links from the presenter once all worldwide
organisations have been republished.

Depends on alphagov/publishing-api#2601.
We are currently including all corporate information pages (including
draft and withdrawn) in worldwide organisation content items.

This is incorrect as we only want to include those that are actually
published.
As edition links do not support multi-level or recursive link expansion,
we need to explicitly include all the sub-links that we require to
render this page.

Whilst most of this code is the same as used in the Worldwide
Organisation presenter, it has not been DRY-ed up as that will make it
more difficult to delete the non-editionable version of the presenter
when we've fully migrated Worldwide Organisations to be editionable.
As edition links do not support multi-level or recursive link expansion,
we need to explicitly include all the sub-links that we require to
render this page.
@brucebolt brucebolt force-pushed the add-wworg-edition-links branch from 2feb562 to 35e5891 Compare January 30, 2024 10:59
@brucebolt brucebolt merged commit d23404f into main Jan 30, 2024
20 checks passed
@brucebolt brucebolt deleted the add-wworg-edition-links branch January 30, 2024 15:57
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