Tangerine-Community / tangy-form

<tangy-form> is a web component for creating multipage forms. Other <tangy-*> input elements are included as well.
GNU General Public License v3.0
15 stars 3 forks source link

Add support for shrinking form responses #209

Open rjcorwin opened 3 years ago

rjcorwin commented 3 years ago

This PR adds support for getting a shrunk Tangy Form Response and automatic detection when a shrunk Tangy Form Response is set on a Tangy Form. It shrink by abbreviating common property names on inputs as well as removing unnecessary properties such as label.

Example of an input, big vs. shrunk:

image

chrisekelley commented 3 years ago

This makes so much sense! If we are able to modify these property names, could we go even further? For example, these are state conditions that have little to do with the data that is used server-side (except for things like completed or disabled). Could we remove most of these - the things that don't change, such as label, and add them when rendered on client? We've already got that info in TangyFormsInfoService.getFormsInfo().

chrisekelley commented 3 years ago

Thought a bit more about this - tangy-form already knows the form schema - doesn't it? There is the getMeta() function that stores the form metadata. Maybe we could handle this similar to how unlocking a form feeds this metadata to the 'UNLOCK' function in tangyform-reducer?