Skip to content

Commit c6d1b64

Browse files
authored
🎨 [Frontend] Second app on Sim4Life.lite (#7807)
1 parent 714d2f9 commit c6d1b64

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

services/static-webserver/client/source/class/osparc/editor/HtmlEditor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ qx.Class.define("osparc.editor.HtmlEditor", {
2626

2727
this.getChildControl("preview-html");
2828
this.getChildControl("subtitle").set({
29-
value: this.tr("Supports HTML")
29+
value: this.tr("Supports HTML"),
30+
url: "https://en.wikipedia.org/wiki/HTML",
3031
});
3132
},
3233

services/static-webserver/client/source/class/osparc/editor/MarkdownEditor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ qx.Class.define("osparc.editor.MarkdownEditor", {
3131

3232
this.getChildControl("preview-markdown");
3333
this.getChildControl("subtitle").set({
34-
value: this.tr("Markdown supported")
34+
value: this.tr("Markdown supported"),
35+
url: "https://en.wikipedia.org/wiki/Markdown",
3536
});
3637
},
3738

services/static-webserver/client/source/class/osparc/editor/TextEditor.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ qx.Class.define("osparc.editor.TextEditor", {
8181
writePage.add(control, {
8282
flex: 1
8383
});
84-
const subtitle = this.getChildControl("subtitle").set({
85-
value: this.tr("Supports HTML")
86-
});
84+
const subtitle = this.getChildControl("subtitle");
8785
writePage.add(subtitle);
8886
tabs.add(writePage);
8987
break;
9088
}
9189
case "subtitle":
92-
control = new qx.ui.basic.Label().set({
90+
control = new osparc.ui.basic.LinkLabel().set({
9391
font: "text-12"
9492
});
9593
this._add(control);

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ qx.Class.define("osparc.info.CommentUI", {
113113

114114
__buildLayout: function() {
115115
const thumbnail = this.getChildControl("thumbnail");
116-
thumbnail.setSource(osparc.utils.Avatar.emailToThumbnail("", "", 32));
117116

118117
const userName = this.getChildControl("user-name");
119-
userName.setValue("Unknown");
120118

121119
const date = new Date(this.__comment["modified"]);
122120
const date2 = osparc.utils.Utils.formatDateAndTime(date);
@@ -131,7 +129,14 @@ qx.Class.define("osparc.info.CommentUI", {
131129
if (user) {
132130
thumbnail.setSource(user.getThumbnail());
133131
userName.setValue(user.getLabel());
132+
} else {
133+
thumbnail.setSource(osparc.utils.Avatar.emailToThumbnail());
134+
userName.setValue("Unknown user");
134135
}
136+
})
137+
.catch(() => {
138+
thumbnail.setSource(osparc.utils.Avatar.emailToThumbnail());
139+
userName.setValue("Unknown user");
135140
});
136141

137142
this.getChildControl("spacer");

services/static-webserver/client/source/class/osparc/utils/Avatar.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ qx.Class.define("osparc.utils.Avatar", {
3434
type: "static",
3535

3636
statics: {
37-
emailToThumbnail: function(email, username) {
38-
return this.__getUrl(email, username, 32);
39-
},
40-
41-
__getUrl: function(email, username, size = 100) {
42-
email = email || "";
37+
emailToThumbnail: function(email = "", username = "??", size = 32) {
4338
// MD5 (Message-Digest Algorithm) by WebToolkit
4439
const MD5 = function(s) {
4540
function L(k, d) {

services/static-webserver/client/source/resource/osparc/ui_config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@
156156
"title": "${replace_me_product_name}",
157157
"newStudyLabel": "New Project",
158158
"idToWidget": "startS4LButton"
159+
}, {
160+
"resourceType": "service",
161+
"expectedKey": "simcore/services/dynamic/s4l-ui-framework",
162+
"title": "Sim4Life.framework",
163+
"newStudyLabel": "Sim4Life.framework"
159164
}]
160165
}
161166
},

0 commit comments

Comments
 (0)