Skip to content

Commit 804616a

Browse files
committed
minor fixes
1 parent d928d88 commit 804616a

File tree

7 files changed

+24
-28
lines changed

7 files changed

+24
-28
lines changed

services/static-webserver/client/source/class/osparc/conversation/Conversation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ qx.Class.define("osparc.conversation.Conversation", {
217217
const messages = resp["data"];
218218
messages.forEach(message => this.addMessage(message));
219219
this.__nextRequestParams = resp["_links"]["next"];
220-
if (this.__nextRequestParams === null) {
220+
if (this.__nextRequestParams === null && this.__loadMoreMessages) {
221221
this.__loadMoreMessages.exclude();
222222
}
223223
})

services/static-webserver/client/source/class/osparc/data/model/Node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ qx.Class.define("osparc.data.model.Node", {
718718
});
719719
} else {
720720
this.fireDataEvent("projectDocumentChanged", {
721-
"op": "delete",
721+
"op": "remove",
722722
"path": `/ui/workbench/${this.getNodeId()}/marker`,
723723
"osparc-resource": "ui",
724724
});

services/static-webserver/client/source/class/osparc/data/model/Study.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,19 +573,21 @@ qx.Class.define("osparc.data.model.Study", {
573573
// Do not listen to output related backend updates if the node is a frontend node.
574574
// The frontend controls its output values, progress and states.
575575
// If a File Picker is uploading a file, the backend could override the current state with some older state.
576-
if (node && nodeData && !osparc.data.model.Node.isFrontend(node.getMetaData())) {
577-
node.setOutputData(nodeData.outputs);
578-
if ("progress" in nodeData) {
579-
const progress = Number.parseInt(nodeData["progress"]);
580-
node.getStatus().setProgress(progress);
576+
if (node) {
577+
if (nodeData && !osparc.data.model.Node.isFrontend(node.getMetaData())) {
578+
node.setOutputData(nodeData.outputs);
579+
if ("progress" in nodeData) {
580+
const progress = Number.parseInt(nodeData["progress"]);
581+
node.getStatus().setProgress(progress);
582+
}
583+
node.populateStates(nodeData);
584+
}
585+
if ("errors" in nodeUpdatedData) {
586+
const errors = nodeUpdatedData["errors"];
587+
node.setErrors(errors);
588+
} else {
589+
node.setErrors([]);
581590
}
582-
node.populateStates(nodeData);
583-
}
584-
if (node && "errors" in nodeUpdatedData) {
585-
const errors = nodeUpdatedData["errors"];
586-
node.setErrors(errors);
587-
} else {
588-
node.setErrors([]);
589591
}
590592
},
591593

services/static-webserver/client/source/class/osparc/data/model/StudyUI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ qx.Class.define("osparc.data.model.StudyUI", {
143143
if (annotationId in this.getAnnotations()) {
144144
const annotation = this.getAnnotations()[annotationId]
145145
this.fireDataEvent("projectDocumentChanged", {
146-
"op": "delete",
146+
"op": "remove",
147147
"path": `/ui/annotations/${annotation.getId()}`,
148148
"osparc-resource": "study-ui",
149149
});

services/static-webserver/client/source/class/osparc/data/model/Workbench.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ qx.Class.define("osparc.data.model.Workbench", {
320320
this.__addNode(node);
321321

322322
node.populateNodeData();
323-
this.giveUniqueNameToNode(node, node.getLabel());
323+
this.__giveUniqueNameToNode(node, node.getLabel());
324324
node.checkState();
325325

326326
return node;
@@ -653,15 +653,15 @@ qx.Class.define("osparc.data.model.Workbench", {
653653
return false;
654654
},
655655

656-
giveUniqueNameToNode: function(node, label, suffix = 2) {
656+
__giveUniqueNameToNode: function(node, label, suffix = 2) {
657657
const newLabel = label + "_" + suffix;
658658
const allModels = this.getNodes();
659659
const nodes = Object.values(allModels);
660660
for (const node2 of nodes) {
661661
if (node2.getNodeId() !== node.getNodeId() &&
662662
node2.getLabel().localeCompare(node.getLabel()) === 0) {
663663
node.setLabel(newLabel);
664-
this.giveUniqueNameToNode(node, label, suffix+1);
664+
this.__giveUniqueNameToNode(node, label, suffix+1);
665665
}
666666
}
667667
},
@@ -720,7 +720,7 @@ qx.Class.define("osparc.data.model.Workbench", {
720720

721721
nodeIds.forEach(nodeId => {
722722
const node = this.getNode(nodeId);
723-
this.giveUniqueNameToNode(node, node.getLabel());
723+
this.__giveUniqueNameToNode(node, node.getLabel());
724724
});
725725
});
726726
},

services/static-webserver/client/source/class/osparc/workbench/Annotation.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,8 @@ qx.Class.define("osparc.workbench.Annotation", {
276276
const serializeData = {
277277
type: this.getType(),
278278
attributes: this.getAttributes(),
279+
color: this.getColor(), // TYPES.NOTE and TYPES.CONVERSATION do not need a color but backend expects it
279280
};
280-
if ([
281-
this.self().TYPES.RECT,
282-
this.self().TYPES.TEXT,
283-
this.self().TYPES.NOTE,
284-
].includes(this.getType())) {
285-
serializeData.color = this.getColor();
286-
}
287281
return serializeData;
288282
}
289283
}

services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
346346

347347
__addNode: async function(service, pos) {
348348
// render temporary node
349-
let tempNodeUI = this.__createTemporaryNodeUI(pos);
349+
let dashedNodeUI = this.__createTemporaryNodeUI(pos);
350350

351351
let nodeUI = null;
352352
try {
@@ -359,7 +359,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
359359
console.error(err);
360360
} finally {
361361
// remove temporary node
362-
this.__removeTemporaryNodeUI(tempNodeUI);
362+
this.__removeTemporaryNodeUI(dashedNodeUI);
363363
}
364364
return nodeUI;
365365
},

0 commit comments

Comments
 (0)