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

change user prop name for injected values

- less chance for collision
This commit is contained in:
Steve-Mcl 2021-05-20 22:35:42 +01:00
parent bae6bfc32d
commit 9d7b8f1f2f
2 changed files with 5 additions and 5 deletions

View File

@ -750,7 +750,7 @@
var items = $('#node-inject-custom-list').editableList('items');
var result = getProps(items);
if (result && result.props && result.props.length) {
m = { __customProps: result.props };
m = { __user_inject_props__: result.props };
}
doInject(m);
//RED.tray.close();

View File

@ -101,10 +101,10 @@ module.exports = function(RED) {
this.on("input", function(msg, send, done) {
var errors = [];
var props = this.props;
if(msg.__customProps && Array.isArray(msg.__customProps)) {
props = msg.__customProps;
if(msg.__user_inject_props__ && Array.isArray(msg.__user_inject_props__)) {
props = msg.__user_inject_props__;
}
delete msg.__customProps;
delete msg.__user_inject_props__;
props.forEach(p => {
var property = p.p;
var value = p.v ? p.v : '';
@ -160,7 +160,7 @@ module.exports = function(RED) {
var node = RED.nodes.getNode(req.params.id);
if (node != null) {
try {
if (req.body && req.body.__customProps) {
if (req.body && req.body.__user_inject_props__) {
node.receive(req.body);
} else {
node.receive();