Skip to content

feature/DF-511: Postcode lookup#216

Merged
davidjamesstone merged 101 commits intomainfrom
feature/DF-511-postcode-lookup
Oct 20, 2025
Merged

feature/DF-511: Postcode lookup#216
davidjamesstone merged 101 commits intomainfrom
feature/DF-511-postcode-lookup

Conversation

@davidjamesstone
Copy link
Copy Markdown
Contributor

@davidjamesstone davidjamesstone commented Oct 8, 2025

WIP - Do not review

Proposed change

Add postcode lookup for UK addresses with framework support for components where the input is external to the form journey. Other example use-cases:

  • Maps
  • GOV.UK Pay

Jira ticket: DF-511

Process

  • External component is built and pushed into the codebase. External components are standard components that expose a dispatch() method and will usually have a consistent formSchema and stateSchema.
  • An external component is added to a form. Component is rendered as normal from its component class and associated view. The external component displays a secondary button prompting the user to take the mini journey. This button is a submit button.
  • User completes the mini journey
  • The external component sets yar.flash('externalStateAppendage', data) where data is an object containing { component: 'name-of-component', data: { ... } }.
  • When preparing the form context, the engine checks for the presence of externalStateAppendage in session state The content is validated against the component's isState method. If successful, it is merged into the main form state.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

@davidjamesstone
Copy link
Copy Markdown
Contributor Author

also some uncovered code that should probably be covered:

src/server/plugins/engine/pageControllers/QuestionPageController.ts line 374 src/server/plugins/engine/components/UkAddressField.ts line 188 - maybe?

Not sure those line numbers are correct as the don't align with code that has changed in this PR - could you provide links instead and I'll take a look. Thanks.

@davidjamesstone davidjamesstone marked this pull request as ready for review October 16, 2025 14:11
@whitewaterdesign
Copy link
Copy Markdown
Contributor

also some uncovered code that should probably be covered:
src/server/plugins/engine/pageControllers/QuestionPageController.ts line 374 src/server/plugins/engine/components/UkAddressField.ts line 188 - maybe?

Not sure those line numbers are correct as the don't align with code that has changed in this PR - could you provide links instead and I'll take a look. Thanks.

Yeah, seems they are from previous code

Comment thread src/client/stylesheets/application.scss Outdated
Comment thread src/server/plugins/postcode-lookup/service.js
Comment thread src/server/plugins/postcode-lookup/service.js
@sonarqubecloud
Copy link
Copy Markdown

@davidjamesstone davidjamesstone merged commit 2bee6db into main Oct 20, 2025
9 checks passed
@davidjamesstone davidjamesstone deleted the feature/DF-511-postcode-lookup branch October 20, 2025 12:13
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