diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js index 1df91dae3..a09fdeb01 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js @@ -602,10 +602,10 @@ RED.deploy = (function() { node.moved = false; } }) - flowsToLock.forEach(flow => { - flow.locked = true - }) RED.nodes.eachConfig(function (confNode) { + if (confNode.z) { + ensureUnlocked(confNode.z) + } confNode.changed = false; if (confNode.credentials) { delete confNode.credentials; @@ -615,8 +615,16 @@ RED.deploy = (function() { subflow.changed = false; }); RED.nodes.eachWorkspace(function (ws) { - ws.changed = false; + if (ws.changed || ws.added) { + ensureUnlocked(ws.z) + ws.changed = false; + delete ws.added + RED.events.emit("flows:change", ws) + } }); + flowsToLock.forEach(flow => { + flow.locked = true + }) // Once deployed, cannot undo back to a clean state RED.history.markAllDirty(); RED.view.redraw(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index 56fb1c79e..9b2b1d0d7 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -82,8 +82,11 @@ RED.workspaces = (function() { info: "", label: RED._('workspace.defaultName',{number:workspaceIndex}), env: [], - hideable: true + hideable: true, }; + if (!skipHistoryEntry) { + ws.added = true + } RED.nodes.addWorkspace(ws,targetIndex); workspace_tabs.addTab(ws,targetIndex); @@ -93,8 +96,7 @@ RED.workspaces = (function() { RED.nodes.dirty(true); } } - $("#red-ui-tab-"+(ws.id.replace(".","-"))).attr("flowname",ws.label) - + $("#red-ui-tab-"+(ws.id.replace(".","-"))).attr("flowname",ws.label).toggleClass('red-ui-workspace-changed',!!(ws.contentsChanged || ws.changed || ws.added)); RED.view.focus(); return ws; } @@ -645,7 +647,7 @@ RED.workspaces = (function() { }) RED.events.on("flows:change", (ws) => { - $("#red-ui-tab-"+(ws.id.replace(".","-"))).toggleClass('red-ui-workspace-changed',!!(ws.contentsChanged || ws.changed)); + $("#red-ui-tab-"+(ws.id.replace(".","-"))).toggleClass('red-ui-workspace-changed',!!(ws.contentsChanged || ws.changed || ws.added)); }) hideWorkspace();