form-js icon indicating copy to clipboard operation
form-js copied to clipboard

Be able to bind inputs to readonly text

Open nikku opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe

As a user I want to bind form input to readonly text, potentially formatted using Markdown.

Describe the solution you'd like

I can model a field to bind a single variable to a readonly text representation.

We shall consider how we deal with these special readonly variables; shall we still include them in the result? What SAFE properties do we want to guarantee? Cf. blog post.

Describe alternatives you've considered

Re-use the existing text component to allow variable binding. This would allow to mix and match a number of variables.

Additional context

Originally captured in this conversation.


Requested via SUPPORT-12403

Related to https://github.com/bpmn-io/form-js/issues/200

nikku avatar Apr 27 '22 11:04 nikku

https://github.com/bpmn-io/form-js/pull/302 proposes adding Mustache for string templating.

Two aspects to consider here: What shall be our separators (PR proposes {{ }}) but also language to establish dynamic bindings (shall be feel? hello {{ user.name }}). Mustache itself is a quasi standard, simpler than FEEl, and more powerful in many (templating related) aspects.

CC @christian-konrad

nikku avatar Aug 09 '22 09:08 nikku

A discussion with @nikku had the following outcomes:

  • a user can be confused when using Camunda products with FEEL and then having one special place where another language is used
  • the requirements for templating might at some point be various, but the decision to use FEEL for templates would open the possibility to use FEEL inside templates as well
  • #302 gives us a good idea on how templates in forms can look like
  • before a pull request can be merged, we will have to define the initial feature scope
  • it is very likely that the main effort to implement this feature will happen in FEEL (and the engines being used)
  • a test case is very helpful to show the way a feature is implemented. This test-case is end-to-end (text that should be displayed containing the templates -> rendered html). Util-function tests can help identify problems and proof a functionality, so they should exist as well.

@nikku If I forgot something, please git me (on slack)

jonathanlukas avatar Aug 10 '22 10:08 jonathanlukas

We will start adding FEEL support for text fields via https://github.com/bpmn-io/form-js/issues/436. Note that's not a decision against Mustache or any other vendor by now. We still aim to support this someday, maybe.

pinussilvestrus avatar Dec 01 '22 13:12 pinussilvestrus