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

Tweak URL paths for new/create and refine handling of return visitors #487

Merged
merged 6 commits into from
Oct 7, 2019

Conversation

tekin
Copy link
Contributor

@tekin tekin commented Oct 7, 2019

This does a couple of things.

Firstly it reworks the URLS to be a bit friendlier to the user:

  • #new becomes /student-loans/claim instead of /student-loans/new?slug=qts-year
  • #create becomes /student-loans/claim instead of /student-loans?slug=qts-year

Secondly it adds some code to handle the scenario where a user visits #new with an already in-progress claim. This was resulting in exceptions being raised.

tekin added 6 commits October 7, 2019 15:02
This removes the need for including the :slug parameter from the URL and
also makes the URL read a bit better by using the word "claim" instead
of "new" (which also matches the URL structure that Mark came up with
when doing the work on domains and service naming)
Although the outcome at the moment is the same, using the `ClaimUpdate`
when creating a new claim couples the code in a way that could cause
issues. Instead, making this closer to a generic `create` action.
We shouldn't need to pass the slug around in the routing as we can
already determine the first slug in the sequence. Also Changes the path
from `/student-loans?slug=qts-year` to `/student-loans/claim`.
Where possible we use the page_sequence object to determine the current
slug for better encapsulation.
At the moment visiting the path for claims#new will throw a routing
exception if a claim is already in progress. To deal with this we
redirect these users to the first page in the sequence.
@tekin tekin merged commit 63a98a3 into master Oct 7, 2019
@tekin tekin deleted the refine-urls branch October 7, 2019 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants