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

Assign house_number and address_lines consistently #281

Merged
merged 9 commits into from
Oct 10, 2018

Commits on Oct 10, 2018

  1. 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.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    5b8dd42 View commit details
    Browse the repository at this point in the history
  2. 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`.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    9ba0a52 View commit details
    Browse the repository at this point in the history
  3. 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.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    e63ea78 View commit details
    Browse the repository at this point in the history
  4. Rename method to assign_house_number_and_address_lines

    This is more accurate about what it's now doing.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    ef8e43c View commit details
    Browse the repository at this point in the history
  5. Include house_number in displayable_address

    This is no longer included in `address_line_1` so we need to add it separately.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    368d179 View commit details
    Browse the repository at this point in the history
  6. 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.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    359f54a View commit details
    Browse the repository at this point in the history
  7. 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.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    54cb4f7 View commit details
    Browse the repository at this point in the history
  8. 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.
    irisfaraway committed Oct 10, 2018
    Configuration menu
    Copy the full SHA
    8df0205 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a2d74f5 View commit details
    Browse the repository at this point in the history