Prevent infinite loop for ineligible application #2276
Merged
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.
This prevents an infinite loop when
building the task listgenerating the task statuses for a task list for an application that has the ESAP AP type selected but no agreement with CHPP. The loop was the result of the ineligibility page returning the user to the AP type selection page on submission. This works if the user then saves a different AP type straight away; however, should the user then exit the application, any further attempt to load the application would result in the loop.To prevent this, the ESAP ineligibility page no longer posts, but simply offers a link to the AP Type selection.
In addition, to ensure the AP Type task is shown as 'In progress' in the above scenario, the ESAP ineligibility page always returns an error. This error is never shown, but prevents the loop from continuing with processing any further task when building the task list for the draft application.
Context
https://dsdmoj.atlassian.net/browse/APS-1778
Changes in this PR
The page that offers to continue with a Standard AP (or to choose another type of AP altogether) now uses a button as link to take the user to the AP type page. The 'Back to dashboard' link next to this button is also now fixed, as it was showing as
undefined
(and with a broken URL) due to an incorrect path.Screenshots of UI changes
Before
(Broken URL shown below)
After