-
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
The first `line` should be assigned to `house_number` and all subsequent lines should be assigned to `address_lines`.
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.
This is more accurate about what it's now doing.
This is no longer included in `address_line_1` so we need to add it separately.
We display addresses multiple times, so it's more efficient to have a shared helper method to deal with this.
…page Now that we have a shared method, we can replace the logic specific to the check your answers form object and view.
We can now remove the duplicated logic from the mailer and update the template to use the new method.
There'll be some small changes to waste-carriers-back-office once this is merged in as we can reuse the new |
irisfaraway
added a commit
to DEFRA/waste-carriers-back-office
that referenced
this pull request
Oct 10, 2018
The `address_lines` method is another example of duplication which can now be replaced by the method added in DEFRA/waste-carriers-engine#281
irisfaraway
added a commit
to DEFRA/waste-carriers-back-office
that referenced
this pull request
Oct 10, 2018
The `address_lines` method is another example of duplication which can now be replaced by the method added in DEFRA/waste-carriers-engine#281
Cruikshanks
approved these changes
Oct 10, 2018
irisfaraway
added a commit
to DEFRA/waste-carriers-back-office
that referenced
this pull request
Oct 11, 2018
The `address_lines` method is another example of duplication which can now be replaced by the method added in DEFRA/waste-carriers-engine#281
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.