CARDS-2785: Form pagination should hide non-satisfied conditional sections - #2096
Draft
acrowthe wants to merge 6 commits into
Draft
CARDS-2785: Form pagination should hide non-satisfied conditional sections#2096acrowthe wants to merge 6 commits into
acrowthe wants to merge 6 commits into
Conversation
acrowthe
marked this pull request as draft
October 16, 2025 19:37
Contributor
Author
|
This PR is marked as a draft as I would like to make further improvements in order to update the pagination when questions are changed, rather than when fetches are made, so the displayed pagination is more accurate. However, this PR can be reviewed, tested and merged as is if desired. |
Contributor
|
I would like to have separate commits for page number adjustment and buffer removal. |
Contributor
|
It works well. While it would be nice to have pagination update on the fly, I think the functionality is good enough to merge. We can improve in a separate PR. Before approval it needs:
|
marta-
reviewed
Dec 2, 2025
marta-
reviewed
Dec 2, 2025
- Remove buffer for current page - Add a half page pagging to the start and end to show some progress on the first page and when saving
- Remove unused styles - Adjust how stub size is defined
marta-
reviewed
Dec 5, 2025
|
|
||
| useEffect(() => { | ||
| if (activePage != null && pages != null) { | ||
| if (activeStep != null && numberOfSteps != null) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (activeStep != null && numberOfSteps != null) { | |
| if (activeStep != null && numberOfSteps > 0) { |
^ Still ensures numberOfSteps is defined and also avoids division by 0
Fix divide by 0 error leading ot progress bar initializing at 100%
Rename variable
…tions - When a fetch occurs, update the pagination to hide non-satisfied conditionals
…tions - Clean up current and max step calculation
This file contains hidden or 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
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.
This is easiest to test with the Prems Outpatient Clinic form (not included in this branch) due to it's short length and conditional sections. However, this can be tested with any paginated form that contains pages which can be hidden or visible based on conditional states