-
Notifications
You must be signed in to change notification settings - Fork 20
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
LEAF-4604 update form progress checking to account for conditional logic #2613
Open
aerinkayne
wants to merge
6
commits into
master
Choose a base branch
from
enhance/LEAF-4604/get_progress_required_count_rewrite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
LEAF-4604 update form progress checking to account for conditional logic #2613
aerinkayne
wants to merge
6
commits into
master
from
enhance/LEAF-4604/get_progress_required_count_rewrite
Conversation
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
aerinkayne
requested review from
mgaoVA,
pete-nerantzinis,
Pelentan,
shaneodd,
jampaul3 and
nk2136
December 3, 2024 13:42
shaneodd
previously approved these changes
Dec 3, 2024
jampaul3
previously approved these changes
Dec 4, 2024
Pelentan
requested changes
Dec 4, 2024
*/ | ||
public function getProgress($recordID) | ||
private function count_required( |
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.
Where's my return type? ;-)
LEAF_Request_Portal/sources/Form.php
Outdated
* @param int $recordID | ||
* @return int Percent completed | ||
*/ | ||
public function getProgress($recordID) |
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.
Type cast and return type, please.
Pelentan
approved these changes
Dec 9, 2024
shaneodd
approved these changes
Dec 10, 2024
jampaul3
approved these changes
Dec 10, 2024
Pelentan
added
the
With QA
Ticket is to QA. No changes unless pulled back to in progress
label
Dec 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The current Form getProgress method still compares a flat array of required questions with data entries in order to determine form progress percentage. Individual questions account for direct conditional logic. However, since there is no information about form structure, using conditional logic when the conditional indicator has required sub-questions is problematic / tedious because the logic needs to be repeated on the subquestion.
This update will take form structure into account (when needed) during the progress count so that any ancestor in a hidden state is sufficient.
Front end:
Updates to form.js to handle conditional display states and to toggle front end validation for required questions
Server-Side:
Updates to form method getProgress to account for structure.
Following a check for submission and for the number of required questions, method will progress with a depth search assessment of question display state, visible required question, and total required question totals. Required questions that are not in a visible state because they OR one of their ancestors are hidden by conditional do not count towards the visible total.
Impact / Testing.
Associated go test PR
department-of-veterans-affairs/LEAF-Automated-Tests#20
This has high impact to the initial request submission process.
If the total is inaccurate
-data entry or submission could be prevented without a visible indication to the user as to why.
-submission could be allowed despite the user not having answered all required questions.
Test form data entry (initial request) and confirm that the percentage (form progress) reflects the percentage of answered required questions that are visible on the form. Required questions hidden by ifthen logic directly, or because they are subquestions of hidden questions should not count towards the visible total.