diff --git a/nodes/core/core/98-unknown.html b/nodes/core/core/98-unknown.html index 5b96eae9a..19a4ad59b 100644 --- a/nodes/core/core/98-unknown.html +++ b/nodes/core/core/98-unknown.html @@ -15,35 +15,35 @@ --> diff --git a/public/index.html b/public/index.html index 5f5ba484c..49fcc0d08 100644 --- a/public/index.html +++ b/public/index.html @@ -151,9 +151,14 @@
-
+
Some of the nodes are not properly configured. Are you sure you want to deploy?
+
+ The workspace contains some unknown node types: +
    + Are you sure you want to deploy? +
    diff --git a/public/red/main.js b/public/red/main.js index ff069abeb..fb1c98ccc 100644 --- a/public/red/main.js +++ b/public/red/main.js @@ -22,14 +22,26 @@ var RED = function() { if (!force) { var invalid = false; + var unknownNodes = []; RED.nodes.eachNode(function(node) { invalid = invalid || !node.valid; if (node.type === "unknown") { - RED.notify('Unknown node type '+node.name+' found',"error"); + if (unknownNodes.indexOf(node.name) == -1) { + unknownNodes.push(node.name); + } invalid = true; } }); if (invalid) { + if (unknownNodes.length > 0) { + $( "#node-dialog-confirm-deploy-config" ).hide(); + $( "#node-dialog-confirm-deploy-unknown" ).show(); + var list = "
  • "+unknownNodes.join("
  • ")+"
  • "; + $( "#node-dialog-confirm-deploy-unknown-list" ).html(list); + } else { + $( "#node-dialog-confirm-deploy-config" ).show(); + $( "#node-dialog-confirm-deploy-unknown" ).hide(); + } $( "#node-dialog-confirm-deploy" ).dialog( "open" ); return; } diff --git a/public/red/nodes.js b/public/red/nodes.js index 28e5f16d7..39e1a08ea 100644 --- a/public/red/nodes.js +++ b/public/red/nodes.js @@ -222,20 +222,26 @@ RED.nodes = function() { if (!$.isArray(newNodes)) { newNodes = [newNodes]; } + var unknownTypes = []; for (var i in newNodes) { var n = newNodes[i]; // TODO: remove workspace in next release+1 if (n.type != "workspace" && n.type != "tab" && !getType(n.type)) { // TODO: get this UI thing out of here! (see below as well) - //return null; // - n.name = "( "+n.type+" )"; // DCJ - mod to make it load, but will lose all "self knowledge". - n.type = "unknown"; // - } // - if (n.type == "unknown") { // - RED.notify("Failed to import node: unrecognised type '"+n.name+"'
    DO NOT DEPLOY while in this state.
    Either, add missing types to Node-RED, restart and then reload page,
    or delete unknown "+n.name+", rewire as required, and then deploy.","error"); - } // - + n.name = n.type; + n.type = "unknown"; + if (unknownTypes.indexOf(n.name)==-1) { + unknownTypes.push(n.name); + } + } } + if (unknownTypes.length > 0) { + var typeList = ""; + var type = "type"+(unknownTypes.length > 1?"s":""); + RED.notify("Imported unrecognised "+type+":"+typeList,"error",false,10000); + //"DO NOT DEPLOY while in this state.
    Either, add missing types to Node-RED, restart and then reload page,
    or delete unknown "+n.name+", rewire as required, and then deploy.","error"); + } + for (var i in newNodes) { var n = newNodes[i]; // TODO: remove workspace in next release+1 diff --git a/public/red/ui/notifications.js b/public/red/ui/notifications.js index 3150046ed..10e19dbbf 100644 --- a/public/red/ui/notifications.js +++ b/public/red/ui/notifications.js @@ -16,7 +16,7 @@ RED.notify = function() { var currentNotifications = []; var c = 0; - return function(msg,type,fixed) { + return function(msg,type,fixed,timeout) { if (currentNotifications.length > 4) { var ll = currentNotifications.length; for (var i = 0;ll > 4 && i