From 6310de0d2083612db3c3819c597662ce0fd0039c Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Wed, 17 Jan 2018 19:08:58 +0900 Subject: [PATCH] Initial support of sequence rules for SWITCH node (#1545) * new UI for parts support of SWITCH node * update UI of SWITCH node for parts support * add server side code of new SWITCH node * update info document of SWITCH node * add tests for new SWITCH node features * add test for too many pending messages & related fixes * fix handling when msg is undefined * tabs -> spaces * fixed meaning of "repair sequence" in SWITCH node docs * add a note on restricting internally kept messages * change label and position in menu of "pos. between" rule * fixed typos (again, sorry) --- nodes/core/locales/en-US/messages.json | 10 +- nodes/core/logic/10-switch.html | 211 ++++++++++++++++++++--- nodes/core/logic/10-switch.js | 199 +++++++++++++++++++++- settings.js | 1 + test/nodes/core/logic/10-switch_spec.js | 212 ++++++++++++++++++++++++ 5 files changed, 606 insertions(+), 27 deletions(-) diff --git a/nodes/core/locales/en-US/messages.json b/nodes/core/locales/en-US/messages.json index 787571a56..3d07b0c33 100644 --- a/nodes/core/locales/en-US/messages.json +++ b/nodes/core/locales/en-US/messages.json @@ -541,7 +541,8 @@ "switch": { "label": { "property": "Property", - "rule": "rule" + "rule": "rule", + "repair" : "repair sequence (reconstruct parts property of outgoing messages)" }, "and": "and", "checkall": "checking all rules", @@ -555,10 +556,15 @@ "false":"is false", "null":"is null", "nnull":"is not null", + "head":"head", + "tail":"tail", + "index":"is between", + "exp":"JSONata exp", "else":"otherwise" }, "errors": { - "invalid-expr": "Invalid JSONata expression: __error__" + "invalid-expr": "Invalid JSONata expression: __error__", + "too-many" : "too many pending messages in switch node" } }, "change": { diff --git a/nodes/core/logic/10-switch.html b/nodes/core/logic/10-switch.html index 553bdbbf6..5a39c2bee 100644 --- a/nodes/core/logic/10-switch.html +++ b/nodes/core/logic/10-switch.html @@ -33,6 +33,10 @@ +
+ + +