Skip to content

Commit 2c1c051

Browse files
committed
refactor
1 parent 6283e34 commit 2c1c051

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

services/static-webserver/client/source/class/osparc/store/Conversations.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ qx.Class.define("osparc.store.Conversations", {
4444
.catch(err => osparc.FlashMessenger.logError(err));
4545
},
4646

47+
getConversation: function(studyId, conversationId) {
48+
const params = {
49+
url: {
50+
studyId,
51+
conversationId,
52+
}
53+
};
54+
return osparc.data.Resources.fetch("conversations", "getConversation", params)
55+
.catch(err => osparc.FlashMessenger.logError(err));
56+
},
57+
4758
addConversation: function(studyId, name = "new 1", type = osparc.study.Conversations.TYPES.PROJECT_STATIC) {
4859
const params = {
4960
url: {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
12381238
this.__setSelectedAnnotations([annotation]);
12391239
switch (annotation.getType()) {
12401240
case osparc.workbench.Annotation.TYPES.CONVERSATION: {
1241-
const studyData = this.getStudy().serialize();
1242-
osparc.study.Conversations.popUpInWindow(studyData, annotation.getAttributes()["conversationId"]);
1241+
this.__popUpConversation(annotation.getAttributes()["conversationId"]);
12431242
break;
12441243
}
12451244
default: {
@@ -1994,7 +1993,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
19941993
serializeData.attributes.conversationId = conversationData["conversationId"];
19951994
serializeData.attributes.text = conversationData["name"];
19961995
this.__addAnnotation(serializeData);
1997-
osparc.study.Conversations.popUpInWindow(this.getStudy().serialize(), conversationData["conversationId"]);
1996+
this.__popUpConversation(conversationData["conversationId"]);
19981997
});
19991998
break;
20001999
}
@@ -2035,6 +2034,10 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
20352034
}
20362035
},
20372036

2037+
__popUpConversation: function(conversationId) {
2038+
osparc.study.Conversations.popUpInWindow(this.getStudy().serialize(), conversationId);
2039+
},
2040+
20382041
__dropFile: async function(e) {
20392042
this.__draggingFile(e, false);
20402043

0 commit comments

Comments
 (0)