From 4fda59a5858b1a40aef5474a1d3f3b17d02aa830 Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Fri, 10 Feb 2023 16:49:29 +0900 Subject: [PATCH 1/2] Add validator for complete node --- .../@node-red/nodes/core/common/24-complete.html | 11 ++++++++++- .../@node-red/nodes/locales/en-US/messages.json | 5 ++++- .../@node-red/nodes/locales/ja/messages.json | 5 ++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/24-complete.html b/packages/node_modules/@node-red/nodes/core/common/24-complete.html index b2d406bb5..2f68a0fcf 100644 --- a/packages/node_modules/@node-red/nodes/core/common/24-complete.html +++ b/packages/node_modules/@node-red/nodes/core/common/24-complete.html @@ -18,7 +18,16 @@ color:"#c0edc0", defaults: { name: {value:""}, - scope: {value:[], type:"*[]"}, + scope: { + value: [], + type: "*[]", + validate: function (v, opt) { + if (v.length > 0) { + return true; + } + return RED._("node-red:complete.errors.scopeUndefined"); + } + }, uncaught: {value:false} }, inputs:0, diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index 7fcd5eadc..a683b1552 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -119,7 +119,10 @@ } }, "complete": { - "completeNodes": "complete: __number__" + "completeNodes": "complete: __number__", + "errors": { + "scopeUndefined": "scope undefined" + } }, "debug": { "output": "Output", diff --git a/packages/node_modules/@node-red/nodes/locales/ja/messages.json b/packages/node_modules/@node-red/nodes/locales/ja/messages.json index b7fa20b02..cc93e92b1 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/ja/messages.json @@ -119,7 +119,10 @@ } }, "complete": { - "completeNodes": "complete: __number__" + "completeNodes": "complete: __number__", + "errors": { + "scopeUndefined": "スコープが未定義" + } }, "debug": { "output": "対象", From 81331e68d2e4a64c24b22feb59e97e1ad8a2281f Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Fri, 10 Feb 2023 18:55:10 +0900 Subject: [PATCH 2/2] Add validator for link call node --- .../@node-red/nodes/core/common/60-link.html | 13 +++++++++++-- .../@node-red/nodes/core/common/60-link.js | 4 ++-- .../@node-red/nodes/locales/en-US/messages.json | 5 +++-- .../@node-red/nodes/locales/ja/messages.json | 5 +++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/60-link.html b/packages/node_modules/@node-red/nodes/core/common/60-link.html index 4b8c9a3d6..5c16929c3 100644 --- a/packages/node_modules/@node-red/nodes/core/common/60-link.html +++ b/packages/node_modules/@node-red/nodes/core/common/60-link.html @@ -1,4 +1,3 @@ -