cern-sis / react-formule

User-friendly, extensible form builder for React based on JSON Schema and RJSF
https://cern-sis.github.io/react-formule/
MIT License
7 stars 3 forks source link

Add option to provide a string template for array item names #24

Closed miguelgrc closed 2 months ago

miguelgrc commented 4 months ago

Right now, there's the option to provide (manually editing the schema) a pattern to set the titles of the array items based on the selected content of each item (see stringify and stringifyTmpl in the CAP schemas, and parsing in LayerArrayFieldTemplate.jsx). It would be nice to have an option in the form builder for users to specify this pattern (optionally with some help, i.e. when they input {{ they get path suggestions, getting inspiration from theSchemaPathSuggester).

More specifically it will be a Jinja template, so it would be convenient to use codemirror for that field so that we can get syntax highlighting

Extra: Add a feature to copy the name of a field from the schema tree so that we can use it in the template without having to type it. It would make sense to have it as a right-click dropdown option.

Old issue in CAP: https://github.com/cernanalysispreservation/analysispreservation.cern.ch/issues/2854

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: