From 7a6e1fe56618e0b43c3356c4601ea35b57234d98 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 18 Jan 2019 21:42:13 +0000 Subject: [PATCH] Check for undeployed change before showing open project dialog --- .../editor-client/src/js/ui/projects/projects.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js index 69f42c282..928ab5202 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projects.js @@ -1601,7 +1601,6 @@ RED.projects = (function() { sendRequest({ url: "projects/"+name, type: "PUT", - requireCleanWorkspace: true, responses: { 200: function(data) { done(null,data); @@ -2359,7 +2358,15 @@ RED.projects = (function() { RED.notify(RED._("user.errors.notAuthorized"),"error"); return; } - show('create',{screen:'open'}) + if (RED.nodes.dirty()) { + return requireCleanWorkspace(function(cancelled) { + if (!cancelled) { + show('create',{screen:'open'}) + } + }) + } else { + show('create',{screen:'open'}) + } }, showCredentialsPrompt: function() { //TODO: rename this function if (!RED.user.hasPermission("projects.write")) {