AMCR-259 - Add "reason" and "confirm" cancellation screens & store cancelled state#45
Open
timabell wants to merge 10 commits into
Open
AMCR-259 - Add "reason" and "confirm" cancellation screens & store cancelled state#45timabell wants to merge 10 commits into
timabell wants to merge 10 commits into
Conversation
Replace the single-step cancel action with a reason page and a confirmation page, and record the cancellation through the waste-obligations API. New flow is: 1. GET /cancel/reason # display reason page 2. POST /cancel/reason # submit and validate selected reason 3. GET /cancel/check # redirects to viewing check page 4. POST /cancel # perform the actual cancellation The selected reason is carried statelessly between the two steps — in the confirmation URL (?reason=) and a hidden form field to follow REST and ensure reliable behaviour when multiple browser tabs in use. Remove `inline` style that was used to align button & link as they are now both links. Based on prototype at https://github.com/defra-design/regulator-responsibility-prototype/blob/3839b9d2a40168799ee4b9fe93019a1d7e9e80d1/app/views/v3/certificates-of-compliance/main/cancel-certificate.njk - https://eaflood.atlassian.net/browse/AMCR-259 - https://eaflood.atlassian.net/browse/AMCR-263 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
To make it clear during testing that that is not expected to work yet and will be done in a follow-up ticket. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
timabell
force-pushed
the
AMCR-259-add-cancel-steps
branch
from
July 17, 2026 12:01
adaf307 to
8591a79
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"compliance-schemes" and "Unknown organisation" each appeared 3+ times; replace the uses with COMPLIANCE_SCHEMES / UNKNOWN_ORGANISATION constants. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collapse the three near-identical showObligations tests into one test.each. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use the existing shared statusCodes constant rather than a bare literal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
timabell
force-pushed
the
AMCR-259-add-cancel-steps
branch
from
July 17, 2026 12:15
8591a79 to
6568e1b
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The declaration-not-found fallback reused the name of the no-id branch's variable; rename it fallbackObligationData. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The function was 89 lines; extract the useMockApi branch into getMockDeclarationDetail so both stay under the 75-line limit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
more sonarqube whackamole pushed |
SonarQube thinks this is an actual todo.
|
Contributor
Author
|
All sonarqube issues on this pr's diff addressed. ✔️ It seems to be still showing "issues" on lines that were not touched by this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Add reason & cancellation pages to cancel certificate flow
New flow is:
GET /cancel/reason- display reason pagePOST /cancel/reason- submit and validate selected reasonGET /cancel/check- redirects to viewing check pagePOST /cancel- perform the actual cancellationImplemented tickets
Screenshots