-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This form doesn't perform any validations and save isn't called on the form so we have an empty form object, however this form object is still required. The check your answers page is submitted to the claim submission controller, which does perform validations, and if the validation fails the check your answers rerenders with the claim submission form. Rather than mapping "check-your-answers" to the `ClaimSubmissionForm` we instead use the "empty" `CheckYourAnswersForm` so we can avoid changing the api of the `ClaimSubmissionForm` just to make it compatable with the `Form` base class, ie the `ClaimSubmissionForm` doesn't need any of the parameters passed to `Form` subclasses in `Journeys::Base` module, it just needs an instance of `Journeys::Session`. Also of note we've had to introduce a conditional in the BaseAnswersPresenter as we need this to work with both a `CurrentClaim` and a `Claim`. When dealing with a `CurrentClaim` (`check-your-answers` rendered from the `ClaimController#show`) we can't always assume the eligibility is eligible. We also rander the `check-your-answers` page from the `SubmissionController#create` action if the form is invalid, in which case we'll be working with a `Claim`. We want to avoid adding `eligible_eligibility` to the `Claim`. Once we've removed `CurrentClaim` we can remove this conditional.
- Loading branch information
Showing
6 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class CheckYourAnswersForm < Form | ||
end |
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
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
17 changes: 13 additions & 4 deletions
17
app/views/additional_payments/claims/check_your_answers.html.erb
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
19 changes: 14 additions & 5 deletions
19
app/views/student_loans/claims/check_your_answers.html.erb
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