XGovFormBuilder / digital-form-builder

Exploring how to quickly and easily design/prototype/deploy high quality digital forms for UK Gov. Based on the excellent work by DEFRA. Currently maintained by jen+forms@cautionyourblast.com at Caution Your Blast and a community collaboration between FCDO, HO, GDS, DfE, DIT, Version 1, UKHSA
https://digital-form-builder-designer.herokuapp.com/app
MIT License
58 stars 34 forks source link

Unexpected navigation when Summary page is not at the end of the form #1292

Open BenVersion1 opened 1 month ago

BenVersion1 commented 1 month ago

Describe the bug Summary page and confirmation page is skipped in the form when questions are answers. Seems to be issue when summary page not at the end, when there is also conditions added for navigation.

To Reproduce Steps to reproduce the behavior:

  1. Create form (basic form with no submission - simply used to check eligibility based on answers provided)
  2. 6 questions pages, each with a yes/no question
  3. Summary page
  4. Confirmation page1 (shown if all questions = True)
  5. Confirmation page2 (shown if any question = False)
  6. Next steps shown after Confirmation page2
  7. The pages show individually using preview, but if all questions are answered both summary and confirmations are skipped

Expected behavior Summary page and confirmation shouldn't be skipped. Should be possible to have a summary page before the end of a form.

Screenshots

image

Repository designer

Desktop (please complete the following information):

Additional context Example form I used attached. I'm trying it via https://digital-form-builder-designer.herokuapp.com/app acs-eligibility-checker-v5.json

jenbutongit commented 1 month ago

Hey @BenVersion1, thanks for reaching out. I quite like this use-case. We have considered using form builder to essentially replace smart answers before 🙂..

It's currently undocumented, but Summary Pages (SummaryPageController) are intended to be the "end" of a form, since this is where all the submissions logic is executed - there's no logic to find and go to the next page. The next page would always be to GOV.UK Pay or to an application confirmation page (the one with the green banner). When the summary page is set to be "skipped", it is just skipping the UI (what's shown to the user), but still executes all of the submission logic.

I've done a recent refactor in https://github.com/XGovFormBuilder/digital-form-builder/pull/1264. I'll have to have a think, but it might be easier now for me to implement a Summary List component. Otherwise I can create a different page type.

I'll have to get back to you on when I can implement this though. When would you ideally need it by?

If it's easier you can join the slack, or send me an email jen@cautionyourblast.com.