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

LEAF 4629 ifthen checking optimizations #2647

Conversation

aerinkayne
Copy link
Contributor

Front end only.

  • Modify chain trigger to only target one checkbox/radio, and only for indicators that are also controllers.
    This fixes an issue where condition checking could occur more times than intended for these formats, causing considerable slowdown for forms with a large number (eg 100+) of conditional indicators.

  • Fix an uncovered issue that prevented file loaded dropdowns from loading on internal forms
    (form fields might have initially been tested with the same form)

  • Fix an issue that could cause cleared controlled questions to temporarily display if an indirect parent ancestor value was toggled (The questions would hide if needed when user interacted with the direct parent, so it was more of a display issue)

  • General optimization: Simplify frontend required validation toggling. Consolidate loops in value clearing. Reorganize code, add / reword comments for further clarity

Impact / Testing

Request data entry areas for forms containing ifthen logic.
Potential impact is high - Events and required validation swapping need to be correct to allow form progress.

Setup

See the corresponding Jira story (LEAF-4629) docs for
-A form associated with this issue
-A csv file with dropdown options for testing loaded dropdowns

Add the 'animal categories' CSV file from the Jira story to the portal file manager.

Import the form packet from the Jira story in the Form Editor.
Set a workflow (recommend wf 1) and update the form's status to 'available'.
In the workflow, set a step form field to this form's 'local item' internal (recommend wf 1 step 2 since it has a 'note' action).
Create a new request for the form and submit it.
Move the form to the workflow step that has the form field.

Test the data entry process and confirm that

  • page is responsive. Slowdown was particularly noticeable for T&L Units multiselect box, especially if multiple choices were selected from the box (This question is visible when Yes -> target audience=Designated VA Employees -> Filter audience by=T&L Units / Occupations ).
  • hidden questions do not block progress (section saves when note is clicked)
  • visible questions marked as required must be filled (required questions are highlighted if note is clicked)
  • the loaded dropdowns (drop 1 and drop 2) are visible if the initially displayed question is Yes and Learning Hours is 1 or higher, and options load for these dropdowns

Update regex. Update commnets for better clarity. Update selector
for chaining so that only one check is run for radio/checkboxes,
and only chain if also a controller. Skip clear if hidden class.
Troubleshooting validation toggle
Simplify value clearing loop.  Add break to multioption value
checking in case multiple conditions are used (rare).
Remove a reduntant check for radio format indicators.
shaneodd
shaneodd previously approved these changes Jan 13, 2025
jampaul3
jampaul3 previously approved these changes Jan 14, 2025
});
//grids cannot be controllers so we do not need to worry about them having input for the final check below
$(`#grid_${id}_1_input tbody td`) //grid table data
.each(function () {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need a final "else"? What happens if none of these conditions are met?

Pelentan
Pelentan previously approved these changes Jan 21, 2025
@Pelentan Pelentan added the With QA Ticket is to QA. No changes unless pulled back to in progress label Jan 21, 2025
@aerinkayne aerinkayne dismissed stale reviews from Pelentan, jampaul3, and shaneodd via 212f698 January 21, 2025 21:49
@Pelentan Pelentan changed the base branch from dev to rc/2025-01-22/Sprint-88-c1 January 22, 2025 16:21
@Pelentan Pelentan merged commit 29680a5 into rc/2025-01-22/Sprint-88-c1 Jan 22, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
With QA Ticket is to QA. No changes unless pulled back to in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants