Skip to content
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

Merged
merged 7 commits into from
Apr 10, 2018

Conversation

irisfaraway
Copy link
Member

@irisfaraway irisfaraway commented Apr 9, 2018

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).

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.
@irisfaraway irisfaraway self-assigned this Apr 9, 2018
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.
irisfaraway added a commit that referenced this pull request Apr 9, 2018
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
Copy link
Member

@Cruikshanks Cruikshanks left a 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. 🦄 🎈

@irisfaraway
Copy link
Member Author

Cheers @Cruikshanks. It's weirdly satisfying to implement too!

@irisfaraway irisfaraway merged commit 396ff6c into master Apr 10, 2018
@irisfaraway irisfaraway deleted the feature/contact-postcode branch April 10, 2018 07:39
irisfaraway added a commit that referenced this pull request Apr 10, 2018
* 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.
@irisfaraway irisfaraway added the enhancement New feature or request label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants