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 non-editionable worldwide organisation code #9216

Merged
merged 51 commits into from
Jul 18, 2024
Merged

Conversation

brucebolt
Copy link
Member

@brucebolt brucebolt commented Jul 2, 2024

We have replaced the WorldwideOrganisation model with EditionableWorldwideOrganisation and have migrated the data to the new version. Therefore deleting all the code associated with the non-editionable version.

Later PRs will remove the database tables/columns associated with these and rename EditionableWorldwideOrganisation to WorldwideOrganisation.

Trello card

@brucebolt brucebolt force-pushed the remove-non-ed-ww-org branch 25 times, most recently from f37f232 to c9fc3cd Compare July 8, 2024 15:54
@brucebolt brucebolt changed the title Remove non-editionable worldwide organisations Remove non-editionable worldwide organisation code Jul 8, 2024
@brucebolt brucebolt force-pushed the remove-non-ed-ww-org branch 3 times, most recently from 0e6c5aa to 42accd7 Compare July 9, 2024 08:23
@brucebolt brucebolt marked this pull request as ready for review July 9, 2024 08:30
`WorldwideOrganisation` has been removed, so we no longer need to
display their history or audit trail.

In `EditionableWorldwideOrganisation`, we use the standard `Edition`
workflow to show history.
Worldwide Organisations now use the `WorldwideOrganisationPage` model,
so we can uncouple them from `CorporateInformationPage`.

This leaves `CorporateInformationPage` being solely for use with
`Organisation`.
Now worldwide organisations are no longer associated with
`CorporateInformationPage`, the complexity around `owning_organisation`
has been removed.

The method is now only an alias for `organisation`, so we can remove the
method completely and replace all uses with `organisation`.
Corporate Information Pages can now only be associated with
organisations, so we no longer need to separate them out into something
reusable.
We have removed `WorldwideOrganisation`, so can delete the code to deal
with their translations.
We no longer need to associate editions with worldwide organisations,
as they don't exist.

Other mechanisms exist for associating editionable worldwide
organisations with editions.
We no longer need to associate roles with worldwide organisations, as
they don't exist.

Other mechanisms exist for associating editionable worldwide
organisations with roles.
We no longer need to associate world locations with worldwide
organisations, as they don't exist.

Other mechanisms exist for associating editionable worldwide
organisations with world locations.
This was used to link `Organisation` to `WorldwideOrganisation`.

Since we have deleted the latter, the link can also be deleted.
This is no longer being used, so we can delete the model, controller and
views, plus the associated tests and helpers.

Where the `worldwide_organisation` test factory has been used, this has
been replaced with `editionable_worldwide_organisation`, but only where
the test remains relevant.
This method is now only being used in one place, so the presence in a
helper is no longer required.
In order to see the political checkbox, you need to be logged in as a
user.

Therefore adding this to the test setup.
This should be singular, instead of plural.
This variable should be named `organisation`, not `news_article`.
These are Worldwide Organisations, not World Organisations, so adjusting
the variable name to be consistent throughout the application.
As all code for `WorldwideOrganisation` has been removed, the remaining
feature flags can now also be deleted.
The feature flag rules (incorrectly) overrode the usual edition workflow
rules. When the feature flag was removed, we started enforcing the
correct rules for unpublishing and withdrawing editionable worldwide
organisations.

Therefore updating the tests to reflect the permissions required.
In #7346, we introduced
specific error handling for a known problem with Worldwide
Organisations.

These have been removed, so the error handling can also be removed.
`sponsored_worldwide_organisations` is only used in tests, so removing
the code.
These were used to administer the non-editionable worldwide
organisations, but are no longer needed.
The `new_base_path` method is not being used, so can be deleted.
The embassies index page currently includes all worldwide organisations
(including drafts), whereas we only want those that have been published
to appear on this page.
This is an alias for `organisations` on the
`EditionableWorldwideOrganisation` model, so we can simply replace it
with `organisations`.
Copy link
Contributor

@JonathanHallam JonathanHallam left a comment

Choose a reason for hiding this comment

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

This is great, brilliant removal. If i'm being super picky i think a couple of the later commits could be broken out, namely the typos, permissions fixes and login as user before running tests, but I think that's small enough that I'm not worries.

@brucebolt brucebolt merged commit 8fccf83 into main Jul 18, 2024
19 checks passed
@brucebolt brucebolt deleted the remove-non-ed-ww-org branch July 18, 2024 09:18
@JonathanHallam JonathanHallam mentioned this pull request Jul 19, 2024
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.

4 participants