-
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
Assign house_number and address_lines consistently #281
Commits on Oct 10, 2018
-
Assign house_number and address_lines consistently
https://eaflood.atlassian.net/browse/WC-500 Addresses created in the renewals journey can display as having a duplicate house number when they are used by waste-carriers-frontend, for example: 123 123 Waste Street Wastetown AB1 2CD This is because the renewals engine assigns the values of address_lines in a different way. For consistency's sake, we should change this to match how waste-carriers-frontend does it.
Configuration menu - View commit details
-
Copy full SHA for 5b8dd42 - Browse repository at this point
Copy the full SHA 5b8dd42View commit details -
Update spec to match desired result
The first `line` should be assigned to `house_number` and all subsequent lines should be assigned to `address_lines`.
Configuration menu - View commit details
-
Copy full SHA for 9ba0a52 - Browse repository at this point
Copy the full SHA 9ba0a52View commit details -
Rewrite assign_address_lines to pass spec
Rather than trying to work out which lines we want ourselves, we just use the `lines` values from the data sent by os-places-address-lookup. We also get `house_number` from the lines instead of the `buildingNumber` value. This should give us a result which is consistent with the frontend.
Configuration menu - View commit details
-
Copy full SHA for e63ea78 - Browse repository at this point
Copy the full SHA e63ea78View commit details -
Rename method to assign_house_number_and_address_lines
This is more accurate about what it's now doing.
Configuration menu - View commit details
-
Copy full SHA for ef8e43c - Browse repository at this point
Copy the full SHA ef8e43cView commit details -
Include house_number in displayable_address
This is no longer included in `address_line_1` so we need to add it separately.
Configuration menu - View commit details
-
Copy full SHA for 368d179 - Browse repository at this point
Copy the full SHA 368d179View commit details -
Create displayable_address in ApplicationHelper
We display addresses multiple times, so it's more efficient to have a shared helper method to deal with this.
Configuration menu - View commit details
-
Copy full SHA for 359f54a - Browse repository at this point
Copy the full SHA 359f54aView commit details -
Use displayable_address from ApplicationHelper in check your answers …
…page Now that we have a shared method, we can replace the logic specific to the check your answers form object and view.
Configuration menu - View commit details
-
Copy full SHA for 54cb4f7 - Browse repository at this point
Copy the full SHA 54cb4f7View commit details -
Use displayable_address from ApplicationHelper in mailer
We can now remove the duplicated logic from the mailer and update the template to use the new method.
Configuration menu - View commit details
-
Copy full SHA for 8df0205 - Browse repository at this point
Copy the full SHA 8df0205View commit details -
Configuration menu - View commit details
-
Copy full SHA for a2d74f5 - Browse repository at this point
Copy the full SHA a2d74f5View commit details