-
Notifications
You must be signed in to change notification settings - Fork 7
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
CLDC-3344: Sales CSV download ecstat2 child label bug fix #2801
Merged
Dinssa
merged 15 commits into
main
from
CLDC-3344-Sales-csv-download-label-bug-for-persion-2-ecstat-child
Dec 9, 2024
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
09ea76a
Add missing answer option
Dinssa 4b52690
Update tests
Dinssa e08dc01
Allow user to change the age of a person if they're not actually unde…
Dinssa 6d85b60
Update displayed answer options
Dinssa cb318b1
Add tests
Dinssa c12259b
Fix lint
Dinssa 5e75fa3
Clear only when age is not known
Dinssa 2cf84df
Merge branch 'main' into CLDC-3344-Sales-csv-download-label-bug-for-p…
Dinssa ed9eca4
Lint
Dinssa 94125f4
Use existing method
Dinssa 1d08006
Update tests
Dinssa 8090774
Merge branch 'main' into CLDC-3344-Sales-csv-download-label-bug-for-p…
Dinssa 5b54aa8
Merge branch 'main' into CLDC-3344-Sales-csv-download-label-bug-for-p…
Dinssa b8bf4d2
Revert changes in derived variables
Dinssa 7764d96
Update sales_log_spec.rb
Dinssa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -15,6 +15,10 @@ def initialize(id, hsh, page) | |
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] | ||
end | ||
|
||
def displayed_answer_options(log, _user = nil) | ||
answer_options.reject { |key, _| key == "9" } | ||
end | ||
|
||
def answer_options | ||
if form.start_year_2025_or_later? | ||
{ | ||
|
@@ -26,6 +30,7 @@ def answer_options | |
"6" => { "value" => "Not seeking work" }, | ||
"7" => { "value" => "Full-time student" }, | ||
"8" => { "value" => "Unable to work due to long term sick or disability" }, | ||
"9" => { "value" => "Child under 16" }, | ||
"0" => { "value" => "Other" }, | ||
"10" => { "value" => "Buyer prefers not to say" }, | ||
}.freeze | ||
Comment on lines
30
to
36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are not displaying the key “9” in 2024 or beyond, I added the value but omitted the depends_on conditions found on the generic person working situation page's answer options. |
||
|
@@ -41,6 +46,7 @@ def answer_options | |
"0" => { "value" => "Other" }, | ||
"10" => { "value" => "Buyer prefers not to say" }, | ||
"7" => { "value" => "Full-time student" }, | ||
"9" => { "value" => "Child under 16" }, | ||
}.freeze | ||
end | ||
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
Oops, something went wrong.
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.
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.
I've added this so a user can change the age of a person that was first set as under 16 to another age above 16. At the moment should they want to do that they would get an error:
Answer cannot be over 16 as person’s 2 working situation is ‘child under 16‘.
As the working situation question for a child is not one they can access they'd get stuck. Now should they change the age e.g. to 17, the next question will be to choose the working situation.
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.
Can we add some tests for this to make sure it doesn't clear it when we don't want it to?
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.
Sure, added