bpmn-io / form-js

View and visually edit JSON-based forms.
https://bpmn.io/toolkit/form-js/
Other
405 stars 103 forks source link

Shortcut format to define selectable data for rapid-prototyping purposes #279

Closed tasso94 closed 1 year ago

tasso94 commented 2 years ago

Is your feature request related to a problem? Please describe

With bpmn-io/form-js/issues/197 it will be possible to define selectable data from other sources than the form schema.

The way how dynamic values are defined in JSON makes sense for real-world scenarios where you want to assign a proper label to an element. However, it stands a bit in the way of "quickly trying something out". For the "rapid prototyping" use case, we thought we could additionally offer a mapping that would shorten the whole thing a bit.

Describe the solution you'd like

For the rapid-prototyping use case, it might make sense to simplify the format as follows:

The following JSON array:

["dynamicValue1", "dynamicValue2"]

Would be mapped to:

[
  {
    "label": "dynamicValue1",
    "value": "dynamicValue1"
  },
  {
    "label": "dynamicValue2",
    "value": "dynamicValue2"
  }
]

Both label and value would be assigned the same value. That's not nice for real-world use cases. However, it might be just right if you want to "try something out quickly".

Describe alternatives you've considered

Don't add the shortcut format in the form-js library but make it available in C7.

Additional context

Originally posted in https://github.com/bpmn-io/form-js/issues/197#issuecomment-1178041147

pinussilvestrus commented 2 years ago

I'd like to hear your thoughts on this @christian-konrad @nikku

nikku commented 2 years ago

Sounds like a nice to have feature, some day, maybe.

But given it can be built trivially from "outside" form-js I'd not act on this right now.

Don't add the shortcut format in the form-js library but make it available in C7.

:+1: for the alternative in this sense.


@tasso94 Would be cool to get some additional context into the prototyping tools you build at the moment.

pinussilvestrus commented 2 years ago

I'm moving this to the backlog for now, @tasso94 feel free to share some additional as @nikku suggested 👍

Also, feel free to put this to ready if you see a higher priority 🙂

tasso94 commented 2 years ago

@nikku, we don't build any prototyping tools, but I think any proper project built with C7 starts small in a prototyping phase where you want to iterate quickly.

christian-konrad commented 2 years ago

@tasso94 @pinussilvestrus @nikku in general, I think this could be helpful for some of our onboarding use cases. It makes mapping response data into a form select field more easy if the label is optional. As this would require both schema and form.js adjustments, I would keep this in the backlog until we have this onboarding cases.

I would also not go for the alternative, as I would also expect this to work with mock data in the forms preview.

pinussilvestrus commented 1 year ago

This is possible now via form-js@0.13.0