mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
2 Commits
4683-prese
...
fix-subflo
Author | SHA1 | Date | |
---|---|---|---|
|
5485118ae5 | ||
|
c294532152 |
@@ -205,10 +205,9 @@ function genericStrategy(adminApp,strategy) {
|
||||
passport.use(new strategy.strategy(options, verify));
|
||||
|
||||
adminApp.get('/auth/strategy',
|
||||
passport.authenticate(strategy.name, {
|
||||
session:false,
|
||||
passport.authenticate(strategy.name, {session:false,
|
||||
failureMessage: true,
|
||||
failureRedirect: settings.httpAdminRoot + '?session_message=Login Failed'
|
||||
failureRedirect: settings.httpAdminRoot
|
||||
}),
|
||||
completeGenerateStrategyAuth,
|
||||
handleStrategyError
|
||||
@@ -222,7 +221,7 @@ function genericStrategy(adminApp,strategy) {
|
||||
passport.authenticate(strategy.name, {
|
||||
session:false,
|
||||
failureMessage: true,
|
||||
failureRedirect: settings.httpAdminRoot + '?session_message=Login Failed'
|
||||
failureRedirect: settings.httpAdminRoot
|
||||
}),
|
||||
completeGenerateStrategyAuth,
|
||||
handleStrategyError
|
||||
|
@@ -706,11 +706,36 @@ RED.history = (function() {
|
||||
|
||||
}
|
||||
|
||||
function markEventDirty (evt) {
|
||||
// This isn't 100% thorough - just covers the main move/edit/delete cases
|
||||
evt.dirty = true
|
||||
if (evt.multi) {
|
||||
for (let i = 0; i < evt.events.length-1; i++) {
|
||||
markEventDirty(evt.events[i])
|
||||
}
|
||||
} else if (evt.t === 'move') {
|
||||
for (let i=0;i<evt.nodes.length;i++) {
|
||||
evt.nodes[i].moved = true
|
||||
}
|
||||
} else if (evt.t === 'edit') {
|
||||
evt.changed = true
|
||||
} else if (evt.t === 'delete') {
|
||||
if (evt.nodes) {
|
||||
for (let i=0;i<evt.nodes.length;i++) {
|
||||
evt.nodes[i].changed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
//TODO: this function is a placeholder until there is a 'save' event that can be listened to
|
||||
markAllDirty: function() {
|
||||
for (var i=0;i<undoHistory.length;i++) {
|
||||
// A deploy has happened meaning any undo into the history will represent
|
||||
// an undeployed change - regardless of what it was when the event was recorded.
|
||||
// This goes back through the history any marks them all as being dirty events
|
||||
// and also ensures individual node states are marked dirty
|
||||
for (let i=0;i<undoHistory.length;i++) {
|
||||
undoHistory[i].dirty = true;
|
||||
markEventDirty(undoHistory[i])
|
||||
}
|
||||
},
|
||||
list: function() {
|
||||
|
@@ -514,7 +514,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
_monaco.languages.json.jsonDefaults.setDiagnosticsOptions(diagnosticOptions);
|
||||
if(modeConfiguration) { _monaco.languages.json.jsonDefaults.setModeConfiguration(modeConfiguration); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up json options", error)
|
||||
console.warn("monaco - Error setting up json options", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
if(htmlDefaults) { _monaco.languages.html.htmlDefaults.setOptions(htmlDefaults); }
|
||||
if(handlebarDefaults) { _monaco.languages.html.handlebarDefaults.setOptions(handlebarDefaults); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up html options", error)
|
||||
console.warn("monaco - Error setting up html options", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
if(lessDefaults_modeConfiguration) { _monaco.languages.css.cssDefaults.setDiagnosticsOptions(lessDefaults_modeConfiguration); }
|
||||
if(scssDefaults_modeConfiguration) { _monaco.languages.css.cssDefaults.setDiagnosticsOptions(scssDefaults_modeConfiguration); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up CSS/SCSS/LESS options", error)
|
||||
console.warn("monaco - Error setting up CSS/SCSS/LESS options", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2167,9 +2167,9 @@ RED.view = (function() {
|
||||
if (n.ox !== n.n.x || n.oy !== n.n.y || addedToGroup) {
|
||||
// This node has moved or added to a group
|
||||
if (rehomedNodes.has(n)) {
|
||||
moveAndChangedGroupEvent.nodes.push({...n})
|
||||
moveAndChangedGroupEvent.nodes.push({...n, moved: n.n.moved})
|
||||
} else {
|
||||
moveEvent.nodes.push({...n})
|
||||
moveEvent.nodes.push({...n, moved: n.n.moved})
|
||||
}
|
||||
n.n.dirty = true;
|
||||
n.n.moved = true;
|
||||
|
@@ -438,9 +438,10 @@ module.exports = function(RED) {
|
||||
|
||||
//store the error in msg to be used in flows
|
||||
msg.error = err;
|
||||
|
||||
var line = 0;
|
||||
var errorMessage;
|
||||
if (stack.length > 0) {
|
||||
let line = 0;
|
||||
let errorMessage;
|
||||
while (line < stack.length && stack[line].indexOf("ReferenceError") !== 0) {
|
||||
line++;
|
||||
}
|
||||
@@ -454,13 +455,11 @@ module.exports = function(RED) {
|
||||
errorMessage += " (line "+lineno+", col "+cha+")";
|
||||
}
|
||||
}
|
||||
if (errorMessage) {
|
||||
err.message = errorMessage
|
||||
}
|
||||
}
|
||||
// Pass the whole error object so any additional properties
|
||||
// (such as cause) are preserved
|
||||
done(err);
|
||||
if (!errorMessage) {
|
||||
errorMessage = err.toString();
|
||||
}
|
||||
done(errorMessage);
|
||||
}
|
||||
else if (typeof err === "string") {
|
||||
done(err);
|
||||
|
@@ -678,9 +678,6 @@ class Flow {
|
||||
if (logMessage.hasOwnProperty('stack')) {
|
||||
errorMessage.error.stack = logMessage.stack;
|
||||
}
|
||||
if (logMessage.hasOwnProperty('cause')) {
|
||||
errorMessage.error.cause = logMessage.cause;
|
||||
}
|
||||
targetCatchNode.receive(errorMessage);
|
||||
handled = true;
|
||||
});
|
||||
|
@@ -390,8 +390,7 @@ describe('function node', function() {
|
||||
msg.should.have.property('level', helper.log().ERROR);
|
||||
msg.should.have.property('id', 'n1');
|
||||
msg.should.have.property('type', 'function');
|
||||
msg.should.have.property('msg')
|
||||
msg.msg.message.should.equal('ReferenceError: retunr is not defined (line 2, col 1)');
|
||||
msg.should.have.property('msg', 'ReferenceError: retunr is not defined (line 2, col 1)');
|
||||
done();
|
||||
} catch(err) {
|
||||
done(err);
|
||||
@@ -660,8 +659,7 @@ describe('function node', function() {
|
||||
msg.should.have.property('level', helper.log().ERROR);
|
||||
msg.should.have.property('id', name);
|
||||
msg.should.have.property('type', 'function');
|
||||
msg.should.have.property('msg')
|
||||
msg.msg.message.should.equal('Callback must be a function');
|
||||
msg.should.have.property('msg', 'Error: Callback must be a function');
|
||||
done();
|
||||
}
|
||||
catch (e) {
|
||||
|
Reference in New Issue
Block a user