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

feat: add option to allow overwriting state values from query param population #1260

Closed ziggy-cyb closed 5 months ago

ziggy-cyb commented 5 months ago

Description

In some cases it might be necessary to allow query parameters to overwrite present state values. For example, if there is an unreachable field in your form that should be pre-populated from a query parameter, and there is a chance the user may change their selection prior to entering the service that changes the value of that unreachable field, the query parameter should overwrite this value as there is no other way for the user to change their selection.

To solve this, an option allowOverwriteFromQueryParam has been added. This option will only have an effect if the component has already been given the allowPrePopulation flag.

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce the testing if necessary.

Checklist: