jsoncrack.com
jsoncrack.com copied to clipboard
Edit JSON in Diagram View
Feature
Currently, if we want to edit JSON, we need to edit the code editor on the left page. I think it easier if we can edit the JSON in Diagram View (right page after click one of diagram)
Alternative solutions or implementations
No response
Other context
No response
+1
. Jsoncrack already allows viewing content at json node, it would be very handy to enable this feature.
Is anyone working on this? If not I would like to work on this feature
Is anyone working on this? If not I would like to work on this feature
Hi, you could work on it
I have started working on this issue and I have a questions. For starters here is a link to the branch I am working on. With my work so far as a user you can now edit the text of a graph node in the modal view and if your edit is valid JSON the graph node gets updated with that new text. ~~So my first question is as a user when I make an edit to the node and my edit is not valid JSON should I being seeing an Invalid JSON error?~~ (updated) I decided to add it.
The next question I have is about how to approach taking the new JSON from the node and updating the JSON editor with the new JSON. Currently when a user updates a node and it contains valid JSON the graph node gets updated. So now the text being displayed by the JSON editor is out of sync with the graph nodes. My first though would be that I need to add a parser function that turns the node and edge data back into JSON but I am wondering if a simpler method may exist. Any thoughts on this would be appreciated.
@AykutSarac @theogainey I've checked the feature, and it works perfect. Thanks for implementing it.
We also can improve the editing process a little bit: instead of updating the JSON immediately, we'd rather have two buttons Save and Cancel, and update the JSON only on save. Also on save we can verify the entered value and show an error in case it's not valid.
By the way, the implementation covers only Update, but not Create or Delete. If we need proper Editing, then we should think about the other two as well.
This could be possible by setting the value at JSON using the node path in the Node's data now.
This has been added now.