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

#3984 - Former youth in care question update #4333

Merged
merged 9 commits into from
Feb 10, 2025

Conversation

guru-aot
Copy link
Collaborator

@guru-aot guru-aot commented Feb 8, 2025

Former youth in care question updated in application for Program Year 2025-2026 - Prefer not to answer option is updated to display only for full time

Full Time
image
image

Part Time
image
image

Code snippet in the Logic for dynamic loading of options

const options = [
  { label: 'Yes', value: 'yes' },
  { label: 'No', value: 'no' }
];

if (data.howWillYouBeAttendingTheProgram === 'Part Time') {
  options.push({ label: 'Prefer not to answer', value: 'preferNotToAnswer' });
}

component.values = options;

load the json in https://formio.github.io/formio.js/app/sandbox.html to view the logic

@guru-aot guru-aot self-assigned this Feb 8, 2025
@guru-aot guru-aot added the Form.io Form IO definitions changed. label Feb 8, 2025
{
"name": "Update Youth In Care Options",
"type": "customAction",
"customAction": "var options = [\n { label: 'Yes', value: 'yes' },\n { label: 'No', value: 'no' }\n];\n\nif (data.howWillYouBeAttendingTheProgram === 'Part Time') {\n options.push({ label: 'Prefer not to answer', value: 'preferNotToAnswer' });\n}\n\ncomponent.values = options;"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a benefit of using var over const?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the reassignment of the options variable when assigned back to component.values will not happen if its const.

@dheepak-aot
Copy link
Collaborator

Good job @guru-aot. Please take a look at the comments.

@lewischen-aot lewischen-aot self-requested a review February 10, 2025 21:20
Copy link
Collaborator

@lewischen-aot lewischen-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for making the changes.

Comment on lines +8773 to +8776
"show": "",
"when": null,
"eq": "",
"json": ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change. Please create a ticket to fix the same in other PY forms.

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.09% ( 3903 / 17668 )
Methods: 9.98% ( 226 / 2264 )
Lines: 25.42% ( 3369 / 13251 )
Branches: 14.31% ( 308 / 2153 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.59% ( 589 / 898 )
Methods: 59.63% ( 65 / 109 )
Lines: 68.72% ( 468 / 681 )
Branches: 51.85% ( 56 / 108 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 87.58% ( 1418 / 1619 )
Methods: 84.66% ( 160 / 189 )
Lines: 89.72% ( 1170 / 1304 )
Branches: 69.84% ( 88 / 126 )

"customMessage": "",
"custom": "",
"onlyAvailableItems": false,
"customMessage": "Youth In Care is an invalid value.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the message. E.g. Invalid value for Youth In Care.

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.41% ( 6118 / 8943 )
Methods: 66.29% ( 757 / 1142 )
Lines: 72.18% ( 4787 / 6632 )
Branches: 49.1% ( 574 / 1169 )

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. Looks good. Just a minor comment. #4333 (comment)

@guru-aot guru-aot added this pull request to the merge queue Feb 10, 2025
Merged via the queue into main with commit 86398e3 Feb 10, 2025
21 checks passed
@guru-aot guru-aot deleted the #3984-Former_Youth_in_Care_Question_Update branch February 10, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Form.io Form IO definitions changed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants