SFDigitalServices / formio-sfds

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

Add "what the form" view #142

Closed shawnbot closed 3 years ago

shawnbot commented 3 years ago

This adds a new "what the form" view that, given one of the below URL archetypes, attempts to provide as much information about the form, any options passed, and translations, as possible:

  1. Any sf.gov or *sfgov*.pantheonsite.io URL will parse out the data source URL and options from the HTML
  2. Any portal.form.io URL will attempt to get the project and form ID from the hash (#/project/:projectId/form/:formId), query the "Live" stage form.io API for a form with that ID via sfds.form.io/form?_id__eq={formId} (check out the form.io API docs for more info)
  3. Any other *sfds*.form.io URL will be treated as a JSON data source URL

I've added support to look up pages on sf.gov by form data source URL (using an API published from our private forms repo) so that any of these should work and show the same results:

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sfds/formio-sfds/h15z2jjv0
✅ Preview: https://formio-sfds-git-wtf.sfds.vercel.app

github-actions[bot] commented 3 years ago

Size Change: +9 B (0%)

Total Size: 92.1 kB

Filename Size Change
dist/formio-sfds.standalone.js 68.1 kB +9 B (0%)
ℹ️ View Unchanged | Filename | Size | Change | | |:--- |:---:|:---:|:---:| | `dist/common.css` | 484 B | 0 B | | | `dist/examples.js` | 3.51 kB | 0 B | | | `dist/examples/example.js` | 508 B | 0 B | | | `dist/formio-sfds.css` | 14.1 kB | 0 B | | | `dist/portal.js` | 5.36 kB | 0 B | |

compressed-size-action