Skip to content

Commit c165228

Browse files
committed
3rd button
1 parent ac741b6 commit c165228

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ qx.Class.define("osparc.support.Conversation", {
5858
SYSTEM_MESSAGE_TYPE: {
5959
ASK_A_QUESTION: "askAQuestion",
6060
BOOK_A_CALL: "bookACall",
61+
BOOK_A_CALL_3RD: "bookACall3rd",
6162
ESCALATE_TO_SUPPORT: "escalateToSupport",
6263
REPORT_OEC: "reportOEC",
6364
FOLLOW_UP: "followUp",
@@ -317,8 +318,8 @@ qx.Class.define("osparc.support.Conversation", {
317318
if (msg) {
318319
systemMessage["content"] = msg;
319320
systemMessage["systemMessageType"] = type;
321+
this.addMessage(systemMessage);
320322
}
321-
this.addMessage(systemMessage);
322323
},
323324

324325
addMessage: function(message) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,13 @@ qx.Class.define("osparc.support.ConversationPage", {
185185
break;
186186
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL:
187187
title.setValue(this.tr("Book a Call"));
188+
break;
189+
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL_3RD: {
190+
title.setValue(this.tr("Book a Call 3rd"));
188191
const bookACallIframe = this.getChildControl("book-a-call-iframe");
189192
this.getChildControl("main-stack").setSelection([bookACallIframe]);
190193
break;
194+
}
191195
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ESCALATE_TO_SUPPORT:
192196
title.setValue(this.tr("Ask a Question"));
193197
break;

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ qx.Class.define("osparc.support.ConversationsPage", {
2727
this.getChildControl("conversations-list");
2828
this.getChildControl("ask-a-question-button");
2929
this.getChildControl("book-a-call-button");
30+
if (osparc.utils.Utils.isDevelopmentPlatform()) {
31+
this.getChildControl("book-a-call-button-3rd");
32+
}
3033
},
3134

3235
events: {
@@ -63,7 +66,7 @@ qx.Class.define("osparc.support.ConversationsPage", {
6366
allowGrowX: false,
6467
center: true,
6568
});
66-
control.addListener("execute", () => this.fireDataEvent("createConversation", "askAQuestion"), this);
69+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION), this);
6770
this.getChildControl("buttons-layout").add(control);
6871
break;
6972
case "book-a-call-button":
@@ -72,7 +75,16 @@ qx.Class.define("osparc.support.ConversationsPage", {
7275
allowGrowX: false,
7376
center: true,
7477
});
75-
control.addListener("execute", () => this.fireDataEvent("createConversation", "bookACall"), this);
78+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL), this);
79+
this.getChildControl("buttons-layout").add(control);
80+
break;
81+
case "book-a-call-button-3rd":
82+
control = new qx.ui.form.Button(this.tr("Book a Call 3rd"), "@FontAwesome5Solid/phone/14").set({
83+
appearance: "strong-button",
84+
allowGrowX: false,
85+
center: true,
86+
});
87+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL_3RD), this);
7688
this.getChildControl("buttons-layout").add(control);
7789
break;
7890
}

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ qx.Class.define("osparc.support.HomePage", {
3131
if (osparc.store.Groups.getInstance().isSupportEnabled()) {
3232
this.getChildControl("ask-a-question-button");
3333
this.getChildControl("book-a-call-button");
34+
if (osparc.utils.Utils.isDevelopmentPlatform()) {
35+
this.getChildControl("book-a-call-button-3rd");
36+
}
3437
}
3538
this.__populateButtons();
3639
},
@@ -82,7 +85,7 @@ qx.Class.define("osparc.support.HomePage", {
8285
center: true,
8386
width: 183,
8487
});
85-
control.addListener("execute", () => this.fireDataEvent("createConversation", "askAQuestion"));
88+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION));
8689
this.getChildControl("conversation-buttons-layout").add(control, { flex: 1 });
8790
break;
8891
case "book-a-call-button":
@@ -92,7 +95,17 @@ qx.Class.define("osparc.support.HomePage", {
9295
center: true,
9396
width: 183,
9497
});
95-
control.addListener("execute", () => this.fireDataEvent("createConversation", "bookACall"));
98+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL));
99+
this.getChildControl("conversation-buttons-layout").add(control, { flex: 1 });
100+
break;
101+
case "book-a-call-button-3rd":
102+
control = new qx.ui.form.Button(this.tr("Book a Call 3rd"), "@FontAwesome5Solid/phone/16").set({
103+
gap: 8,
104+
appearance: "strong-button",
105+
center: true,
106+
width: 183,
107+
});
108+
control.addListener("execute", () => this.fireDataEvent("createConversation", osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL_3RD));
96109
this.getChildControl("conversation-buttons-layout").add(control, { flex: 1 });
97110
break;
98111
case "learning-box":

0 commit comments

Comments
 (0)