Skip to content

Commit 66c2e6c

Browse files
authored
Minors/09 02 (ITISFoundation#3308)
* fix s4l porst pro link * always hide New Study button to non testers * e2e: Wait for studies to be loaded * e2e: Wait for studies to be loaded * text update * oops osparc renaming * new logo
1 parent 9a8076d commit 66c2e6c

File tree

8 files changed

+66
-7
lines changed

8 files changed

+66
-7
lines changed

services/web/client/source/class/osparc/Application.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,21 @@ qx.Class.define("osparc.Application", {
124124
const w = document.documentElement.clientWidth;
125125
const h = document.documentElement.clientHeight;
126126
if (this.self().MIN_WIDTH > w || this.self().MIN_HEIGHT > h) {
127-
const msg = this.tr(`
128-
oSPARC is designed for slightly bigger window size.<br>\
127+
const product = this.tr("This app");
128+
const baseTextMsg = this.tr(`
129+
is designed for slightly bigger window size.<br>\
129130
A mininum window size of ${this.self().MIN_WIDTH}x${this.self().MIN_HEIGHT} is recommended<br>\
130131
Touch devices are not fully supported.
131132
`);
132133
const label = new qx.ui.basic.Label().set({
133-
value: msg,
134+
value: product+ baseTextMsg,
134135
rich: true
135136
});
137+
const displayNameKey = osparc.store.StaticInfo.getInstance().getDisplayNameKey();
138+
osparc.store.StaticInfo.getInstance().getValue(displayNameKey)
139+
.then(displayName => {
140+
label.setValue(displayName + baseTextMsg);
141+
});
136142
tooSmallWindow.add(label, {
137143
flex: 1
138144
});

services/web/client/source/class/osparc/component/tutorial/ti/PostPro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ qx.Class.define("osparc.component.tutorial.ti.PostPro", {
3636
const text2 = this.tr("\
3737
These metrics are reported in the Post Processing analysis environment for each electrode pair in the combination in \
3838
a sorted tabular form that can be used to inspect the stimulation performances. By clicking on each pair, slice views \
39-
of the maximum amplitude modulation (MAP) are created within the head are produced.<br>\
39+
of the maximum amplitude modulation (MAP) within the head are produced.<br>\
4040
Pressing the `Load` button on the right, the selected configuration will be loaded.\
4141
");
4242
const label2 = osparc.component.tutorial.ti.Slides.createLabel(text2);

services/web/client/source/class/osparc/component/tutorial/ti/S4LPostPro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ qx.Class.define("osparc.component.tutorial.ti.S4LPostPro", {
3232
const label1 = osparc.component.tutorial.ti.Slides.createLabel(text1);
3333
this._add(label1);
3434

35-
const image1 = new qx.ui.basic.Image("osparc/tutorial/ti/PostProS4L.gif").set({
35+
const image1 = new qx.ui.basic.Image("https://itisfoundation.github.io/ti-planning-tool-manual/assets/quickguide/postpro_s4l.gif").set({
3636
alignX: "center",
3737
scale: true,
3838
width: 737,

services/web/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
144144
},
145145

146146
__replaceNewStudyWithNewPlanButton: function(mode = "grid") {
147+
if (!osparc.data.Permissions.getInstance().isTester()) {
148+
this._resourcesContainer.remove(this.__newStudyBtn);
149+
}
147150
osparc.data.Resources.get("templates")
148151
.then(templates => {
149152
// replace if a "TI Planning Tool" template exists

services/web/client/source/class/osparc/data/Permissions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ qx.Class.define("osparc.data.Permissions", {
240240
},
241241

242242
isTester: function() {
243-
return this.getRole() === "tester";
243+
return ["admin", "tester"].includes(this.getRole());
244244
}
245245
}
246246
});
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2022 IT'IS Foundation, https://itis.swiss
9+
10+
License:
11+
MIT: https://opensource.org/licenses/MIT
12+
13+
Authors:
14+
* Odei Maiz (odeimaiz)
15+
16+
************************************************************************ */
17+
18+
qx.Class.define("osparc.store.StaticInfo", {
19+
extend: qx.core.Object,
20+
type: "singleton",
21+
22+
construct: function() {
23+
this.base(arguments);
24+
25+
osparc.data.Resources.get("statics");
26+
},
27+
28+
members: {
29+
getValue: function(key) {
30+
return new Promise((resolve, reject) => {
31+
osparc.data.Resources.get("statics")
32+
.then(staticData => {
33+
if (key in staticData) {
34+
resolve(staticData[key]);
35+
} else {
36+
const errorMsg = "key not found in statics";
37+
console.error(errorMsg);
38+
reject(errorMsg);
39+
}
40+
})
41+
.catch(err => reject(err));
42+
});
43+
},
44+
45+
getDisplayNameKey: function() {
46+
const productName = osparc.utils.Utils.getProductName();
47+
return productName + "DisplayName";
48+
}
49+
}
50+
});
-28.5 KB
Loading

tests/e2e/tutorials/tutorialBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class TutorialBase {
180180

181181
async checkFirstStudyId(studyId) {
182182
await this.__page.waitForSelector('[osparc-test-id="studiesList"]');
183-
await this.waitFor(1000);
183+
await this.waitFor(5000, "Wait for studies to be loaded");
184184
const studies = await utils.getVisibleChildrenIDs(this.__page, '[osparc-test-id="studiesList"]');
185185
console.log("checkFirstStudyId", studyId);
186186
console.log(studies);

0 commit comments

Comments
 (0)