Skip to content

Commit 8fcd823

Browse files
committed
proposeConversation
1 parent 25572ce commit 8fcd823

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ qx.Class.define("osparc.support.ConversationPage", {
160160
return control || this.base(arguments, id);
161161
},
162162

163-
proposeConversation: function(type) {
163+
proposeConversation: function(type, prefillText) {
164164
type = type || osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION;
165165
this.setConversation(null);
166166

@@ -179,6 +179,10 @@ qx.Class.define("osparc.support.ConversationPage", {
179179
break;
180180
}
181181
conversationContent.addSystemMessage(type);
182+
183+
if (prefillText) {
184+
this.getChildControl("conversation-content").getChildControl("add-message").getChildControl("comment-field").setText(prefillText);
185+
}
182186
},
183187

184188
__applyConversation: function(conversation) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ qx.Class.define("osparc.support.SupportCenter", {
196196
}
197197
},
198198

199-
createConversation: function(type) {
199+
createConversation: function(type, prefillText) {
200200
const conversationPage = this.getChildControl("conversation-page");
201-
conversationPage.proposeConversation(type);
201+
conversationPage.proposeConversation(type, prefillText);
202202
this.__showConversation();
203203
},
204204
}

services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,13 @@ qx.Class.define("osparc.widget.PersistentIframe", {
358358
}
359359
break;
360360
}
361+
// { type: "openSupport", message: {question: "", answer: ""} }
361362
case "openSupport": {
362-
osparc.support.SupportCenter.openWindow();
363+
const supportCenterWindow = osparc.support.SupportCenter.openWindow();
364+
// for now prefill the text box with the question
365+
if (data["message"] && data["message"]["question"]) {
366+
supportCenterWindow.proposeConversation(null, data["message"]["question"]);
367+
}
363368
break;
364369
}
365370
}

0 commit comments

Comments
 (0)