Skip to content

Commit 7e471f5

Browse files
committed
postConversation
1 parent 0aebe23 commit 7e471f5

File tree

8 files changed

+12
-23
lines changed

8 files changed

+12
-23
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ qx.Class.define("osparc.conversation.AddMessage", {
167167
let promise = null;
168168
if (studyData) {
169169
// create new project conversation first
170-
promise = osparc.store.ConversationsProject.getInstance().addConversation(studyData["uuid"])
170+
promise = osparc.store.ConversationsProject.getInstance().postConversation(studyData["uuid"])
171171
} else {
172172
// support conversation
173173
const extraContext = {};
174174
const currentStudy = osparc.store.Store.getInstance().getCurrentStudy()
175175
if (currentStudy) {
176176
extraContext["projectId"] = currentStudy.getUuid();
177177
}
178-
promise = osparc.store.ConversationsSupport.getInstance().addConversation(extraContext);
178+
promise = osparc.store.ConversationsSupport.getInstance().postConversation(extraContext);
179179
}
180180
promise
181181
.then(data => {
@@ -300,7 +300,7 @@ qx.Class.define("osparc.conversation.AddMessage", {
300300
this.__postNotify(userGid);
301301
} else {
302302
// create new conversation first
303-
osparc.store.ConversationsProject.getInstance().addConversation(studyData["uuid"])
303+
osparc.store.ConversationsProject.getInstance().postConversation(studyData["uuid"])
304304
.then(data => {
305305
this.setConversationId(data["conversationId"]);
306306
this.__postNotify(userGid);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ qx.Class.define("osparc.data.Resources", {
308308
"conversationsStudies": {
309309
useCache: false, // It has its own cache handler
310310
endpoints: {
311-
addConversation: {
311+
postConversation: {
312312
method: "POST",
313313
url: statics.API + "/projects/{studyId}/conversations"
314314
},
@@ -1477,7 +1477,7 @@ qx.Class.define("osparc.data.Resources", {
14771477
"conversationsSupport": {
14781478
useCache: false, // It has its own cache handler
14791479
endpoints: {
1480-
addConversation: {
1480+
postConversation: {
14811481
method: "POST",
14821482
url: statics.API + "/conversations"
14831483
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ qx.Class.define("osparc.store.ConversationsProject", {
6161
return osparc.data.Resources.fetch("conversationsStudies", "getConversation", params);
6262
},
6363

64-
addConversation: function(studyId, name = "new 1", type = osparc.store.ConversationsProject.TYPES.PROJECT_STATIC) {
64+
postConversation: function(studyId, name = "new 1", type = osparc.store.ConversationsProject.TYPES.PROJECT_STATIC) {
6565
const params = {
6666
url: {
6767
studyId,
@@ -71,7 +71,7 @@ qx.Class.define("osparc.store.ConversationsProject", {
7171
type,
7272
}
7373
};
74-
return osparc.data.Resources.fetch("conversationsStudies", "addConversation", params)
74+
return osparc.data.Resources.fetch("conversationsStudies", "postConversation", params)
7575
.catch(err => osparc.FlashMessenger.logError(err));
7676
},
7777

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ qx.Class.define("osparc.store.ConversationsSupport", {
7878
});
7979
},
8080

81-
addConversation: function(extraContext = {}) {
81+
postConversation: function(extraContext = {}) {
8282
const url = window.location.href;
8383
extraContext["deployment"] = url;
8484
extraContext["product"] = osparc.product.Utils.getProductName();
@@ -89,7 +89,7 @@ qx.Class.define("osparc.store.ConversationsSupport", {
8989
extraContext,
9090
}
9191
};
92-
return osparc.data.Resources.fetch("conversationsSupport", "addConversation", params)
92+
return osparc.data.Resources.fetch("conversationsSupport", "postConversation", params)
9393
.catch(err => osparc.FlashMessenger.logError(err));
9494
},
9595

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ qx.Class.define("osparc.study.Conversation", {
9191
.then(() => this.renameConversation(newLabel));
9292
} else {
9393
// create new conversation first
94-
osparc.store.ConversationsProject.getInstance().addConversation(this.__studyData["uuid"], newLabel)
94+
osparc.store.ConversationsProject.getInstance().postConversation(this.__studyData["uuid"], newLabel)
9595
.then(data => {
9696
this.setConversationId(data["conversationId"]);
9797
this.getChildControl("button").setLabel(newLabel);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ qx.Class.define("osparc.study.Conversations", {
259259
enabled: osparc.data.model.Study.canIWrite(studyData["accessRights"]),
260260
});
261261
newConversationButton.addListener("execute", () => {
262-
osparc.store.ConversationsProject.getInstance().addConversation(studyData["uuid"], "new " + (this.__conversationsPages.length + 1))
262+
osparc.store.ConversationsProject.getInstance().postConversation(studyData["uuid"], "new " + (this.__conversationsPages.length + 1))
263263
.then(conversationDt => {
264264
this.__addConversationPage(conversationDt);
265265
const newConversationPage = this.__getConversationPage(conversationDt["conversationId"]);

services/static-webserver/client/source/class/osparc/support/SupportCenter.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,5 @@ qx.Class.define("osparc.support.SupportCenter", {
155155
this.__showConversation();
156156
}
157157
},
158-
159-
__createConversation: function() {
160-
this.getChildControl("ask-a-question-button").setFetching(true);
161-
osparc.store.ConversationsSupport.getInstance().addConversation()
162-
.then(data => {
163-
this.openConversation(data["conversationId"]);
164-
})
165-
.finally(() => {
166-
this.getChildControl("ask-a-question-button").setFetching(false);
167-
});
168-
},
169158
}
170159
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
20492049
}
20502050
case annotationTypes.CONVERSATION: {
20512051
const conversationTitle = `${initPos.x}, ${initPos.y}`;
2052-
osparc.store.ConversationsProject.getInstance().addConversation(this.getStudy().getUuid(), conversationTitle, osparc.store.ConversationsProject.TYPES.PROJECT_ANNOTATION)
2052+
osparc.store.ConversationsProject.getInstance().postConversation(this.getStudy().getUuid(), conversationTitle, osparc.store.ConversationsProject.TYPES.PROJECT_ANNOTATION)
20532053
.then(conversationData => {
20542054
serializeData.attributes.conversationId = conversationData["conversationId"];
20552055
serializeData.attributes.text = conversationData["name"];

0 commit comments

Comments
 (0)