Skip to content

Comments

Add archive Welsh live form only#2564

Open
thomasiles wants to merge 7 commits intomainfrom
archive-welsh
Open

Add archive Welsh live form only#2564
thomasiles wants to merge 7 commits intomainfrom
archive-welsh

Conversation

@thomasiles
Copy link
Contributor

@thomasiles thomasiles commented Feb 19, 2026

Allow users to archive only the Welsh from a live form, leaving the English form live

Trello card: https://trello.com/c/IEoXqij5/2810-make-it-possible-to-archive-the-welsh-version-of-a-form

This PR adds a new button to the live form page for forms with Welsh. The button allows a user to 'archive' the Welsh part of a form, leaving only the English one live.

We archive a the Welsh form by removing 'cy' from the available languages and marking welsh_complete as false. This lets the user make changes to the English form live and leaves the Welsh text alone. If the user wants to make the Welsh live again, they will need to submit the welsh translation page and make the form live again.

image

The wording on the content was tweaked because it's not possible to view the Welsh in preview. It needs to be reviewed by a content designer:

image

This is new content which should also be reviewed by a content designer.
image

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Add a new association to Form to link live Welsh FormDocuments.
Add a new method to the form document sync service to archive only the
Welsh part of a form.

To archive the Welsh part of a form, we need to:
 - remove any pre-existing archived document Welsh form
 - change the live Welsh form to archived
 - update the content of the english versions live and draft to show that it doesn't support
   welsh anymore
- set Welsh completed to false on the form

We don't remove the Welsh translation from the Mobility tables so the
User still has a chance to edit it and make it live again.
The archive service is already responsible for archiving the live form document.

We add a new method to archive the welsh form document.

To archive an English form we use the state machine and callbacks to
ensure the state of the form is consistent. But to archive only the
Welsh part of a form we call the FormDocumentSyncService directly.

This is because archiving a Welsh form doesn't change the state of a
form. We can't use the state machine because we aren't changing the
state of a form.
Add a new view to let users confirm they want to archive the welsh
version of a form.

This closely follows the process for archiving a form and we could have
reused the code.

The content and controller will be different though so it doesn't seem
worth the extra complexity to do so.
Add a new controller which will handle archiving the Welsh version of a
form.

Add routes for archiving welsh
@thomasiles thomasiles marked this pull request as ready for review February 19, 2026 15:42
Add a button to archive the Welsh version of a form.

The button should only be visible if the form has a live, Welsh translation.
@sonarqubecloud
Copy link

@github-actions
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2564.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

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.

1 participant