Skip to content

feature/DF-1206 reuse answers - #1343

Merged
davidjamesstone merged 33 commits into
mainfrom
feature/DF-1206-reuse-answers-copy-action
Nov 9, 2026
Merged

davidjamesstone merged 33 commits into
mainfrom
feature/DF-1206-reuse-answers-copy-action

Conversation

@davidjamesstone

@davidjamesstone davidjamesstone commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

https://eaflood.atlassian.net/browse/DF-1206

Copy previous submission.

  • Adds a new link "Copy" link to the "homepage" against submission records
  • Adds the 3 pages below. Only the first one is displayed if the form hasn't changed since the original submission and there are no declaration components
  • Once guided through these interstitial pages, the user is dispatched in to the form journey with their previous answers copied
  • Previously uploaded files are not copied
  • if the form has not changed and has no declaration components the user is dispatched to the CYA page
  • otherwise they are routed to the start page and will need to walk through the form again
  • when a form is copied, a new reference number is generated
  • when a copied form is submitted, custom metadata is included as submissionPayload.meta.custom = { action: 'copy', actionReferenceNumber: 'previous reference number' }

Copy form: Interstitial page 1 (displayed for all)
Screenshot from 2026-11-09 12-24-50

Copy form: Interstitial page 2 (only displayed if the form definition version has changed or there are declaration components)
Screenshot from 2026-11-09 12-25-17

Copy form: Interstitial page 3 (only displayed if the form definition version has changed or there are declaration components)
Screenshot from 2026-11-09 12-25-40

@davidjamesstone
davidjamesstone force-pushed the feature/DF-1206-reuse-answers-copy-action branch from af11f25 to 1c86cd2 Compare November 3, 2026 12:36
@davidjamesstone
davidjamesstone marked this pull request as ready for review November 9, 2026 13:06
Comment thread src/server/routes/copy-form.js Resolved
Comment thread src/server/routes/copy-form.js Resolved
Comment thread src/server/routes/copy-form.js Resolved
Comment thread src/server/routes/copy-form.js Resolved
)
}

const formVersionHasChanged =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we happy that a change of version number is sufficient a check to say there are changes in the form? What if it was published at say version 100, then changed and published again at version 101, then the draft revert back to equivalent of v 100, then published as v102? i.e. no difference in definition between v100 and v102 yet this method would report things had changed.
Very edge case though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's the guidance/AC. Might be worth raising when we go through it tomorrow with the team.

Comment thread src/server/routes/copy-form.js Resolved
Comment thread src/server/routes/homepage.js Resolved
Comment thread src/server/services/outputService.ts Resolved
Comment thread src/server/services/outputService.ts Resolved
* it's a sentence break.
* @param {unknown} str - Gracefully handles null, undefined and non-string values.
*/
export function escapeFileLabel(str) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this used anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved with cd91385

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@jbarnsley10 jbarnsley10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent

@davidjamesstone
davidjamesstone merged commit e36ff93 into main Nov 9, 2026
16 checks passed
@davidjamesstone
davidjamesstone deleted the feature/DF-1206-reuse-answers-copy-action branch November 9, 2026 15:32
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