Skip to content

Commit 0f32e1d

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-migrate-dy-scheduler-part2
2 parents 5fadd47 + 0abee9b commit 0f32e1d

File tree

11 files changed

+173
-85
lines changed

11 files changed

+173
-85
lines changed

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

Lines changed: 3 additions & 2 deletions
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",
@@ -287,7 +288,7 @@ qx.Class.define("osparc.support.Conversation", {
287288
},
288289

289290
addSystemMessage: function(type) {
290-
type = type || "askAQuestion";
291+
type = type || osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION;
291292

292293
const now = new Date();
293294
const systemMessage = {
@@ -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: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,23 @@ qx.Class.define("osparc.support.ConversationPage", {
148148
this.getChildControl("buttons-layout").addAt(control, 4);
149149
break;
150150
}
151+
case "main-stack":
152+
control = new qx.ui.container.Stack();
153+
this._add(control, {
154+
flex: 1
155+
});
156+
break;
157+
case "conversation-container":
158+
control = new qx.ui.container.Scroll();
159+
this.getChildControl("main-stack").add(control);
160+
break;
151161
case "conversation-content":
152162
control = new osparc.support.Conversation();
153-
const scroll = new qx.ui.container.Scroll();
154-
scroll.add(control);
155-
this._add(scroll, {
156-
flex: 1,
157-
});
163+
this.getChildControl("conversation-container").add(control);
164+
break;
165+
case "book-a-call-iframe":
166+
control = new osparc.wrapper.BookACallIframe();
167+
this.getChildControl("main-stack").add(control);
158168
break;
159169
}
160170
return control || this.base(arguments, id);
@@ -167,13 +177,21 @@ qx.Class.define("osparc.support.ConversationPage", {
167177
const title = this.getChildControl("conversation-title");
168178
const conversationContent = this.getChildControl("conversation-content");
169179
conversationContent.clearAllMessages();
180+
const conversationContainer = this.getChildControl("conversation-container");
181+
this.getChildControl("main-stack").setSelection([conversationContainer]);
170182
switch (type) {
171183
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ASK_A_QUESTION:
172184
title.setValue(this.tr("Ask a Question"));
173185
break;
174186
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL:
175187
title.setValue(this.tr("Book a Call"));
176188
break;
189+
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.BOOK_A_CALL_3RD: {
190+
title.setValue(this.tr("Book a Call 3rd"));
191+
const bookACallIframe = this.getChildControl("book-a-call-iframe");
192+
this.getChildControl("main-stack").setSelection([bookACallIframe]);
193+
break;
194+
}
177195
case osparc.support.Conversation.SYSTEM_MESSAGE_TYPE.ESCALATE_TO_SUPPORT:
178196
title.setValue(this.tr("Ask a Question"));
179197
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":

services/static-webserver/client/source/class/osparc/ui/list/CollaboratorListItem.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
qx.Class.define("osparc.ui.list.CollaboratorListItem", {
1919
extend: osparc.ui.list.ListItem,
2020

21+
construct: function() {
22+
this.base(arguments);
23+
24+
this.setCursor("default");
25+
},
26+
2127
properties: {
2228
collabType: {
2329
check: [
@@ -169,7 +175,9 @@ qx.Class.define("osparc.ui.list.CollaboratorListItem", {
169175
// highlight me
170176
const email = osparc.auth.Data.getInstance().getEmail();
171177
if (value && value.includes(email)) {
172-
this.addState("selected");
178+
this.setBackgroundColor("background-selected");
179+
} else {
180+
this.setBackgroundColor("background-main-2");
173181
}
174182
},
175183

services/static-webserver/client/source/class/osparc/ui/list/ListItem.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ qx.Class.define("osparc.ui.list.ListItem", {
151151
break;
152152
case "title":
153153
control = new qx.ui.basic.Label().set({
154-
font: "text-14"
154+
font: "text-14",
155+
selectable: true,
156+
rich: true,
155157
});
156158
this._add(control, {
157159
row: 0,
@@ -161,7 +163,8 @@ qx.Class.define("osparc.ui.list.ListItem", {
161163
case "subtitle":
162164
control = new qx.ui.basic.Label().set({
163165
font: "text-13",
164-
rich: true
166+
selectable: true,
167+
rich: true,
165168
});
166169
this._add(control, {
167170
row: 1,

services/static-webserver/client/source/class/osparc/ui/toolbar/ProgressBar.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

services/static-webserver/client/source/class/osparc/ui/window/Progress.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ qx.Class.define("osparc.ui.window.Progress", {
4040
allowGrowY: false,
4141
allowGrowX: true,
4242
margin: 0,
43+
decorator: "rounded",
4344
});
4445
control.getChildControl("progress").set({
4546
backgroundColor: "strong-main"
4647
});
47-
control.getContentElement().setStyles({
48-
"border-radius": "4px"
49-
});
5048
this.addAt(control, 1);
5149
break;
5250
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ qx.Class.define("osparc.workbench.DiskUsageIndicator", {
8282
const indicator = this.getChildControl("disk-indicator")
8383
control = new qx.ui.basic.Label().set({
8484
value: "",
85-
font: "text-13",
85+
font: "text-12",
8686
textColor: "contrasted-text-light",
8787
alignX: "center",
8888
alignY: "middle",

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

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ qx.Class.define("osparc.workbench.NodeUI", {
4040
construct: function(node) {
4141
this.base(arguments);
4242

43-
const grid = new qx.ui.layout.Grid(4, 1);
43+
const grid = new qx.ui.layout.Grid(2, 1);
4444
grid.setColumnFlex(1, 1);
4545

4646
this.set({
4747
appearance: "node-ui-cap",
48+
decorator: "rounded",
4849
layout: grid,
4950
showMinimize: false,
5051
showMaximize: false,
@@ -55,10 +56,6 @@ qx.Class.define("osparc.workbench.NodeUI", {
5556
contentPadding: this.self().CONTENT_PADDING
5657
});
5758

58-
this.getContentElement().setStyles({
59-
"border-radius": "4px"
60-
});
61-
6259
const captionBar = this.getChildControl("captionbar");
6360
captionBar.set({
6461
cursor: "move",
@@ -222,10 +219,10 @@ qx.Class.define("osparc.workbench.NodeUI", {
222219
});
223220
break;
224221
case "middle-container":
225-
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(3).set({
222+
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(2).set({
226223
alignY: "middle"
227224
})).set({
228-
padding: [3, 4]
225+
padding: 4
229226
});
230227
this.add(control, {
231228
row: 0,
@@ -245,7 +242,7 @@ qx.Class.define("osparc.workbench.NodeUI", {
245242
const type = osparc.service.Utils.getType(nodeType);
246243
if (type) {
247244
control.set({
248-
icon: type.icon + "14",
245+
icon: type.icon + "13",
249246
toolTipText: type.label
250247
});
251248
} else if (this.getNode().isUnknown()) {
@@ -282,7 +279,8 @@ qx.Class.define("osparc.workbench.NodeUI", {
282279
case "progress":
283280
control = new qx.ui.indicator.ProgressBar().set({
284281
height: 10,
285-
margin: 4
282+
margin: 4,
283+
decorator: "rounded",
286284
});
287285
this.add(control, {
288286
row: 1,
@@ -595,14 +593,11 @@ qx.Class.define("osparc.workbench.NodeUI", {
595593
const width = 120;
596594
this.__setNodeUIWidth(width);
597595

598-
const label = new qx.ui.basic.Label().set({
599-
font: "text-18"
596+
const valueLabel = new qx.ui.basic.Label().set({
597+
paddingLeft: 4,
598+
font: "text-14"
600599
});
601-
const middleContainer = this.getChildControl("middle-container");
602-
middleContainer.add(label);
603-
604-
this.getNode().bind("outputs", label, "value", {
605-
converter: outputs => {
600+
const outputToValue = outputs => {
606601
if ("out_1" in outputs && "value" in outputs["out_1"]) {
607602
const val = outputs["out_1"]["value"];
608603
if (Array.isArray(val)) {
@@ -611,8 +606,18 @@ qx.Class.define("osparc.workbench.NodeUI", {
611606
return String(val);
612607
}
613608
return "";
614-
}
609+
}
610+
this.getNode().bind("outputs", valueLabel, "value", {
611+
converter: outputs => outputToValue(outputs)
615612
});
613+
this.getNode().bind("outputs", valueLabel, "toolTipText", {
614+
converter: outputs => outputToValue(outputs)
615+
});
616+
const middleContainer = this.getChildControl("middle-container");
617+
middleContainer.add(valueLabel, {
618+
flex: 1
619+
});
620+
616621
this.fireEvent("updateNodeDecorator");
617622
},
618623

@@ -642,15 +647,18 @@ qx.Class.define("osparc.workbench.NodeUI", {
642647
},
643648

644649
__turnIntoProbeUI: function() {
645-
const width = 150;
650+
const width = 120;
646651
this.__setNodeUIWidth(width);
647652

648653
const linkLabel = new osparc.ui.basic.LinkLabel().set({
649-
paddingLeft: 5,
650-
font: "text-12"
654+
paddingLeft: 4,
655+
font: "text-14",
656+
rich: false, // this will make the ellipsis work
651657
});
652658
const middleContainer = this.getChildControl("middle-container");
653-
middleContainer.add(linkLabel);
659+
middleContainer.add(linkLabel, {
660+
flex: 1
661+
});
654662

655663
this.getNode().getPropsForm().addListener("linkFieldModified", () => this.__setProbeValue(linkLabel), this);
656664
this.__setProbeValue(linkLabel);

0 commit comments

Comments
 (0)