From 80d514187e5f9254c95c8206fb76ba727e248d66 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jul 2020 15:45:20 +0200 Subject: [PATCH 1/5] Do not allow negative node positions --- .../source/class/osparc/component/workbench/WorkbenchUI.js | 5 +++-- services/web/client/source/class/osparc/data/model/Node.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js b/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js index 4a54b281d4f..129ae74d02d 100644 --- a/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js +++ b/services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js @@ -265,8 +265,9 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", { position.x = 50 + farthestRight; position.y = 200; } - nodeUI.getNode().setPosition(position.x, position.y); - nodeUI.moveTo(position.x, position.y); + const node = nodeUI.getNode(); + node.setPosition(position.x, position.y); + nodeUI.moveTo(node.getPosition().x, node.getPosition().y); this.__addWindowToDesktop(nodeUI); this.__nodesUI.push(nodeUI); diff --git a/services/web/client/source/class/osparc/data/model/Node.js b/services/web/client/source/class/osparc/data/model/Node.js index 22334d0baf6..96b88ef7874 100644 --- a/services/web/client/source/class/osparc/data/model/Node.js +++ b/services/web/client/source/class/osparc/data/model/Node.js @@ -1116,8 +1116,9 @@ qx.Class.define("osparc.data.model.Node", { }, setPosition: function(x, y) { - this.__posX = parseInt(x); - this.__posY = parseInt(y); + // keep positions positive + this.__posX = parseInt(x) < 0 ? 0 : parseInt(x); + this.__posY = parseInt(y) < 0 ? 0 : parseInt(y); }, getPosition: function() { From 124d90cce6951b0529c79a54d8b33fce02445f83 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jul 2020 17:46:21 +0200 Subject: [PATCH 2/5] minor --- .../web/client/source/class/osparc/dashboard/ExploreBrowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/client/source/class/osparc/dashboard/ExploreBrowser.js b/services/web/client/source/class/osparc/dashboard/ExploreBrowser.js index 7d12f10d405..e7a27043acd 100644 --- a/services/web/client/source/class/osparc/dashboard/ExploreBrowser.js +++ b/services/web/client/source/class/osparc/dashboard/ExploreBrowser.js @@ -206,7 +206,7 @@ qx.Class.define("osparc.dashboard.ExploreBrowser", { __createServicesLayout: function() { const servicesContainer = this.__servicesContainer = this.__createResourceListLayout(); osparc.utils.Utils.setIdToWidget(servicesContainer, "servicesList"); - const servicesLayout = this.__createButtonsLayout(this.tr("Apps"), servicesContainer); + const servicesLayout = this.__createButtonsLayout(this.tr("Services"), servicesContainer); const servicesTitleContainer = servicesLayout.getTitleBar(); this.__addNewServiceButtons(servicesTitleContainer); From 082ec35cebd7b3f61ddd3c58a918055cc973f6e5 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jul 2020 17:47:19 +0200 Subject: [PATCH 3/5] Before starting a study, make sure the latest version is fetched --- .../source/class/osparc/dashboard/StudyBrowser.js | 11 +++++++++-- .../web/client/source/class/osparc/data/Resources.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/services/web/client/source/class/osparc/dashboard/StudyBrowser.js b/services/web/client/source/class/osparc/dashboard/StudyBrowser.js index ef30b74ec18..6bfaac510ca 100644 --- a/services/web/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/web/client/source/class/osparc/dashboard/StudyBrowser.js @@ -323,9 +323,16 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { __startStudy: function(studyData) { this.__showLoadingPage(this.tr("Starting ") + (studyData.name || this.tr("Study"))); - osparc.store.Store.getInstance().getServicesDAGs() - .then(() => { + + // Before starting a study, make sure the latest version is fetched + const promises = [ + osparc.store.Store.getInstance().getStudyWState(studyData.uuid, true), + osparc.store.Store.getInstance().getServicesDAGs() + ]; + Promise.all(promises) + .then(values => { this.__hideLoadingPage(); + studyData = values[0]; this.__loadStudy(studyData); }); }, diff --git a/services/web/client/source/class/osparc/data/Resources.js b/services/web/client/source/class/osparc/data/Resources.js index d33faec0161..beaa7755034 100644 --- a/services/web/client/source/class/osparc/data/Resources.js +++ b/services/web/client/source/class/osparc/data/Resources.js @@ -68,7 +68,7 @@ qx.Class.define("osparc.data.Resources", { * STUDIES */ "studies": { - useCache: true, + useCache: false, endpoints: { get: { method: "GET", From d346138bcd074de0d03268518c32ace0c09c4468 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jul 2020 17:47:24 +0200 Subject: [PATCH 4/5] minor --- .../web/client/source/class/osparc/desktop/StudyEditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/client/source/class/osparc/desktop/StudyEditor.js b/services/web/client/source/class/osparc/desktop/StudyEditor.js index 650678073cd..2d09139902a 100644 --- a/services/web/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/web/client/source/class/osparc/desktop/StudyEditor.js @@ -23,18 +23,19 @@ qx.Class.define("osparc.desktop.StudyEditor", { construct: function() { this.base(arguments, "horizontal"); - const mainPanel = this.__mainPanel = new osparc.desktop.MainPanel(); const sidePanel = this.__sidePanel = new osparc.desktop.SidePanel().set({ minWidth: 0, width: 400 }); - osparc.utils.Utils.addBorder(sidePanel, 2, "right"); + // osparc.utils.Utils.addBorder(sidePanel, 2, "right"); const scroll = this.__scrollContainer = new qx.ui.container.Scroll().set({ minWidth: 0 }); scroll.add(sidePanel); this.add(scroll, 0); // flex 0 + + const mainPanel = this.__mainPanel = new osparc.desktop.MainPanel(); this.add(mainPanel, 1); // flex 1 this.__attachEventHandlers(); From 4fb01e1a1d253ed8ec2ebd64c1b677e5e053a0a9 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 3 Jul 2020 17:50:59 +0200 Subject: [PATCH 5/5] minor --- services/web/client/source/class/osparc/desktop/StudyEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/client/source/class/osparc/desktop/StudyEditor.js b/services/web/client/source/class/osparc/desktop/StudyEditor.js index 2d09139902a..7d3da0450a9 100644 --- a/services/web/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/web/client/source/class/osparc/desktop/StudyEditor.js @@ -27,7 +27,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { minWidth: 0, width: 400 }); - // osparc.utils.Utils.addBorder(sidePanel, 2, "right"); + osparc.utils.Utils.addBorder(sidePanel, 2, "right"); const scroll = this.__scrollContainer = new qx.ui.container.Scroll().set({ minWidth: 0 });