-
Notifications
You must be signed in to change notification settings - Fork 2
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
Search for a contact address by UK postcode #117
Conversation
https://eaflood.atlassian.net/browse/WC-112 "What's the address of the person we should contact?" Add forms to allow UK-based users to enter a postcode so they can search for a contact address. Selection and saving of the contact address will be added in a separate PR to keep things manageable. This should function the same way as the registered address forms earlier in the process. Non-UK users or users who choose to enter their addresses manually will see a separate form (to be worked on as a separate feature).
Currently this is just a copy of the registered address postcode form with names swapped around (and some tweaks to the postcode validator to deal with the two different postcode fields). References to the manual contact address page have been commented out until that page is created. Next step is to refactor to remove masses of duplication.
This is the attribute used for looking up registered addresses. Now that we have two temporary postcodes, I've renamed this to be a bit clearer.
Make it less specific to certain attributes, and also reduce complexity of the validate method.
Currently this is a copy of the registered address manual forms, but renamed as appropriate. References to the contact postcode form are commented out until we merge #117
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mild panic when I saw the number of pages, but can see a lot of it is just caused by renaming temp_postcode
to temp_company_postcode
.
I also am loving the reuse through inheritance (both here and with key people). In these cases it makes sense and helps link to elements together. 🦄 🎈
Cheers @Cruikshanks. It's weirdly satisfying to implement too! |
* Enter contact address manually https://eaflood.atlassian.net/browse/WC-113 Overseas users, or users who can't use the postcode lookup for whatever reason, should have the opportunity to enter their address manually. This should behave the same way as the manual address entry form for the registered address. * Set up contact_address_manual form Currently this is a copy of the registered address manual forms, but renamed as appropriate. References to the contact postcode form are commented out until we merge #117 * Manual address forms now inherit from ManualAddressForm Create a subclass of BaseForm which CompanyAddressManualForm and ContactAddressManualForm inherit from, to reduce dupliation as both forms are very similar. (Turns out there was a lot of duplication!) * Move fields for manual address entry into shared view partial * Allow users to skip from contact postcode to manual address form If OS Places doesn't have any results for the postcode search, include a link to let users enter the address themselves.
https://eaflood.atlassian.net/browse/WC-112
"What's the address of the person we should contact?" Add forms to allow UK-based users to enter a postcode so they can search for a contact address. Selection and saving of the contact address will be added in a separate PR to keep things manageable.
This should function the same way as the registered address forms earlier in the process.
Non-UK users or users who choose to enter their addresses manually will see a separate form (to be worked on as a separate feature).