Skip to content

CARDS-2785: Form pagination should hide non-satisfied conditional sections - #2096

Draft
acrowthe wants to merge 6 commits into
devfrom
CARDS-2785
Draft

CARDS-2785: Form pagination should hide non-satisfied conditional sections#2096
acrowthe wants to merge 6 commits into
devfrom
CARDS-2785

Conversation

@acrowthe

@acrowthe acrowthe commented Oct 16, 2025

Copy link
Copy Markdown
Contributor
  • When a fetch occurs, update the pagination to hide non-satisfied conditionals
  • Update the progress bar to have no "buffer" marking the current page

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

@acrowthe
acrowthe marked this pull request as draft October 16, 2025 19:37
@acrowthe

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

@marta-

marta- commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

I would like to have separate commits for page number adjustment and buffer removal.

@marta-

marta- commented Dec 2, 2025

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

  • separate commits for page number adjustment and buffer removal
  • remove the buffer styling (see inline comment)
  • rebase on the latest dev

Comment thread modules/data-entry/src/main/frontend/src/questionnaire/FormPagination.jsx Outdated
Comment thread modules/data-entry/src/main/frontend/src/questionnaire/FormPagination.jsx Outdated
- 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
@acrowthe
acrowthe changed the base branch from dev to CARDS-2813 December 5, 2025 15:48

useEffect(() => {
if (activePage != null && pages != null) {
if (activeStep != null && numberOfSteps != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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%
…tions

- When a fetch occurs, update the pagination to hide non-satisfied conditionals
…tions

- Clean up current and max step calculation
Base automatically changed from CARDS-2813 to dev December 11, 2025 20:15
@marta- marta- added conflict There's a merge conflict to be resolved needs rebase labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There's a merge conflict to be resolved needs rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants