Skip to content

[bugfix] Invalidate cache before starting a study #1602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,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);
});
},
Expand Down
2 changes: 1 addition & 1 deletion services/web/client/source/class/osparc/data/Resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ qx.Class.define("osparc.data.Resources", {
* STUDIES
*/
"studies": {
useCache: true,
useCache: false,
endpoints: {
get: {
method: "GET",
Expand Down
5 changes: 3 additions & 2 deletions services/web/client/source/class/osparc/data/model/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ 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
Expand All @@ -35,6 +34,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
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();
Expand Down