diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index f51c7b604..23df7550d 100644 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -106,7 +106,8 @@ "warning": "Warning: __message__", "warnings": { "undeployedChanges": "node has undeployed changes", - "nodeActionDisabled": "node actions disabled within subflow", + "nodeActionDisabled": "node actions disabled", + "nodeActionDisabledSubflow": "node actions disabled within subflow", "missing-types": "

Flows stopped due to missing node types.

", "safe-mode":"

Flows stopped in safe mode.

You can modify your flows and deploy the changes to restart.

", "restartRequired": "Node-RED must be restarted to enable upgraded modules", diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json index 4b89f26f0..136f9972b 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -106,7 +106,7 @@ "warning": "警告: __message__", "warnings": { "undeployedChanges": "ノードの変更をデプロイしていません", - "nodeActionDisabled": "ノードのアクションは、サブフロー内で無効になっています", + "nodeActionDisabledSubflow": "ノードのアクションは、サブフロー内で無効になっています", "missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください。", "safe-mode": "

セーフモードでフローを停止しました

フローを変更し、再起動するために変更をデプロイできます

", "restartRequired": "更新されたモジュールを有効化するため、Node-REDを再起動する必要があります", diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json b/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json index d4b07c1b2..93cf323ea 100644 --- a/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json @@ -86,7 +86,7 @@ "warning": "警告: __message__", "warnings": { "undeployedChanges": "节点中存在未部署的更改", - "nodeActionDisabled": "节点动作在子流程中被禁用", + "nodeActionDisabledSubflow": "节点动作在子流程中被禁用", "missing-types": "流程由于缺少节点类型而停止。请检查日志的详细信息", "restartRequired": "Node-RED必须重新启动,以启用升级的模块" }, diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 7cc283cc1..ba270439c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1909,18 +1909,25 @@ RED.view = (function() { function isButtonEnabled(d) { var buttonEnabled = true; - if (d._def.button.hasOwnProperty('enabled')) { - if (typeof d._def.button.enabled === "function") { - buttonEnabled = d._def.button.enabled.call(d); - } else { - buttonEnabled = d._def.button.enabled; + var ws = RED.nodes.workspace(RED.workspaces.active()); + if (ws && !ws.disabled) { + if (d._def.button.hasOwnProperty('enabled')) { + if (typeof d._def.button.enabled === "function") { + buttonEnabled = d._def.button.enabled.call(d); + } else { + buttonEnabled = d._def.button.enabled; + } } + } else { + buttonEnabled = false; } return buttonEnabled; } function nodeButtonClicked(d) { - if (!activeSubflow) { + var activeWorkspace = RED.workspaces.active(); + var ws = RED.nodes.workspace(activeWorkspace); + if (ws && !ws.disabled) { if (d._def.button.toggle) { d[d._def.button.toggle] = !d[d._def.button.toggle]; d.dirty = true; @@ -1936,7 +1943,11 @@ RED.view = (function() { redraw(); } } else { - RED.notify(RED._("notification.warning", {message:RED._("notification.warnings.nodeActionDisabled")}),"warning"); + if (activeSubflow) { + RED.notify(RED._("notification.warning", {message:RED._("notification.warnings.nodeActionDisabledSubflow")}),"warning"); + } else { + RED.notify(RED._("notification.warning", {message:RED._("notification.warnings.nodeActionDisabled")}),"warning"); + } } d3.event.preventDefault(); } @@ -2482,10 +2493,10 @@ RED.view = (function() { thisNode.selectAll(".fa-lg").attr("y",function(d){return (d.h+13)/2;}); thisNode.selectAll(".node_button").attr("opacity",function(d) { - return (activeSubflow||!isButtonEnabled(d))?0.4:1 + return (!isButtonEnabled(d))?0.4:1 }); thisNode.selectAll(".node_button_button").attr("cursor",function(d) { - return (activeSubflow||!isButtonEnabled(d))?"":"pointer"; + return (!isButtonEnabled(d))?"":"pointer"; }); thisNode.selectAll(".node_button").attr("transform",function(d){ var x = d._def.align == "right"?d.w-6:-25; 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 af58757d7..fffe21e65 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 @@ -108,7 +108,7 @@ RED.workspaces = (function() { workspace.info = info; } $("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled); - // $("#workspace").toggleClass("workspace-disabled",workspace.disabled); + $("#workspace").toggleClass("workspace-disabled",workspace.disabled); if (changed) { var historyEvent = { @@ -125,6 +125,14 @@ RED.workspaces = (function() { if (!selection.nodes && !selection.links) { RED.sidebar.info.refresh(workspace); } + if (changes.hasOwnProperty('disabled')) { + RED.nodes.eachNode(function(n) { + if (n.z === workspace.id) { + n.dirty = true; + } + }); + RED.view.redraw(); + } } RED.tray.close(); } @@ -249,6 +257,7 @@ RED.workspaces = (function() { // $("#workspace").toggleClass("workspace-disabled",tab.disabled); RED.events.emit("workspace:change",event); window.location.hash = 'flow/'+tab.id; + $("#workspace").toggleClass("workspace-disabled",tab.disabled); RED.sidebar.config.refresh(); RED.view.focus(); }, diff --git a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss index 2608c8d43..de86a3f4c 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss @@ -169,7 +169,16 @@ .node_subflow .node { stroke-dasharray:8, 3; } - +.workspace-disabled { + .link_line { + stroke-dasharray: 10,5 !important; + stroke-width: 2 !important; + stroke: $link-subflow-color; + } + .node { + stroke-dasharray: 10,4; + } +} .node_quickadd * { stroke-dasharray: 12,3;