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
Replace expenses multi questions for dynamic #466
Conversation
4feeeda
to
15e2811
Compare
15e2811
to
b3b3242
Compare
src/main/java/org/ladocuploader/app/submission/conditions/BasicArrayCondition.java
Fixed
Show fixed
Hide fixed
<div class="form-card__content"> | ||
<div th:each="expense, iter:${inputData.get('householdUtilitiesExpenses[]')}" | ||
class="spacing-below-15"> | ||
<div th:if="${expense != 'Other'}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we should keep this in since there's a field for this in the PDF - was there a reason for leaving it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sree-cfa - the design says to ask the amount question for all expeneses except other:
I can add it back in.
This PR uses Dynamic Fields to collect expenses data based on the expenses that a user has shared.
There are two key fields: 1) The array that stores all of the expenses selected by the user. 2) The Dynamic field and validations that will be the blueprint for additional fields that are created.
A new BasicArrayCondition checks that the data in the first key field requires a follow up question (collection of amounts).
As you can see, this change will delete A LOT of lines of code. It will reduce the cost of updating the multi select values because it means we do not need to create unique pages or unique validation.
Thanks to @bseeger and @lkemperman-cfa for creating Dynamic fields!!