writer / writer-framework

No-code in the front, Python in the back. An open-source framework for creating data apps.
https://dev.writer.com/framework/introduction
Apache License 2.0
1.3k stars 73 forks source link

fix: handle template in `BuilderFieldsKeyValue`. WF-31 #484

Closed madeindjs closed 1 month ago

madeindjs commented 2 months ago

The issue was BuilderFieldsKeyValue didn't interpret the template syntax and try to JSON.parse it when navigating between "Static List" and "JSON".

I fixed it relying on useEvaluator().getEvaluatedFields which take care of getting the current data and parsing template. It simplify a lot the logic of the component!

It just required that I get and parse instancePath in the parent.

Now everything works as expected, if user modify a template value in "Static list" mode, the template is overwiten by the plain JSON value. We still handle the "undo/redo" as expected.

Screencast from 2024-07-01 23-45-17.webm

ramedina86 commented 1 month ago

Beautiful work! Love when things become simpler