I would like to add confirmation dialog to the deploy button in node red editor. On OK confirmation, deploy the nodes, and on Cancel do not deploy the nodes
I think if you have got to the stage of pressing the DEPLOY
button, you will just have to wait it out.
I know a few (many) times I've accidentally pressed it (not ending the world) but it can be annoying.
Take more care and make sure it is a deliberate action.
Another one who wants a lot of clicks.
I prefer as few clicks as possible.
I once had a maintenance program that required 18 clicks before the task could be reported as completed.
Adding confirmation to Deploy - not a fan of!!!!
We have recently discussed a change that hasn’t gone down well, that added more clicks, so I can’t imagine this will be in favour - what is it with adding clicks everywhere all of a sudden, makes the user experience slow and unnecessary?
And I have moved this post to the correct category
and removed unrelated tags
Is there any custom way of doing this? using node-red custom plugins
Also note that usually Undo continues to work even if you have deployed.
Maybe have it to update modified nodes.
It would be quicker - maybe.
What workflow is causing a problem that would require making this a multi-step process? (e.g. why is not having a 2 step confirmation a problem?)
The Deploy button is already well out of the way of the canvas, there is a big gap from the burger menu, the only thing that is somewhat close are the sidebar tab buttons and you could use a custom theme to increase that spacing if you want.
All in favour of the node-red-contrib-more-clicks package, it could allow a configurable number of extra clicks for any and all actions! /s
Perhaps this feature request would be better formulated as "please allow plugins to configure extra clicks", i.e., make Node-RED more accessible for plugins so that this could be done via a plugin.
AFAIK deplyment is done using an action RED.actions.invoke("core:deploy-flows")
which is then linked to save
function.
What a plugin could do is remove that action using RED.actions.remove(...)
and replace it with one that has a confirmation.
Unfortunately this is not as simple as:
let prevAction = RED.actions.remove("core:deploy-flows")
let newAction = function(args) {
if (confirm("Really deploy?")) {
prevAction(args)
}
}
RED.actions.add("core:deploy-flows",newAction)
because removeAction
does not return the function it's deleting (because delete
doesn't)
Neither is save
exported in the deploy module, else another approach would be
RED.actions.remove("core:deploy-flows")
let newAction = function(args) {
if (confirm("Really deploy?")) {
RED.deploy.save(args)
}
}
RED.actions.add("core:deploy-flows",newAction)
So my feature request would be have RED.actions.remove
return the original function it was linked to so that plugins could overwrite certain actions (all and any actions in fact) to make these "multiple clicks to confirm task" possible via plugins.
After all that would only entail doing this in the removeAction function:
function removeAction(name) {
let returnValue = actions[name];
return (delete actions[name]) ? returnValue : false;
}
Who are you refering to? And why?
I dont like this too. But it makes sense if there was 2 buttons
"Save" => creates a flows.timestamp.json but doesnt apply to flows.json. Why? Browser local/db storage are deleted in some browsers, like Brave, when closing it
"Save and Apply" => default behavior. It can be called "Deploy" still.
With this "extra" button we don't risk losing our changes if the browser is closed during a grid Outage. There is an extra click only if you choose to. The default behavior would be kept.
Which change added more clicks? The Save button in the config panel was useless without my proposal because Users were "Closing and Saving" changes to the node clicking outside of the panel. It did not add "more clicks" because the "old/default behavior" can still run with exactly 1 User action. The difference is that you now have to use a keyboard shortcut, instead of 1 click.
Well if the cap fits
I knew it!