SFDigitalServices / formio-sfds

The form.io theme for sf.gov
https://formio-sfds.herokuapp.com/
MIT License
15 stars 2 forks source link

Support deep linking by page and/or component #201

Closed shawnbot closed 3 years ago

shawnbot commented 3 years ago

This PR addresses FM-22 by adding support for the following form options (the second argument to Formio.createForm()):

There are a couple of extra considerations to make these work for cases that formio.js doesn't handle natively:

I think there's value in having them separate, but I'm also willing to be convinced otherwise and just have a single codepath for "focusing" either a specific component or page.

Examples

In order to make this work on sf.gov proper (later, I think, since this is currently only something we need for testing), we'll need to handle parsing either the query string or hash and merging (w/validation!) those options into the ones that we pass the form here.

github-actions[bot] commented 3 years ago

Size Change: +277 B (0%)

Total Size: 88.6 kB

Filename Size Change
dist/formio-sfds.css 14 kB -25 B (0%)
dist/formio-sfds.standalone.js 68.2 kB +302 B (0%)
ℹ️ View Unchanged | Filename | Size | | :--- | :---: | | `dist/portal.js` | 6.37 kB |

compressed-size-action

shawnbot commented 3 years ago

Heads up to @hshaosf @nlsfds: this will be going out in the next release so you should be able to link to pages and/or components in form previews, but not (yet) on sf.gov.