mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
12 Commits
3.1.0-beta
...
4282-dirty
Author | SHA1 | Date | |
---|---|---|---|
|
2137211d42 | ||
|
f719e5ad49 | ||
|
20557f20db | ||
|
054d6870d5 | ||
|
04aa4897fe | ||
|
72b22a4845 | ||
|
3fd2b5f4e1 | ||
|
8a4128defb | ||
|
97470e94f1 | ||
|
0dd771351d | ||
|
ec86ec188b | ||
|
2b01a3fcd3 |
@@ -1398,6 +1398,7 @@ RED.view = (function() {
|
||||
}
|
||||
historyEvent = {
|
||||
t:'add',
|
||||
dirty: RED.nodes.dirty(),
|
||||
junctions:[nn]
|
||||
}
|
||||
} else {
|
||||
|
@@ -1,17 +1,17 @@
|
||||
export default {
|
||||
version: "3.1.0-beta.4",
|
||||
version: "3.1.0",
|
||||
steps: [
|
||||
{
|
||||
titleIcon: "fa fa-map-o",
|
||||
title: {
|
||||
"en-US": "Welcome to Node-RED 3.1 Beta 4!",
|
||||
"ja": "Node-RED 3.1 ベータ3へようこそ!",
|
||||
"fr": "Bienvenue dans Node-RED 3.1 Bêta 4 !"
|
||||
"en-US": "Welcome to Node-RED 3.1!",
|
||||
"ja": "Node-RED 3.1へようこそ!",
|
||||
"fr": "Bienvenue dans Node-RED 3.1!"
|
||||
},
|
||||
description: {
|
||||
"en-US": "<p>This is the fourth beta release for 3.1.0. This is mostly a bug fix release, so you can skip this tour if you've tried the other betas.</p><p>If not, stick around to see what's new in Node-RED 3.1.</p>",
|
||||
"ja": "<p>これは3.1.0の4回目のベータリリースです。不具合修正のリリースのため、もし他のベータ版を試したことがある場合は、このツアーを読み飛ばしてもかまいません。</p><p>そうでない場合は、Node-RED 3.1の新機能を確認してください。</p>",
|
||||
"fr": "<p>Il s'agit de la quatrième bêta de la version 3.1.0. Cette version apporte principalement la correction de bugs, vous pouvez donc ignorer cette visite guidée si vous avez essayé les autres versions bêta.</p><p>Si ce n'est pas le cas, restez dans les parages pour voir les nouveautés de Node-RED 3.1.</p>"
|
||||
"en-US": "<p>Let's take a moment to discover the new features in this release.</p>",
|
||||
"ja": "<p>本リリースの新機能を見つけてみましょう。</p>",
|
||||
"fr": "<p>Prenons un moment pour découvrir les nouvelles fonctionnalités de cette version.</p>"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -101,18 +101,6 @@ export default {
|
||||
<p>Cliquer dessus ouvrira la barre latérale d'aide affichant l'aide pour ce noeud.</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "And lots more...",
|
||||
"ja": "そしてさらに沢山あります...",
|
||||
"fr": "Et plus encore..."
|
||||
},
|
||||
description: {
|
||||
"en-US": `<p>Of course we have everything from 3.1.0-beta.1 as well....</p>`,
|
||||
"ja": `<p>もちろん3.1.0 ベータ1の全ての機能があります....</p>`,
|
||||
"fr": `<p>Bien sûr, nous avons également tout ce qui concerne la version 3.1.0-beta.1...</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "Improved Context Menu",
|
||||
|
@@ -637,6 +637,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
msg.payload = msg.payload.toString('utf8'); // txt
|
||||
|
||||
if (node.ret === "obj") {
|
||||
if (msg.statusCode == 204){msg.payload= "{}"};
|
||||
try { msg.payload = JSON.parse(msg.payload); } // obj
|
||||
catch(e) { node.warn(RED._("httpin.errors.json-error")); }
|
||||
}
|
||||
|
@@ -68,6 +68,9 @@ module.exports = function(RED) {
|
||||
node.error(err,msg);
|
||||
return done();
|
||||
} else {
|
||||
if (typeof value !== 'string' && value !== null && value !== undefined) {
|
||||
value = value.toString();
|
||||
}
|
||||
processMsg2(msg,nodeSend,value,done);
|
||||
}
|
||||
});
|
||||
@@ -278,7 +281,6 @@ module.exports = function(RED) {
|
||||
}
|
||||
RED.nodes.registerType("file",FileNode);
|
||||
|
||||
|
||||
function FileInNode(n) {
|
||||
// Read a file
|
||||
RED.nodes.createNode(this,n);
|
||||
@@ -314,6 +316,9 @@ module.exports = function(RED) {
|
||||
node.error(err,msg);
|
||||
return done();
|
||||
} else {
|
||||
if (typeof value !== 'string' && value !== null && value !== undefined) {
|
||||
value = value.toString();
|
||||
}
|
||||
processMsg2(msg, nodeSend, (value || "").replace(/\t|\r|\n/g,''), nodeDone);
|
||||
}
|
||||
});
|
||||
|
@@ -667,7 +667,7 @@ describe('HTTP Request Node', function() {
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
try {
|
||||
msg.should.have.property('payload','');
|
||||
msg.should.have.property('payload',{});
|
||||
msg.should.have.property('statusCode',204);
|
||||
done();
|
||||
} catch(err) {
|
||||
|
@@ -173,7 +173,7 @@ describe('JSON node', function() {
|
||||
});
|
||||
logEvents.should.have.length(1);
|
||||
logEvents[0][0].should.have.a.property('msg');
|
||||
logEvents[0][0].msg.should.startWith("Unexpected token o");
|
||||
logEvents[0][0].msg.should.match(/^Unexpected token (o|'o')/);
|
||||
logEvents[0][0].should.have.a.property('level',helper.log().ERROR);
|
||||
done();
|
||||
} catch(err) { done(err) }
|
||||
@@ -199,7 +199,7 @@ describe('JSON node', function() {
|
||||
});
|
||||
logEvents.should.have.length(1);
|
||||
logEvents[0][0].should.have.a.property('msg');
|
||||
logEvents[0][0].msg.should.startWith("Unexpected token o");
|
||||
logEvents[0][0].msg.should.match(/^Unexpected token (o|'o')/);
|
||||
logEvents[0][0].should.have.a.property('level',helper.log().ERROR);
|
||||
done();
|
||||
} catch(err) { done(err) }
|
||||
|
@@ -121,7 +121,6 @@ describe('file Nodes', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should write to a file using RED.settings.fileWorkingDirectory', function(done) {
|
||||
var flow = [{id:"fileNode1", type:"file", name: "fileNode", "filename":relativePathToFile, "appendNewline":false, "overwriteFile":true, wires: [["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper"}];
|
||||
@@ -145,7 +144,6 @@ describe('file Nodes', function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should write multi-byte string to a file', function(done) {
|
||||
var flow = [{id:"fileNode1", type:"file", name: "fileNode", "filename":fileToTest, "appendNewline":false, "overwriteFile":true, wires: [["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper"}];
|
||||
@@ -447,6 +445,31 @@ describe('file Nodes', function() {
|
||||
n1.receive({payload:"typedInput", _user_specified_filename:fileToTest});
|
||||
});
|
||||
});
|
||||
|
||||
it('should support number in msg._user_specified_filename', function (done) {
|
||||
var flow = [{id:"fileNode1", type:"file", filename:"_user_specified_filename", filenameType:"msg", name:"fileNode", "appendNewline":false, "overwriteFile":true, wires:[["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper"}];
|
||||
helper.load(fileNode, flow, function () {
|
||||
RED.settings.fileWorkingDirectory = resourcesDir;
|
||||
var n1 = helper.getNode("fileNode1");
|
||||
var n2 = helper.getNode("helperNode1");
|
||||
n2.on("input", function (msg) {
|
||||
try {
|
||||
var fileToTest = path.join(resourcesDir, "123");
|
||||
var f = fs.readFileSync(fileToTest);
|
||||
f.should.have.length(4);
|
||||
fs.unlinkSync(fileToTest);
|
||||
msg.should.have.property("payload", "test");
|
||||
done();
|
||||
}
|
||||
catch (e) {
|
||||
done(e);
|
||||
}
|
||||
});
|
||||
n1.receive({payload: "test", _user_specified_filename: 123});
|
||||
});
|
||||
});
|
||||
|
||||
it('should use env.TEST_FILE set in nodes typedInput', function(done) {
|
||||
var flow = [{id:"fileNode1", type:"file", filename:"TEST_FILE", filenameType: "env", name: "fileNode", "appendNewline":true, "overwriteFile":true, wires: [["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper"}];
|
||||
|
Reference in New Issue
Block a user