Skip to content

Commit 74d330f

Browse files
committed
addBookACallInfo
1 parent 0992125 commit 74d330f

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ qx.Class.define("osparc.support.BookACallTopicSelector", {
183183
} else if (this.getChildControl("help-with-project-button").getValue()) {
184184
topicData["topic"] = "help-with-project";
185185
if (this.getChildControl("share-project-checkbox").getValue()) {
186-
topicData["extraInfo"] = "share-project";
186+
topicData["share-project"] = true;
187187
}
188188
} else if (this.getChildControl("specific-topic-button").getValue()) {
189189
topicData["topic"] = "specific-topic";

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ qx.Class.define("osparc.support.Conversation", {
3838
},
3939

4040
members: {
41+
__bookACallInfo: null,
42+
4143
_createChildControlImpl: function(id) {
4244
let control;
4345
switch (id) {
@@ -95,7 +97,14 @@ qx.Class.define("osparc.support.Conversation", {
9597
this.setConversation(newConversation);
9698
if (isBookACall) {
9799
// add a first message
98-
prePostMessagePromise = this.__postMessage("Book a Call");
100+
const msg = `
101+
Book a Call details:
102+
- Topic: ${this.__bookACallInfo["topic"]}
103+
`;
104+
if ("extraInfo" in this.__bookACallInfo) {
105+
msg += `\n- Extra Info: ${this.__bookACallInfo["extraInfo"]}`;
106+
}
107+
prePostMessagePromise = this.__postMessage(msg);
99108
// rename the conversation
100109
newConversation.renameConversation("Book a Call");
101110
}
@@ -217,5 +226,9 @@ qx.Class.define("osparc.support.Conversation", {
217226
this.addMessage(systemMessage);
218227
}
219228
},
229+
230+
addBookACallInfo: function(bookACallInfo) {
231+
this.__bookACallInfo = bookACallInfo;
232+
},
220233
}
221234
});

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ qx.Class.define("osparc.support.ConversationPage", {
192192
const bookACallTopicSelector = this.getChildControl("book-a-call-topic-selector");
193193
bookACallTopicSelector.getChildControl("next-button").setLabel(this.tr("Next"));
194194
bookACallTopicSelector.addListener("callTopicSelected", e => {
195-
console.log("callTopicSelected", e.getData());
195+
const data = e.getData();
196+
conversationContent.addBookACallInfo(data);
196197
this.getChildControl("main-stack").setSelection([conversationContainer]);
197198
});
198199
this.getChildControl("main-stack").setSelection([bookACallTopicSelector]);
@@ -202,7 +203,8 @@ qx.Class.define("osparc.support.ConversationPage", {
202203
const bookACallTopicSelector = this.getChildControl("book-a-call-topic-selector");
203204
bookACallTopicSelector.getChildControl("next-button").setLabel(this.tr("Select date & time"));
204205
bookACallTopicSelector.addListener("callTopicSelected", e => {
205-
console.log("callTopicSelected", e.getData());
206+
const data = e.getData();
207+
conversationContent.addBookACallInfo(data);
206208
this.getChildControl("main-stack").setSelection([conversationContainer]);
207209
});
208210
this.getChildControl("main-stack").setSelection([bookACallTopicSelector]);

0 commit comments

Comments
 (0)