Skip to content

Commit 69c60ad

Browse files
authored
πŸ›πŸŽ¨ [Frontend] Enh: Comments aesthetics (#7517)
1 parent 7113a91 commit 69c60ad

File tree

4 files changed

+43
-31
lines changed

4 files changed

+43
-31
lines changed

β€Žservices/static-webserver/client/source/class/osparc/desktop/StudyEditor.jsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
309309
}
310310
}, this);
311311
}
312-
socket.emit("logger");
313312
},
314313

315314
__listenToProgress: function() {

β€Žservices/static-webserver/client/source/class/osparc/editor/AnnotationNoteCreator.jsβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ qx.Class.define("osparc.editor.AnnotationNoteCreator", {
8484
allowGrowX: false
8585
});
8686
control.addListener("execute", () => {
87-
const collaboratorsManager = new osparc.share.NewCollaboratorsManager(null, false);
87+
const currentStudy = osparc.store.Store.getInstance().getCurrentStudy().serialize();
88+
currentStudy["resourceType"] = "study";
89+
const collaboratorsManager = new osparc.share.NewCollaboratorsManager(currentStudy, false);
8890
collaboratorsManager.setCaption("Recipient");
8991
collaboratorsManager.getActionButton().setLabel(this.tr("Add"));
9092
collaboratorsManager.addListener("addCollaborators", e => {

β€Žservices/static-webserver/client/source/class/osparc/info/CommentUI.jsβ€Ž

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ qx.Class.define("osparc.info.CommentUI", {
2828
this.__comment = comment;
2929

3030
const isMyComment = this.__isMyComment();
31-
const layout = new qx.ui.layout.Grid(12, 5);
32-
layout.setColumnFlex(isMyComment ? 0 : 1, 1); // message content
31+
const layout = new qx.ui.layout.Grid(12, 4);
32+
layout.setColumnFlex(1, 1); // comment
33+
layout.setColumnFlex(isMyComment ? 0 : 2, 3); // spacer
3334
this._setLayout(layout);
3435
this.setPadding(5);
3536

@@ -46,55 +47,63 @@ qx.Class.define("osparc.info.CommentUI", {
4647
_createChildControlImpl: function(id) {
4748
let control;
4849
switch (id) {
49-
case "meta-data-grid": {
50-
const layout = new qx.ui.layout.Grid(12, 5)
51-
layout.setColumnWidth(this.__isMyComment() ? 1 : 0, 32); // thumbnail
52-
control = new qx.ui.container.Composite(layout);
53-
this._add(control, {
54-
row: 0,
55-
column: this.__isMyComment() ? 1 : 0
56-
});
57-
break;
58-
}
5950
case "thumbnail":
6051
control = new qx.ui.basic.Image().set({
6152
scale: true,
6253
maxWidth: 32,
6354
maxHeight: 32,
6455
decorator: "rounded",
56+
marginTop: 2,
57+
});
58+
this._add(control, {
59+
row: 0,
60+
column: this.__isMyComment() ? 2 : 0,
61+
rowSpan: 2,
6562
});
66-
this.getChildControl("meta-data-grid").add(control, {
63+
break;
64+
case "header-layout":
65+
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(5).set({
66+
alignX: this.__isMyComment() ? "right" : "left"
67+
}));
68+
this._add(control, {
6769
row: 0,
68-
column: this.__isMyComment() ? 1 : 0,
69-
rowSpan: 2
70+
column: 1
7071
});
7172
break;
7273
case "user-name":
7374
control = new qx.ui.basic.Label().set({
74-
font: "text-14"
75-
});
76-
this.getChildControl("meta-data-grid").add(control, {
77-
row: 0,
78-
column: this.__isMyComment() ? 0 : 1
75+
font: "text-12"
7976
});
77+
this.getChildControl("header-layout").addAt(control, 0);
8078
break;
8179
case "last-updated":
8280
control = new qx.ui.basic.Label().set({
8381
font: "text-12"
8482
});
85-
this.getChildControl("meta-data-grid").add(control, {
86-
row: 1,
87-
column: this.__isMyComment() ? 0 : 1
88-
});
83+
this.getChildControl("header-layout").addAt(control, 1);
8984
break;
9085
case "comment-content":
91-
control = new osparc.ui.markdown.Markdown();
86+
control = new osparc.ui.markdown.Markdown().set({
87+
backgroundColor: "background-main-2",
88+
decorator: "rounded",
89+
noMargin: true,
90+
paddingLeft: 8,
91+
paddingRight: 8,
92+
allowGrowX: true,
93+
});
9294
control.getContentElement().setStyles({
93-
"text-align": this.__isMyComment() ? "right" : "left"
95+
"text-align": this.__isMyComment() ? "right" : "left",
9496
});
9597
this._add(control, {
96-
row: 0,
97-
column: this.__isMyComment() ? 0 : 1
98+
row: 1,
99+
column: 1,
100+
});
101+
break;
102+
case "spacer":
103+
control = new qx.ui.core.Spacer();
104+
this._add(control, {
105+
row: 1,
106+
column: this.__isMyComment() ? 0 : 2,
98107
});
99108
break;
100109
}
@@ -122,6 +131,8 @@ qx.Class.define("osparc.info.CommentUI", {
122131
thumbnail.setSource(user.getThumbnail());
123132
userName.setValue(user.getLabel());
124133
}
134+
135+
this.getChildControl("spacer");
125136
}
126137
}
127138
});

β€Žservices/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
374374
}
375375
}
376376
if (Object.keys(this.__selectedCollaborators).length) {
377-
const selectedGIds = Object.keys(this.__selectedCollaborators).filter(key => qx.lang.Type.isNumber(key));
377+
const selectedGIds = Object.keys(this.__selectedCollaborators).filter(key => /^\d+$/.test(key)); // all digits
378378
const selectedEmails = Object.keys(this.__selectedCollaborators).filter(key => osparc.auth.core.Utils.checkEmail(key));
379379

380380
const addCollaborators = () => {

0 commit comments

Comments
Β (0)