department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
40 stars 61 forks source link

Add `returnUrl` page config docs #1787

Open Mottie opened 1 year ago

Mottie commented 1 year ago

Duplicate check

This update is for:

Forms Library

What is the name?

Form & page options, and bypass schema form docs

What is the nature of this update?

What problem does this solve?

For the add item list loop pattern, the "Add or edit item" page is likely hidden (using depends in the page config). If the add item page uses the CustomPage setFormData function, it will automatically trigger an auto-save API request to save the data to the in progress form. When this happens, the returnUrl in the meta data is set to the add item page. If the user closes the browser without making any other form data changes, the return url will point to that hidden add issue page. Upon returning to the form, using the "Continue your application" button may, or may not, cause the form to kick the user back to the introduction page - resulting in an endless loop - the only way to resolve this issue is to restart the form.

In our appeals forms, we use the contact info list loop which is similar, but we don't save any data until the Veteran uses the "Save" button on the edit page, then they are immediately redirected back to the main contact info summary page. If delayed long enough, saving may cause the return url to point to the contact edit page.

Related tickets:

Additional Context

Form config page Options table

Page: https://depo-platform-documentation.scrollhelp.site/developer-docs/va-forms-library-form-config-options#VAFormsLibrary-FormConfigOptions-pages

Add the following to the pages table

Properties: returnUrl Value Type: string Description: Add a return url path (include leading /) for a page that is usually hidden and should not be accessible using the form navigation (back and continue) buttons. Example(s): returnUrl: '/dependent-summary'

caw310 commented 4 weeks ago

@Mottie is this still an issue?

Mottie commented 4 weeks ago

The endless loop part of this ticket is no longer an issue, but the returnUrl documentation still needs to be updated (look at the content under "Additional Context").

caw310 commented 3 weeks ago

Hey team! Please add your planning poker estimate with Zenhub @babsdenney @danbrady @LWWright7