Feature Suggestion: Deploy from Node editor

Something i regularly miss is to be able to deploy my changes without closing the node editor.

This is especially useful for function nodes and large template nodes but could be useful on all nodes.

I have moved most of my templates out of node red and edit them with a ace editor served from node-red.
This works great but causes some headache when i have to use file in nodes to read them again from node-red, swapping payload before file read and swapping back then injecting the html in to a template node so that i can inject msg.payload +++

I do not have enough knowledge of the structure of node red to even hack it together but i made a sketch of how this could look.

Anyone else interested in this?

Unfortunately it isn't that simple.

Many nodes define an oneditsave function that is called when the Done button is clicked. This function allows the node to use custom code that takes the edit form and translates it to the updated node properties. That code will also tidy up any resources created when opening the edit dialog - as it expects the dialog to be closed.

For example, the Function and Template nodes destroy the rich text editor they use.

That means it isn't possible to save the changes from the dialog and keep the dialog open.

Ah.

But since template and function nodes are first class citizen's in node-red it should be possible to make a special-case for those nodes. (And any other nodes part of the core-nodes)

They could have a special way of handling things witch would not break existing 3rd party nodes.

another hacky way the "save and deploy" button could be implemented is:
-saving the scroll position of the template/function node (x and y) (disregarding it for unsuported nodes)
-saving like normal
-deploy changes
-reopen node after deployment
-restore scroll position (disregarding it for unsuported nodes)

perhaps supported nodes could implement "oneditdeploy" and this could keep the editor open?

Imagine having to close the source code file everytime you wanted to save it, and then having to reopen it and scroll to where you were before.

They aren't the only ones that need this though. A number of contributed nodes also rely on the oneditsave function.

What i mean is that the nodes that support instant deploy could implement another function (oneditdeploy) in addition to "oneditsave" and call that instead when apply & deploy is clicked.

The oneditdeploy should not destroy any part of the editor panel.

The normal "oneditsave" would be called as usual when clicking Done. and maybe "Done" should be renamed "Ok"

Then we have "Cancel" ,"Apply & Deploy" and "OK". same as most edit dialogs

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.