diff --git a/editor/js/ui/deploy.js b/editor/js/ui/deploy.js index b967f4db8..63305d2c2 100644 --- a/editor/js/ui/deploy.js +++ b/editor/js/ui/deploy.js @@ -97,113 +97,6 @@ RED.deploy = (function() { RED.actions.add("core:deploy-flows",save); - $( "#node-dialog-confirm-deploy" ).dialog({ - title: RED._('deploy.confirm.button.confirm'), - modal: true, - autoOpen: false, - width: 550, - height: "auto", - buttons: [ - { - text: RED._("common.label.cancel"), - click: function() { - $( this ).dialog( "close" ); - } - }, - { - id: "node-dialog-confirm-deploy-review", - text: RED._("deploy.confirm.button.review"), - class: "primary disabled", - click: function() { - if (!$("#node-dialog-confirm-deploy-review").hasClass('disabled')) { - RED.diff.showRemoteDiff(); - $( this ).dialog( "close" ); - } - } - }, - { - id: "node-dialog-confirm-deploy-merge", - text: RED._("deploy.confirm.button.merge"), - class: "primary disabled", - click: function() { - RED.diff.mergeDiff(currentDiff); - $( this ).dialog( "close" ); - } - }, - { - id: "node-dialog-confirm-deploy-deploy", - text: RED._("deploy.confirm.button.confirm"), - class: "primary", - click: function() { - - var ignoreChecked = $( "#node-dialog-confirm-deploy-hide" ).prop("checked"); - if (ignoreChecked) { - ignoreDeployWarnings[$( "#node-dialog-confirm-deploy-type" ).val()] = true; - } - save(true,/conflict/.test($("#node-dialog-confirm-deploy-type" ).val())); - $( this ).dialog( "close" ); - } - }, - { - id: "node-dialog-confirm-deploy-overwrite", - text: RED._("deploy.confirm.button.overwrite"), - class: "primary", - click: function() { - save(true,/conflict/.test($("#node-dialog-confirm-deploy-type" ).val())); - $( this ).dialog( "close" ); - } - } - ], - create: function() { - $("#node-dialog-confirm-deploy").parent().find("div.ui-dialog-buttonpane") - .prepend('
').text(RED._('deploy.confirm.backgroundUpdate')); activeNotifyMessage = RED.notify(message,{ + modal: true, fixed: true, buttons: [ { @@ -276,14 +170,93 @@ RED.deploy = (function() { } function resolveConflict(currentNodes, activeDeploy) { - $( "#node-dialog-confirm-deploy-config" ).hide(); - $( "#node-dialog-confirm-deploy-unknown" ).hide(); - $( "#node-dialog-confirm-deploy-unused" ).hide(); - $( "#node-dialog-confirm-deploy-conflict" ).show(); - $( "#node-dialog-confirm-deploy-type" ).val(activeDeploy?"deploy-conflict":"background-conflict"); - $( "#node-dialog-confirm-deploy" ).dialog( "open" ); - } + var message = $('
"+RED._('deploy.confirm.unknown')+"
"+ + '"+ + RED._('deploy.confirm.confirm')+ + "
"; + + notificationButtons= [ + { + id: "node-dialog-confirm-deploy-deploy", + text: RED._("deploy.confirm.button.confirm"), + class: "primary", + click: function() { + save(true); + notification.close(); + } + } + ]; } else if (hasInvalid && !ignoreDeployWarnings.invalid) { showWarning = true; - $( "#node-dialog-confirm-deploy-type" ).val("invalid"); - $( "#node-dialog-confirm-deploy-config" ).show(); invalidNodes.sort(sortNodeInfo); - $( "#node-dialog-confirm-deploy-invalid-list" ) - .html(""+RED._('deploy.confirm.improperlyConfigured')+"
"+ + '"+ + RED._('deploy.confirm.confirm')+ + "
"; + notificationButtons= [ + { + id: "node-dialog-confirm-deploy-deploy", + text: RED._("deploy.confirm.button.confirm"), + class: "primary", + click: function() { + save(true); + notification.close(); + } + } + ]; } if (showWarning) { - $( "#node-dialog-confirm-deploy-hide" ).prop("checked",false); - $( "#node-dialog-confirm-deploy" ).dialog( "open" ); + notificationButtons.unshift( + { + text: RED._("common.label.cancel"), + click: function() { + notification.close(); + } + } + ); + notification = RED.notify(notificationMessage,{ + modal: true, + fixed: true, + buttons:notificationButtons + }); return; } } @@ -391,7 +387,7 @@ RED.deploy = (function() { ''+RED._("deploy.successfulDeploy")+'
'+ ''+RED._("deploy.unusedConfigNodes")+' '+RED._("deploy.unusedConfigNodesLink")+'
',"success",false,6000); } else { - RED.notify(RED._("deploy.successfulDeploy"),"success"); + RED.notify(''+RED._("deploy.successfulDeploy")+'
',"success"); } RED.nodes.eachNode(function(node) { if (node.changed) { diff --git a/editor/js/ui/notifications.js b/editor/js/ui/notifications.js index bee1e9e10..a9e1f387b 100644 --- a/editor/js/ui/notifications.js +++ b/editor/js/ui/notifications.js @@ -74,6 +74,16 @@ RED.notifications = (function() { if (type) { n.className = "notification notification-"+type; } + if (options.width) { + var parentWidth = $("#notifications").width(); + if (options.width > parentWidth) { + var margin = -(options.width-parentWidth)/2; + $(n).css({ + width: options.width+"px", + marginLeft: margin+"px" + }) + } + } n.style.display = "none"; if (typeof msg === "string") { n.innerHTML = msg; @@ -84,6 +94,9 @@ RED.notifications = (function() { var buttonSet = $('').appendTo(n) options.buttons.forEach(function(buttonDef) { var b = $('