Skip to content

Commit 47b24c6

Browse files
authored
[bugfix] Invalidate cache before starting a study (#1602)
* Do not allow negative node positions * Before starting a study, make sure the latest version is fetched
1 parent 3adbfa4 commit 47b24c6

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", {
265265
position.x = 50 + farthestRight;
266266
position.y = 200;
267267
}
268-
nodeUI.getNode().setPosition(position.x, position.y);
269-
nodeUI.moveTo(position.x, position.y);
268+
const node = nodeUI.getNode();
269+
node.setPosition(position.x, position.y);
270+
nodeUI.moveTo(node.getPosition().x, node.getPosition().y);
270271
this.__addWindowToDesktop(nodeUI);
271272
this.__nodesUI.push(nodeUI);
272273

services/web/client/source/class/osparc/dashboard/ExploreBrowser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ qx.Class.define("osparc.dashboard.ExploreBrowser", {
207207
__createServicesLayout: function() {
208208
const servicesContainer = this.__servicesContainer = this.__createResourceListLayout();
209209
osparc.utils.Utils.setIdToWidget(servicesContainer, "servicesList");
210-
const servicesLayout = this.__createButtonsLayout(this.tr("Apps"), servicesContainer);
210+
const servicesLayout = this.__createButtonsLayout(this.tr("Services"), servicesContainer);
211211

212212
const servicesTitleContainer = servicesLayout.getTitleBar();
213213
this.__addNewServiceButtons(servicesTitleContainer);

services/web/client/source/class/osparc/dashboard/StudyBrowser.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,16 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
324324

325325
__startStudy: function(studyData) {
326326
this.__showLoadingPage(this.tr("Starting ") + (studyData.name || this.tr("Study")));
327-
osparc.store.Store.getInstance().getServicesDAGs()
328-
.then(() => {
327+
328+
// Before starting a study, make sure the latest version is fetched
329+
const promises = [
330+
osparc.store.Store.getInstance().getStudyWState(studyData.uuid, true),
331+
osparc.store.Store.getInstance().getServicesDAGs()
332+
];
333+
Promise.all(promises)
334+
.then(values => {
329335
this.__hideLoadingPage();
336+
studyData = values[0];
330337
this.__loadStudy(studyData);
331338
});
332339
},

services/web/client/source/class/osparc/data/Resources.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("osparc.data.Resources", {
6868
* STUDIES
6969
*/
7070
"studies": {
71-
useCache: true,
71+
useCache: false,
7272
endpoints: {
7373
get: {
7474
method: "GET",

services/web/client/source/class/osparc/data/model/Node.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,9 @@ qx.Class.define("osparc.data.model.Node", {
11161116
},
11171117

11181118
setPosition: function(x, y) {
1119-
this.__posX = parseInt(x);
1120-
this.__posY = parseInt(y);
1119+
// keep positions positive
1120+
this.__posX = parseInt(x) < 0 ? 0 : parseInt(x);
1121+
this.__posY = parseInt(y) < 0 ? 0 : parseInt(y);
11211122
},
11221123

11231124
getPosition: function() {

services/web/client/source/class/osparc/desktop/StudyEditor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
2323
construct: function() {
2424
this.base(arguments, "horizontal");
2525

26-
const mainPanel = this.__mainPanel = new osparc.desktop.MainPanel();
2726
const sidePanel = this.__sidePanel = new osparc.desktop.SidePanel().set({
2827
minWidth: 0,
2928
width: 400
@@ -35,6 +34,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
3534
scroll.add(sidePanel);
3635

3736
this.add(scroll, 0); // flex 0
37+
38+
const mainPanel = this.__mainPanel = new osparc.desktop.MainPanel();
3839
this.add(mainPanel, 1); // flex 1
3940

4041
this.__attachEventHandlers();

0 commit comments

Comments
 (0)