1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
Commit Graph

74 Commits

Author SHA1 Message Date
Nick O'Leary
5c06761b1a
Remove console.log from subflow 2020-03-30 23:42:30 +01:00
Nick O'Leary
84771f5864
Flows/subflows must preinitialise their context objects
Fixes #2513

If a node inside a subflow accessed its context object in its
constructor, the subflow-instance flow context would not yet
have been created. This would cause a place holder context
to get created on its behalf, but that place holder doesn't
have its parent set properly. This then breaks the usage
of $parent inside such a subflow.

This fix has changed it so flows (and subflows) create their
flow context as part of their initial creation. That ensures
it exists when individual nodes from the subflow are created,
allowing them to safely access their context.

This has also fixed a related issue where any attempt to use
$parent to access beyond the root parent would seemingly hang
as the callback was never being called. This would cause
messages to get stuck in flows. The fix ensures the callback
is used in the root context objects and undefined is returned.
2020-03-27 23:47:12 +00:00
Nick O'Leary
4304d44851
Ensure complete node scope is remapped in subflows
Fixes #2514
2020-03-27 09:44:15 +00:00
Nick O'Leary
1830478ec3
Merge pull request #2461 from node-red/set-flow-with-creds
Allow credentials to be provided as part of /flows api
2020-02-24 16:22:57 +00:00
Nick O'Leary
d6b5494625
Allow credentials to be provided as part of /flows api 2020-02-13 16:44:48 +00:00
Nick O'Leary
80d100f3f9
Move receive metric position to better reflect async changes
Fixes #2444
2020-02-07 16:49:41 +00:00
Nick O'Leary
7d32636133
Improve file store error when cache disabled and sync api used
Closes #2406
2020-02-07 14:26:30 +00:00
Nick O'Leary
95a51aafdc
Add path property to debug messages
Fixes #2358

This property can be used to identify the full path to the node that
logged a given message. If the node is inside a subflow (and maybe
nested many levels deep), this path can be used to help find the
node, rather than just the top-level subflow instance node.

A side-effect of this change is the Debug sidebar is now able to
show the message tools for a message coming from a deeply nested
subflow
2020-01-17 16:56:30 +00:00
Dave Conway-Jones
2f4dcba54d
let subflow add node-red context to status
For all those nodes thaht don't specify it.
So that subflow status then works ok
2019-11-20 06:12:33 -05:00
TJKoury
cb8deab1f9
Update packages/node_modules/@node-red/runtime/lib/nodes/Node.js
Co-Authored-By: Nick O'Leary <nick.oleary@gmail.com>
2019-10-17 07:42:11 -04:00
TJKoury
e5c27d0236
Remove msg
`msg` not defined in scope.
2019-10-16 20:00:11 -04:00
Nick O'Leary
c1c694035d
Allow node.status() to be passed number/bool types
Adds to the existing support for string types. Also
adds unit tests for all three cases
2019-10-14 13:06:59 +01:00
Nick O'Leary
547e7a1b21
Allow node emitted events to have multiple arguments
This is fixing a regression introduced in 1.0 where a custom
`Node.emit` function was added that could only handle a single
argument.
2019-10-10 16:35:12 +01:00
Nick O'Leary
10077ae750
Use a more atomic process for writing context files
Fixes #2271
2019-08-21 16:54:26 +01:00
Nick O'Leary
b734097d16
Merge pull request #2227 from node-red/node-done
Adds Done callback to Input event handler
2019-08-21 11:15:00 +01:00
Nick O'Leary
880757fb5d
Rework Subflow Instance property UI (#2236)
* Add support of Subflow UI definition

* new UI definition for env var

* fix label

* fixed value obtaining

* fixed label width

* fix checkbox

* fix subflow info

* remove old subflow ui tests

* add tests

* merge ui new changes

* fix initial open button

* fix environment variable edit tab

* WIP: cp-1

* Rework subflow ui property

* Restrict SF value type according to input selection

* Move subflow property UI code to subflow.js

* Update subflow ui type select appearance

* Present subflow instance properties as table rather than generated UI

* Move subflow instance properties to separate tab

* Fix subflow property ui element layout issues
2019-08-12 15:01:54 +01:00
Nick O'Leary
e5255b0c7c
Ensure 2nd arg to node.error is an object
Fixes #2228
2019-08-12 14:36:26 +01:00
Nick O'Leary
7926055b97
Merge branch 'master' into dev 2019-08-06 16:10:33 +01:00
Nick O'Leary
9b938f6515
Fix default value handling on context array access
Fixes #2252
2019-08-06 15:55:25 +01:00
Nick O'Leary
fb9828badc
Update Function node to add node.done 2019-08-06 14:27:56 +01:00
Nick O'Leary
f52289b2c3
Add send to input handler signature 2019-07-09 11:40:55 +01:00
Nick O'Leary
3b5ea0f15f
Add node done API 2019-07-08 23:23:33 +01:00
Nick O'Leary
24b38407e4
Merge branch 'master' into dev 2019-07-01 12:43:16 +01:00
Nick O'Leary
f49d1ae860
Ensure the subflow stop promise is waiting for before restarting 2019-07-01 12:42:11 +01:00
Nick O'Leary
a941b1437c
Handle subflow internal node wired to a non-existant node
Fixes #2202
2019-06-21 12:47:37 +01:00
Nick O'Leary
2473249c8b
Allow config nodes to be disabled, tidy css and add actions 2019-06-17 22:46:34 +01:00
Nick O'Leary
41a0af032c
Enable individual flow nodes to be disabled 2019-06-14 22:12:47 +01:00
Nick O'Leary
ae2162beaf
Handle subflow internal node wired to a non-existant node
Fixes #2202
2019-06-13 14:23:46 +01:00
Dave Conway-Jones
0c13603185
let status be simple text if wanted 2019-04-07 16:23:17 +01:00
Nick O'Leary
ee6c6266cc
Avoid env var reference loops and support $parent. prefix
Fixes #2099
2019-03-20 13:37:33 +00:00
Nick O'Leary
962a29110c
Ensure config._flow is non-enumerable so is ignored by JSON.stringify
Fixes  https://github.com/pdmangel/node-red-contrib-openhab2/issues/36
2019-03-18 15:11:56 +00:00
Nick O'Leary
afa69f4c0e
Ensure all subflow instances are stopped when flow stopping
Fixes #2095
2019-03-15 09:13:32 +00:00
Nick O'Leary
c9ff05ba80
Subflow status node must pass status to parent flow
Fixes #2087
2019-03-13 13:14:34 +00:00
Nick O'Leary
c944eaab5c
Fix max call stack err when getting node from inside subflow 2019-03-12 14:40:47 +00:00
Nick O'Leary
d3d9533493
Search subflows instances when looking for given node id 2019-03-12 14:25:36 +00:00
Nick O'Leary
28e08ebaf5
Add envVarExcludes setting to block named env vars 2019-03-07 22:54:20 +00:00
Nick O'Leary
4463a8e3b2
Add exportGlobalContextKeys to prevent exposing fgc keys 2019-03-04 16:10:39 +00:00
Nick O'Leary
8fb6bc059e
Pass complete status to Status node and filter to editor 2019-03-04 10:23:10 +00:00
Nick O'Leary
f4f664a4a2
Ensure flows wait for all nodes to close before restarting
Fixes #2067
2019-02-27 20:56:58 +00:00
Nick O'Leary
75393c0b28
Clear subflow status no close 2019-02-09 21:24:31 +00:00
Nick O'Leary
6e944485f0
Merge pull request #2030 from node-red-hitachi/scope-parent
Allow access of scope parent
2019-02-06 14:10:57 +00:00
Nick O'Leary
d48a09e68b
Add env type to subflow env var types
Also remove date and regex types
2019-02-06 13:58:31 +00:00
Nick O'Leary
79f3669fac
Add 'catch uncaught only' mode to Catch node
Closes #1747

This was inspired by a PR from @mauriciom75 but implemented in a different way
due to some of the internal reworking done to Flow and Subflow in the dev branch
2019-02-05 14:29:50 +00:00
Hiroyasu Nishiyama
723e9b3cba make $parent access without key return undefined 2019-02-05 14:47:30 +09:00
Nick O'Leary
5110eaff96
Merge branch 'dev' into pr_2042 2019-02-04 14:39:00 +00:00
Nick O'Leary
db3eee72b5
Do not convert falsey env vars to blank string
Only blank out undefined as that's what we've always done
2019-02-04 14:12:34 +00:00
Nick O'Leary
3bcff91328
Add Status Node to Subflow to allow subflow-specific status
Closes #597
2019-02-01 23:44:50 +00:00
Hiroyasu Nishiyama
e843f192ec convert subflow env vars to dict 2019-02-02 08:34:33 +09:00
Hiroyasu Nishiyama
ce507b3b52 simplified meta-data 2019-01-30 20:57:51 +09:00
Nick O'Leary
85de227003
Make Node._flow a writeable property
This is needed so an existing node constructor that does:

   Object.assign(this,config);

works when it tries to replace this._flow with config._flow.
2019-01-30 10:50:29 +00:00