Skip to content

Commit 7d5f6ed

Browse files
authored
🐛 Last minute frontend fixes/updates (#5473)
On behalf of @odeimaiz
1 parent 234a581 commit 7d5f6ed

File tree

17 files changed

+235
-108
lines changed

17 files changed

+235
-108
lines changed

services/static-webserver/client/compile.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"class": "osparc.Application",
4141
"theme": "osparc.theme.products.s4l.ThemeDark",
4242
"name": "s4l",
43-
"title": "Sim4Life - ZMT",
43+
"title": "Sim4Life",
4444
"include": [
4545
"iconfont.material.Load",
4646
"iconfont.fontawesome5.Load",
@@ -56,7 +56,7 @@
5656
"class": "osparc.Application",
5757
"theme": "osparc.theme.products.s4l.ThemeDark",
5858
"name": "s4llite",
59-
"title": "Sim4Life lite",
59+
"title": "Sim4Life Lite",
6060
"include": [
6161
"iconfont.material.Load",
6262
"iconfont.fontawesome5.Load",
@@ -72,7 +72,7 @@
7272
"class": "osparc.Application",
7373
"theme": "osparc.theme.products.s4l.ThemeDark",
7474
"name": "s4lacad",
75-
"title": "Sim4Life Academic",
75+
"title": "Sim4Life Science",
7676
"include": [
7777
"iconfont.material.Load",
7878
"iconfont.fontawesome5.Load",

services/static-webserver/client/source/class/osparc/auth/LoginPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ qx.Class.define("osparc.auth.LoginPage", {
345345
textColor: "text-darker"
346346
});
347347
const vendor = osparc.store.VendorInfo.getInstance().getVendor();
348-
if (vendor) {
348+
if (vendor && "url" in vendor && "copyright" in vendor) {
349349
organizationLink.set({
350350
value: vendor.copyright,
351351
url: vendor.url

services/static-webserver/client/source/class/osparc/auth/ui/RequestAccount.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ qx.Class.define("osparc.auth.ui.RequestAccount", {
162162
label: "Social Media"
163163
}, {
164164
id: "Other",
165-
label: "Other (please specify below)"
165+
label: "Other"
166166
}].forEach(hearData => {
167167
const lItem = new qx.ui.form.ListItem(hearData.label, null, hearData.id);
168168
hear.add(lItem);

services/static-webserver/client/source/class/osparc/dashboard/GridButtonItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
215215
},
216216

217217
createOwner: function(label) {
218-
const resourceType = this.getResourceType() === "study" ? "project" : this.getResourceType();
219218
if (label === osparc.auth.Data.getInstance().getEmail()) {
220-
return qx.locale.Manager.tr(`My ${resourceType}`);
219+
const resourceAlias = osparc.utils.Utils.resourceTypeToAlias(this.getResourceType());
220+
return qx.locale.Manager.tr(`My ${resourceAlias}`);
221221
}
222222
return osparc.utils.Utils.getNameFromEmail(label);
223223
},

services/static-webserver/client/source/class/osparc/dashboard/ListButtonItem.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
210210

211211
createOwner: function(label) {
212212
if (label === osparc.auth.Data.getInstance().getEmail()) {
213-
return qx.locale.Manager.tr("My project");
213+
const resourceAlias = osparc.utils.Utils.resourceTypeToAlias(this.getResourceType());
214+
return qx.locale.Manager.tr(`My ${resourceAlias}`);
214215
}
215216
return osparc.utils.Utils.getNameFromEmail(label);
216217
},

services/static-webserver/client/source/class/osparc/dashboard/ResourceMoreOptions.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
4646
HEIGHT: 700,
4747

4848
popUpInWindow: function(moreOpts) {
49-
const prjAlias = osparc.product.Utils.getStudyAlias({firstUpperCase: true});
5049
// eslint-disable-next-line no-underscore-dangle
51-
const title = qx.locale.Manager.tr(prjAlias + ` Details - ${moreOpts.__resourceData.name}`);
50+
const resourceAlias = osparc.utils.Utils.resourceTypeToAlias(moreOpts.__resourceData["resourceType"]);
51+
// eslint-disable-next-line no-underscore-dangle
52+
const title = `${resourceAlias} ${qx.locale.Manager.tr("Details")} - ${moreOpts.__resourceData.name}`
5253
return osparc.ui.window.Window.popUpInWindow(moreOpts, title, this.WIDTH, this.HEIGHT).set({
5354
maxHeight: 1000,
5455
layout: new qx.ui.layout.Grow(),
@@ -127,7 +128,7 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
127128
__openTapped: function() {
128129
if (this.__resourceData["resourceType"] !== "study") {
129130
// Nothing to pre-check
130-
this.__openStudy();
131+
this.__openResource();
131132
return;
132133
}
133134
this.__openButton.setFetching(true);
@@ -157,7 +158,7 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
157158
if (anyUpdatable) {
158159
this.__confirmUpdate();
159160
} else {
160-
this.__openStudy();
161+
this.__openResource();
161162
}
162163
})
163164
.catch(() => this.__openButton.setFetching(false));
@@ -175,12 +176,12 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
175176
if (win.getConfirmed()) {
176177
this.__openPage(this.__servicesUpdatePage);
177178
} else {
178-
this.__openStudy();
179+
this.__openResource();
179180
}
180181
});
181182
},
182183

183-
__openStudy: function() {
184+
__openResource: function() {
184185
switch (this.__resourceData["resourceType"]) {
185186
case "study":
186187
this.fireDataEvent("openStudy", this.__resourceData);

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
7070
description: "New Sim4Life project",
7171
newStudyLabel: "New S4L project",
7272
idToWidget: "startS4LButton"
73-
},
74-
"simcore/services/dynamic/jupyter-smash": {
75-
title: "Start Sim4Life lab",
76-
description: "Jupyter powered by S4L",
77-
newStudyLabel: "New Sim4Life lab project",
78-
idToWidget: "startJSmashButton"
7973
}
8074
},
8175
EXPECTED_S4L_LITE_SERVICE_KEYS: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
182182

183183
study.initStudy();
184184

185-
if (osparc.product.Utils.isS4LProduct()) {
185+
if (osparc.product.Utils.isS4LProduct()|| osparc.product.Utils.isProduct("s4llite")) {
186186
this.__startIdlingTracker();
187187
}
188188

services/static-webserver/client/source/class/osparc/navigation/LogoOnOff.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ qx.Class.define("osparc.navigation.LogoOnOff", {
6363
break;
6464
}
6565
case "off-logo": {
66-
control = new qx.ui.basic.Image("osparc/offline.svg").set({
67-
width: 92,
68-
height: 35,
69-
scale: true
70-
});
66+
control = new qx.ui.basic.Image("osparc/offline.svg");
7167
const container = this.getChildControl("off-logo-container");
7268
container.add(control, {
7369
flex: 1
@@ -76,10 +72,6 @@ qx.Class.define("osparc.navigation.LogoOnOff", {
7672
}
7773
case "on-logo": {
7874
control = new osparc.ui.basic.LogoWPlatform();
79-
control.setSize({
80-
width: 100,
81-
height: osparc.navigation.NavigationBar.HEIGHT
82-
});
8375
control.setFont("text-9");
8476
this.add(control);
8577
break;

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ qx.Class.define("osparc.navigation.NavigationBar", {
173173
alignY: "middle"
174174
});
175175
control.getChildControl("off-logo").set({
176-
width: 100,
177-
height: 35
178-
});
176+
width: 92,
177+
height: 35,
178+
scale: true
179+
})
179180
control.getChildControl("on-logo").setSize({
180-
width: osparc.product.Utils.getProductName() === "s4l" ? 150 : 100,
181+
width: osparc.product.Utils.isS4LProduct() ? 150 : 100,
181182
height: osparc.navigation.NavigationBar.HEIGHT
182183
});
183184
this.getChildControl("left-items").add(control);
@@ -400,7 +401,7 @@ qx.Class.define("osparc.navigation.NavigationBar", {
400401
} else {
401402
// left-items
402403
this.getChildControl("logo").getChildControl("on-logo").setSize({
403-
width: osparc.product.Utils.getProductName() === "s4l" ? 150 : 100,
404+
width: osparc.product.Utils.isS4LProduct() ? 150 : 100,
404405
height: osparc.navigation.NavigationBar.HEIGHT
405406
});
406407
if (!osparc.product.Utils.isProduct("osparc")) {

services/static-webserver/client/source/class/osparc/product/AboutProduct.js

Lines changed: 46 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ qx.Class.define("osparc.product.AboutProduct", {
2727

2828
this.set({
2929
layout: new qx.ui.layout.VBox(10),
30-
minWidth: this.self().MIN_WIDTH,
31-
maxWidth: this.self().MAX_WIDTH,
30+
width: this.self().WIDTH,
3231
contentPadding: this.self().PADDING,
3332
showMaximize: false,
3433
showMinimize: false,
35-
resizable: false,
34+
resizable: true,
3635
centerOnAppear: true,
3736
clickAwayClose: true,
3837
modal: true
@@ -42,8 +41,7 @@ qx.Class.define("osparc.product.AboutProduct", {
4241
},
4342

4443
statics: {
45-
MIN_WIDTH: 200,
46-
MAX_WIDTH: 400,
44+
WIDTH: 500,
4745
PADDING: 15
4846
},
4947

@@ -53,47 +51,61 @@ qx.Class.define("osparc.product.AboutProduct", {
5351
case "s4l":
5452
this.__buildS4LLayout();
5553
break;
56-
case "s4llite":
57-
this.__buildS4LLiteLayout();
58-
break;
5954
case "s4lacad":
6055
this.__buildS4LAcademicLayout();
6156
break;
57+
case "s4llite":
58+
this.__buildS4LLiteLayout();
59+
break;
6260
default: {
6361
const noInfoText = this.tr("Information not available");
64-
const noInfoLabel = osparc.product.quickStart.Utils.createLabel(noInfoText).set({
65-
maxWidth: this.self().MAX_WIDTH - 2*this.self().PADDING
66-
});
62+
const noInfoLabel = osparc.product.quickStart.Utils.createLabel(noInfoText);
6763
this.add(noInfoLabel);
6864
break;
6965
}
7066
}
7167
},
7268

7369
__buildS4LLayout: function() {
74-
const color = qx.theme.manager.Color.getInstance().resolve("text");
75-
76-
const introText = "TODO: Intro text";
77-
78-
const licenseUrl = "";
79-
const licenseText = `TODO: Click <a href=${licenseUrl} style='color: ${color}' target='_blank'>here</a> to read the license agreements.`;
80-
81-
// more info ZMT website
82-
const moreInfoUrl = "https://zmt.swiss/";
83-
const moreInfoText = `For more information about <i>S4L</i>, visit <a href=${moreInfoUrl} style='color: ${color}' target='_blank'>our website</a>.`;
84-
85-
[
86-
introText,
87-
licenseText,
88-
moreInfoText
89-
].forEach(text => {
90-
const label = osparc.product.quickStart.Utils.createLabel(text).set({
91-
maxWidth: this.self().MAX_WIDTH - 2*this.self().PADDING
70+
osparc.store.Support.getLicenseURL()
71+
.then(licenseUrl => {
72+
const color = qx.theme.manager.Color.getInstance().resolve("text");
73+
const text = this.tr(`
74+
sim4life.io is a native implementation of the most advanced simulation platform, Sim4Life, in the cloud. \
75+
The platform empowers users to simulate, analyze, and predict complex, multifaceted, and dynamic biological interactions within the full anatomical complexity of the human body. \
76+
It provides the ability to set up and run complex simulations directly within any browser, utilizing cloud technology.
77+
<br><br>
78+
sim4life.io makes use of technologies developed by our research partner for the o<sup>2</sup>S<sup>2</sup>PARC platform, the IT’IS Foundation, and co-funded by the U.S. National Institutes of Health’s SPARC initiative.\
79+
<br><br>
80+
For more information about Sim4Life, please visit <a href='https://sim4life.swiss/' style='color: ${color}' target='_blank'>sim4life.swiss</a>.
81+
<br><br>
82+
To review license agreements, click <a href=${licenseUrl} style='color: ${color}' target='_blank'>here</a>.
83+
`);
84+
85+
const label = osparc.product.quickStart.Utils.createLabel(text);
86+
this.add(label);
9287
});
93-
this.add(label);
94-
});
88+
},
9589

96-
this.__addCopyright();
90+
__buildS4LAcademicLayout: function() {
91+
osparc.store.Support.getLicenseURL()
92+
.then(licenseUrl => {
93+
const color = qx.theme.manager.Color.getInstance().resolve("text");
94+
const text = this.tr(`
95+
sim4life.science is a native implementation of the most advanced simulation platform, Sim4Life, in the cloud. \
96+
The platform empowers users to simulate, analyze, and predict complex, multifaceted, and dynamic biological interactions within the full anatomical complexity of the human body. \
97+
It provides the ability to set up and run complex simulations directly within any browser, utilizing cloud technology.
98+
<br><br>
99+
sim4life.science makes use of technologies developed by our research partner for the o<sup>2</sup>S<sup>2</sup>PARC platform, the IT’IS Foundation, and co-funded by the U.S. National Institutes of Health’s SPARC initiative.\
100+
<br><br>
101+
For more information about Sim4Life, please visit <a href='https://sim4life.swiss/' style='color: ${color}' target='_blank'>sim4life.swiss</a>.
102+
<br><br>
103+
To review license agreements, click <a href=${licenseUrl} style='color: ${color}' target='_blank'>here</a>.
104+
`);
105+
106+
const label = osparc.product.quickStart.Utils.createLabel(text);
107+
this.add(label);
108+
});
97109
},
98110

99111
__buildS4LLiteLayout: function() {
@@ -114,35 +126,7 @@ qx.Class.define("osparc.product.AboutProduct", {
114126
licenseText,
115127
moreInfoText
116128
].forEach(text => {
117-
const label = osparc.product.quickStart.Utils.createLabel(text).set({
118-
maxWidth: this.self().MAX_WIDTH - 2*this.self().PADDING
119-
});
120-
this.add(label);
121-
});
122-
123-
this.__addCopyright();
124-
},
125-
126-
__buildS4LAcademicLayout: function() {
127-
const color = qx.theme.manager.Color.getInstance().resolve("text");
128-
129-
const introText = "TODO: Intro text";
130-
131-
const licenseUrl = "";
132-
const licenseText = `TODO: Click <a href=${licenseUrl} style='color: ${color}' target='_blank'>here</a> to read the license agreements.`;
133-
134-
// more info ZMT website
135-
const moreInfoUrl = "https://zmt.swiss/";
136-
const moreInfoText = `For more information about <i>S4L Academic</i>, visit <a href=${moreInfoUrl} style='color: ${color}' target='_blank'>our website</a>.`;
137-
138-
[
139-
introText,
140-
licenseText,
141-
moreInfoText
142-
].forEach(text => {
143-
const label = osparc.product.quickStart.Utils.createLabel(text).set({
144-
maxWidth: this.self().MAX_WIDTH - 2*this.self().PADDING
145-
});
129+
const label = osparc.product.quickStart.Utils.createLabel(text);
146130
this.add(label);
147131
});
148132

@@ -154,7 +138,7 @@ qx.Class.define("osparc.product.AboutProduct", {
154138
font: "link-label-14"
155139
});
156140
const vendor = osparc.store.VendorInfo.getInstance().getVendor();
157-
if (vendor) {
141+
if (vendor && "url" in vendor && "copyright" in vendor) {
158142
copyrightLink.set({
159143
value: vendor.copyright,
160144
url: vendor.url

services/static-webserver/client/source/class/osparc/product/Utils.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ qx.Class.define("osparc.product.Utils", {
180180
},
181181

182182
showAboutProduct: function() {
183-
if (this.isProduct("osparc")) {
184-
return false;
185-
}
186-
return true;
183+
return (this.isS4LProduct() || this.isProduct("s4llite"));
187184
},
188185

189186
showPreferencesTokens: function() {

services/static-webserver/client/source/class/osparc/product/quickStart/Utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ qx.Class.define("osparc.product.quickStart.Utils", {
3131
"s4l": {
3232
localStorageStr: "s4lDontShowQuickStart",
3333
tutorial: () => new osparc.product.quickStart.s4l.Welcome()
34+
},
35+
"s4lacad": {
36+
localStorageStr: "s4lacadDontShowQuickStart",
37+
tutorial: () => new osparc.product.quickStart.s4lacad.Welcome()
3438
}
3539
},
3640

0 commit comments

Comments
 (0)