-
Notifications
You must be signed in to change notification settings - Fork 17
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 #3055
Conversation
8f692f4
to
66565e1
Compare
66565e1
to
494dc83
Compare
In #3055, we added support for edition links associated with worldwide organisations. This change included backward compatibility for worldwide organisations without edition links. Once the worldwide organisations have all been republished without non-edition links, we no longer need the backward compatibility here. This also simplifies the code slightly, as the content item now only contains roles that are relevant to the worldwide organisation, rather than needing to filter them on the frontend.
We are switching worldwide organisations to use edition links which do not support multi-level link expanstion. Therefore we need to switch the rendering code to use the new link fields that have been added, in the absence of multi-level links. This change adds support for edition links, but also retains compatibility with non-edition links. This will allow us to deploy the frontend changes in advance of republishing the content items, preventing any downtime of these pages. The code for backward compatibility will be removed once the content items have all been republished with edition links.
We are switching worldwide organisations to use edition links which do not support multi-level link expanstion. Therefore we need to switch the rendering code to use the new link fields that have been added, in the absence of multi-level links. This change adds support for edition links, but also retains compatibility with non-edition links. This will allow us to deploy the frontend changes in advance of republishing the content items, preventing any downtime of these pages. The code for backward compatibility will be removed once the content items have all been republished with edition links.
494dc83
to
ef6aa6a
Compare
In #3055, we added support for edition links associated with worldwide organisations. This change included backward compatibility for worldwide organisations without edition links. Once the worldwide organisations have all been republished without non-edition links, we no longer need the backward compatibility here. This also simplifies the code slightly, as the content item now only contains roles that are relevant to the worldwide organisation, rather than needing to filter them on the frontend.
In #3055, we added support for edition links associated with worldwide organisations. This change included backward compatibility for worldwide organisations without edition links. Once the worldwide organisations have all been republished without non-edition links, we no longer need the backward compatibility here. This also simplifies the code slightly, as the content item now only contains roles that are relevant to the worldwide organisation, rather than needing to filter them on the frontend.
In #3055, we added support for edition links associated with worldwide organisations. This change included backward compatibility for worldwide organisations without edition links. Once the worldwide organisations have all been republished without non-edition links, we no longer need the backward compatibility here. This also simplifies the code slightly, as the content item now only contains roles that are relevant to the worldwide organisation, rather than needing to filter them on the frontend.
In #3055, we added support for edition links associated with worldwide organisations. This change included backward compatibility for worldwide organisations without edition links. Once the worldwide organisations have all been republished without non-edition links, we no longer need the backward compatibility here. This also simplifies the code slightly, as the content item now only contains roles that are relevant to the worldwide organisation, rather than needing to filter them on the frontend.
office_contact_association["office_content_id"] == office_content_id | ||
}.first | ||
|
||
return unless contact_mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that we don't perform this check in roles_for_person
. Could you possibly link me to the schema change in your publishing API PR that determines this difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to have an office without a contact, whereas all the people will have a role (as we're only including those people in the content item).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice that makes sense, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks Bruce!
In alphagov/whitehall#8734 and alphagov/publishing-api#2601, we have switched worldwide organisations to use edition links to fix a bug in editionable worldwide organisations.
This applies the changes needed to the frontend to reflect the lack of multi-level link expansion in edition links.
Whilst this change adds support for edition links, it also retains compatibility with non-edition links. This will allow us to deploy the frontend changes in advance of republishing the content items, preventing any downtime of these pages. The code for backward compatibility will be removed once the content items have all been republished with edition links (all the code to be removed has been marked with a comment so it is easy to identify).
Trello card
Follow these steps if you are doing a Rails upgrade.