Skip to content

#5117 - PY: 26-27 - Independent student: Remove parent information tab#6042

Open
sh16011993 wants to merge 6 commits intomainfrom
feature/#5117-PY-26-27-independent-student-remov-parent-information-tab
Open

#5117 - PY: 26-27 - Independent student: Remove parent information tab#6042
sh16011993 wants to merge 6 commits intomainfrom
feature/#5117-PY-26-27-independent-student-remov-parent-information-tab

Conversation

@sh16011993
Copy link
Copy Markdown
Collaborator

@sh16011993 sh16011993 commented Apr 15, 2026

As a part of this PR, the following was completed:

Changed the logic for the PY 26/27 FT form to display the Parent Information only if the student is dependant.

Screenshot:

Basic Dependant criteria satisfied (Parent Information Required):

image

Dependant criteria not satisfied (Parent Information Not Required, Student already independant without the need of Parent Information):

image

Copilot AI review requested due to automatic review settings April 15, 2026 19:21
@sh16011993 sh16011993 self-assigned this Apr 15, 2026
@sh16011993 sh16011993 added the Form.io Form IO definitions changed. label Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the 2026/27 Full-Time SFAA Form.io definition to show parent-related sections only when the student is calculated as dependent, aligning the UI flow with dependency determination logic.

Changes:

  • Added a dependantstatus === "dependant" conditional to the “Parent information panel” on the Personal information page.
  • Updated the dependantstatus hidden field calculateValue logic intended to support the new conditional display rules.
  • Restructured the parent information panel JSON properties (e.g., title, type, hideLabel) while keeping existing components.

Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

"label": "Dependant Status",
"calculateValue": "const isStudentIndependant =\r\n data.hasDependents === \"yes\" ||\r\n [\"married\", \"other\", \"marriedUnable\"].includes(data.relationshipStatus) ||\r\n data.outOfHighSchoolFor4Years === \"yes\" ||\r\n data.fulltimelabourForce === \"yes\" ||\r\n data.parentsDeceased === \"yes\" ||\r\n data.estrangedFromParents === \"yes\" ||\r\n data.custodyOfChildWelfare === \"yes\";\r\n// If the student is not independant, dependant status is calculated based on personal information answer inputs.\r\nif (!isStudentIndependant) {\r\n const isPersonalInfoAnswered =\r\n !!data.hasDependents &&\r\n !!data.relationshipStatus &&\r\n !!data.outOfHighSchoolFor4Years &&\r\n !!data.fulltimelabourForce &&\r\n !!data.parentsDeceased &&\r\n !!data.estrangedFromParents && // Considered to be \"no\" at this moment.\r\n !!data.youthInCare &&\r\n (data.youthInCare === \"no\" || !!data.custodyOfChildWelfare);\r\n // If the answers to required personal information inputs are not provided, set the dependant status to null.\r\n // Otherwise, dependant status is calculated based on personal information answers.\r\n const calculatedStatusFromPersonalInfo = isPersonalInfoAnswered\r\n ? \"dependant\"\r\n : null;\r\n instance.setValue(calculatedStatusFromPersonalInfo);\r\n} else {\r\n instance.setValue(\"independant\");\r\n}",
"calculateValue": "let parentInformationStatus;\r\nconst isStudentIndependant =\r\n data.hasDependents === \"yes\" ||\r\n [\"married\", \"other\", \"marriedUnable\"].includes(data.relationshipStatus) ||\r\n data.outOfHighSchoolFor4Years === \"yes\" ||\r\n data.fulltimelabourForce === \"yes\" ||\r\n data.custodyOfChildWelfare === \"yes\";\r\n// If the student is not independant, dependant status is calculated based on personal information answer inputs.\r\nif (!isStudentIndependant) {\r\n const isPersonalInfoAnswered =\r\n !!data.hasDependents &&\r\n !!data.relationshipStatus &&\r\n !!data.outOfHighSchoolFor4Years &&\r\n !!data.fulltimelabourForce &&\r\n !!data.youthInCare &&\r\n (data.youthInCare === \"no\" || !!data.custodyOfChildWelfare);\r\n // If the answers to required personal information inputs are not provided, set the dependant status to null.\r\n // Otherwise, dependant status is calculated based on personal information answers.\r\n parentInformationStatus = isPersonalInfoAnswered\r\n ? \"required\"\r\n : null;\r\n} else {\r\n parentInformationStatus = \"not-required\";\r\n}\r\n\r\nif(parentInformationStatus === \"not-required\") {\r\n\tinstance.setValue(\"independant\");\r\n}\r\nelse if(parentInformationStatus === \"required\") {\r\n\tif(data.parentsDeceased === \"yes\" || data.estrangedFromParents === \"yes\") {\r\n instance.setValue(\"independant\");\r\n }\r\n else if(!!data.parentsDeceased && !!data.estrangedFromParents) {\r\n // Both answered, neither is \"yes\" → student is dependant\r\n instance.setValue(\"dependant\");\r\n }\r\n else {\r\n // Not all questions answered yet\r\n instance.setValue(null);\r\n }\r\n}\r\nelse {\r\n instance.setValue(null);\r\n}",
"calculateServer": true,
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

The updated dependantstatus calculateValue depends on data.parentsDeceased/data.estrangedFromParents, but those fields live inside parentInformationPanel which is now conditionally hidden based on dependantstatus. With the current logic, dependantstatus can get stuck as null because the inputs needed to progress are not reachable. Refactor the calculation/visibility so the questions used to compute dependantstatus are always available when needed, or compute dependantstatus solely from fields that are visible before gating parent panels/tabs.

Suggested change
"calculateServer": true,
"calculateServer": true,
"defaultValue": "dependent",
"persistent": true,
"clearOnHide": false,

Copilot uses AI. Check for mistakes.
@dheepak-aot dheepak-aot self-requested a review April 15, 2026 23:00
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json
- Updated the logic as per the discussion
},
{
"label": "Parent Information Status",
"calculateValue": "const isStudentIndependant =\r\n data.hasDependents === \"yes\" ||\r\n [\"married\", \"other\", \"marriedUnable\"].includes(data.relationshipStatus) ||\r\n data.outOfHighSchoolFor4Years === \"yes\" ||\r\n data.fulltimelabourForce === \"yes\" ||\r\n data.custodyOfChildWelfare === \"yes\";\r\n// If the student is not independant, dependant status is calculated based on personal information answer inputs.\r\nif (!isStudentIndependant) {\r\n const isPersonalInfoAnswered =\r\n !!data.hasDependents &&\r\n !!data.relationshipStatus &&\r\n !!data.outOfHighSchoolFor4Years &&\r\n !!data.fulltimelabourForce &&\r\n !!data.youthInCare &&\r\n (data.youthInCare === \"no\" || !!data.custodyOfChildWelfare);\r\n // If the answers to required personal information inputs are not provided, set the dependant status to null.\r\n // Otherwise, dependant status is calculated based on personal information answers.\r\n isPersonalInfoAnswered\r\n ? instance.setValue(\"required\")\r\n : instance.setValue(null);\r\n} else {\r\n instance.setValue(\"not-required\");\r\n}\r\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please update the following comments as per the update.

// If the student is not independant, dependant status is calculated based on personal information answer inputs.

// If the answers to required personal information inputs are not provided, set the dependant status to null.
  // Otherwise, dependant status is calculated based on personal information answers.

@weskubo-cgi weskubo-cgi self-requested a review April 16, 2026 18:13
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json Outdated
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json Outdated
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json Outdated
Copy link
Copy Markdown
Collaborator

@weskubo-cgi weskubo-cgi 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 those updates.

Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json Outdated
Comment thread sources/packages/forms/src/form-definitions/sfaa2026-27-ft.json
- Review Comment
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.3% ( 4651 / 22906 )
Methods: 9.8% ( 274 / 2795 )
Lines: 24.65% ( 3979 / 16140 )
Branches: 10.02% ( 398 / 3971 )

@github-actions
Copy link
Copy Markdown

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 48.07% ( 2720 / 5658 )
Methods: 37.9% ( 285 / 752 )
Lines: 54.93% ( 2057 / 3745 )
Branches: 32.56% ( 378 / 1161 )

@github-actions
Copy link
Copy Markdown

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 80.98% ( 9398 / 11606 )
Methods: 80.75% ( 1225 / 1517 )
Lines: 84.34% ( 7054 / 8364 )
Branches: 64.87% ( 1119 / 1725 )

Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown

E2E SIMS API Coverage Report

Totals Coverage
Statements: 68.14% ( 13627 / 19998 )
Methods: 65.51% ( 1626 / 2482 )
Lines: 71.33% ( 9804 / 13744 )
Branches: 58.24% ( 2197 / 3772 )

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.

4 participants