Skip to content

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

Merged
ramedina86 merged 1 commit intowriter:devfrom
madeindjs:WF-31
Jul 30, 2024
Merged

fix: handle template in BuilderFieldsKeyValue. WF-31#484
ramedina86 merged 1 commit intowriter:devfrom
madeindjs:WF-31

Conversation

@madeindjs
Copy link
Collaborator

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

@madeindjs madeindjs marked this pull request as ready for review July 1, 2024 22:05
@ramedina86
Copy link
Collaborator

Beautiful work! Love when things become simpler

@ramedina86 ramedina86 merged commit 37b25b1 into writer:dev Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants