Skip to content

Commit 0abee9b

Browse files
authored
🐛 [Frontend] Fix: Crop long parameter values (#8393)
1 parent 5164d46 commit 0abee9b

File tree

6 files changed

+45
-74
lines changed

6 files changed

+45
-74
lines changed

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)