Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Change redirect path for renewals #279

Merged
merged 4 commits into from
Dec 12, 2019
Merged

Change redirect path for renewals #279

merged 4 commits into from
Dec 12, 2019

Conversation

Cruikshanks
Copy link
Member

We had to implement a change to how urls, and specifically any url that points to a page which handles transient registrations are formed.

DEFRA/waste-carriers-engine#579

Essentially we needed to switch to using a token rather than the registration identifier. That specific change does not affect the frontend, but as part of the same PR we also fixed an issue with validation errors, where generating one would break back links.

This turned out to just be because we were putting the ID for a 'resource' at the end of the url, rather than before the action we wanted to carry out against it. This seems to break a rails convention hence generated back links stopped working in certain cases.

That fix does impact this project, because it now needs to ensure that the path it redirects users to when renewing matches what the new front and back office apps expect.

This change covers everything needed to update the frontend to redirect users correctly.

We had to implement a change to how urls, and specifically any url that points to a page which handles transient registrations are formed.

DEFRA/waste-carriers-engine#579

Essentially we needed to switch to using a token rather than the registration identifier. That specific change does not affect the frontend, but as part of the same PR we also fixed an issue with validation errors, where generating one would break back links.

This turned out to just be because we were putting the ID for a 'resource' at the end of the url, rather than before the action we wanted to carry out against it. This seems to break a rails convention hence generated back links stopped working in certain cases.

That fix does impact this project, because it now needs to ensure that the path it redirects users to when renewing matches what the new front and back office apps expect.

This change covers everything needed to update the frontend to redirect users correctly.
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the code label Dec 11, 2019
@Cruikshanks Cruikshanks self-assigned this Dec 11, 2019
PR #278 removed the renewals holding page. We should have probably removed the check whether to show the holding page as well, but forgot we had one!
This covers all the remaining changes needed to generate the right renewal path in both production and non-production environments.
@Cruikshanks Cruikshanks marked this pull request as ready for review December 12, 2019 12:23
Copy link
Contributor

@cintamani cintamani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Cruikshanks Cruikshanks merged commit 459303d into master Dec 12, 2019
@Cruikshanks Cruikshanks deleted the update-renewal-path branch December 12, 2019 14:00
Cruikshanks added a commit that referenced this pull request Dec 13, 2019
When we made the changes in #279 we mistakenly thought the `/bo` and `/fo` paths were only needed in production, and were not to be used when running locally.

This is incorrect and they should be used in all environments.

So this removes the check for production in `base_office_url()`.
Cruikshanks added a commit that referenced this pull request Dec 13, 2019
When we made the changes in #279 we mistakenly thought the `/bo` and `/fo` paths were only needed in production, and were not to be used when running locally.

This is incorrect and they should be used in all environments.

So this removes the check for production in `base_office_url()`.
Cruikshanks added a commit that referenced this pull request Dec 13, 2019
When we made the changes in #279 we mistakenly thought the `/bo` and `/fo` paths were only needed in production and were not to be used when running locally.

This is incorrect and they should be used in all environments.

So this removes the check for production in `base_office_url()`.

It also updates the way we format the URL's to the back office to actually match was is needed.

Finally, it includes some small refactoring to make naming, behaviour, and the location of things consistent.
Cruikshanks added a commit that referenced this pull request Mar 5, 2020
The Accessibility link seems to be adding a `/fo` where one isn't needed, because it is already included in the `Rails.configuration.front_office_url` value.

We think the culprit for this regression was changes made as part of #279
Cruikshanks added a commit that referenced this pull request Mar 5, 2020
https://eaflood.atlassian.net/browse/RUBY-940

Spotted as part of regression tested that the accessibility statement returns a page not found when accessed from the frontend.

## Note

The Accessibility link was adding a `/fo` where one wasn't needed because it is already included in the `Rails.configuration.front_office_url` value.

We think the culprit for this regression was changes made as part of #279
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
housekeeping Refactoring, tidying up or other work which supports the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants