Skip to content

Commit d324cbe

Browse files
committed
SUPPORT_CALL
1 parent 5c1783e commit d324cbe

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ qx.Class.define("osparc.data.model.Conversation", {
8282

8383
type: {
8484
check: [
85-
"PROJECT_STATIC",
86-
"PROJECT_ANNOTATION",
87-
"SUPPORT",
85+
"PROJECT_STATIC", // osparc.store.ConversationsProject.TYPES.PROJECT_STATIC
86+
"PROJECT_ANNOTATION", // osparc.store.ConversationsProject.TYPES.PROJECT_ANNOTATION
87+
"SUPPORT", // osparc.store.ConversationsSupport.TYPES.SUPPORT
88+
"SUPPORT_CALL", // osparc.store.ConversationsSupport.TYPES.SUPPORT_CALL
8889
],
8990
nullable: false,
9091
init: null,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ qx.Class.define("osparc.store.ConversationsSupport", {
3434
statics: {
3535
TYPES: {
3636
SUPPORT: "SUPPORT",
37+
SUPPORT_CALL: "SUPPORT_CALL",
3738
},
3839
},
3940

@@ -82,14 +83,14 @@ qx.Class.define("osparc.store.ConversationsSupport", {
8283
});
8384
},
8485

85-
postConversation: function(extraContext = {}) {
86+
postConversation: function(extraContext = {}, type = osparc.store.ConversationsSupport.TYPES.SUPPORT) {
8687
const url = window.location.href;
8788
extraContext["deployment"] = url;
8889
extraContext["product"] = osparc.product.Utils.getProductName();
8990
const params = {
9091
data: {
9192
name: "null",
92-
type: osparc.store.ConversationsSupport.TYPES.SUPPORT,
93+
type,
9394
extraContext,
9495
}
9596
};

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ qx.Class.define("osparc.support.Conversation", {
8282
if (currentStudy) {
8383
extraContext["projectId"] = currentStudy.getUuid();
8484
}
85-
osparc.store.ConversationsSupport.getInstance().postConversation(extraContext)
85+
// clone first, it will be reset when setting the conversation
86+
const bookACallInfo = this.__bookACallInfo ? Object.assign({}, this.__bookACallInfo) : null;
87+
const type = bookACallInfo ? osparc.store.ConversationsSupport.TYPES.SUPPORT_CALL : osparc.store.ConversationsSupport.TYPES.SUPPORT;
88+
osparc.store.ConversationsSupport.getInstance().postConversation(extraContext, type)
8689
.then(data => {
87-
// clone first, it will be reset when setting the conversation
88-
const bookACallInfo = this.__bookACallInfo ? Object.assign({}, this.__bookACallInfo) : null;
8990
const newConversation = new osparc.data.model.ConversationSupport(data);
9091
this.setConversation(newConversation);
9192
let prePostMessagePromise = new Promise((resolve) => resolve());
@@ -112,7 +113,10 @@ qx.Class.define("osparc.support.Conversation", {
112113
return this.__postMessage(content);
113114
})
114115
.then(() => {
115-
if (osparc.store.Groups.getInstance().getChatbot() === null) {
116+
if (
117+
osparc.store.Groups.getInstance().getChatbot() === null ||
118+
type === osparc.store.ConversationsSupport.TYPES.SUPPORT_CALL
119+
) {
116120
// only add follow up message if there is no chatbot support
117121
setTimeout(() => this.addSystemMessage(this.self().SYSTEM_MESSAGE_TYPE.FOLLOW_UP), 1000);
118122
}

0 commit comments

Comments
 (0)