#5117 - PY: 26-27 - Independent student: Remove parent information tab#6042
#5117 - PY: 26-27 - Independent student: Remove parent information tab#6042sh16011993 wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
dependantstatushidden fieldcalculateValuelogic intended to support the new conditional display rules. - Restructured the parent information panel JSON properties (e.g.,
title,type,hideLabel) while keeping existing components.
| "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, |
There was a problem hiding this comment.
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.
| "calculateServer": true, | |
| "calculateServer": true, | |
| "defaultValue": "dependent", | |
| "persistent": true, | |
| "clearOnHide": false, |
- 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", |
There was a problem hiding this comment.
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.
- Review Comments
weskubo-cgi
left a comment
There was a problem hiding this comment.
Thanks for making those updates.
- Review Comment
|
dheepak-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Looks good.



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):
Dependant criteria not satisfied (Parent Information Not Required, Student already independant without the need of Parent Information):