Skip to content

Commit 3d01610

Browse files
authored
✨ [Frontend] Tester Center (#6745)
1 parent 8d03d2a commit 3d01610

File tree

12 files changed

+349
-122
lines changed

12 files changed

+349
-122
lines changed

services/static-webserver/client/source/class/osparc/data/Permissions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ qx.Class.define("osparc.data.Permissions", {
138138
"study.nodestree.uuid.read",
139139
"study.filestree.uuid.read",
140140
"study.logger.debug.read",
141-
"statics.read"
142141
],
143142
"product_owner": [
144143
"user.invitation.generate",

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ qx.Class.define("osparc.desktop.preferences.Preferences", {
3232
if (osparc.product.Utils.showClusters()) {
3333
this.__addClustersPage();
3434
}
35-
if (osparc.data.Permissions.getInstance().canDo("statics.read")) {
36-
this.__addTestersPage();
37-
}
3835
},
3936

4037
members: {
@@ -85,12 +82,5 @@ qx.Class.define("osparc.desktop.preferences.Preferences", {
8582
.catch(err => console.error(err));
8683
}
8784
},
88-
89-
__addTestersPage: function() {
90-
const title = this.tr("Tester");
91-
const iconSrc = "@FontAwesome5Solid/user-md/24";
92-
const testerPage = new osparc.desktop.preferences.pages.TesterPage();
93-
this.addTab(title, iconSrc, testerPage);
94-
}
9585
}
9686
});

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/TesterPage.js

Lines changed: 0 additions & 88 deletions
This file was deleted.

services/static-webserver/client/source/class/osparc/file/FolderViewer.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,24 +201,6 @@ qx.Class.define("osparc.file.FolderViewer", {
201201
return control || this.base(arguments, id);
202202
},
203203

204-
__getEmptyEntry: function() {
205-
const items = [];
206-
if (this.getMode() === "list") {
207-
items.push([
208-
"",
209-
this.tr("Empty folder"),
210-
"",
211-
"",
212-
""
213-
]);
214-
} else if (this.getMode() === "icons") {
215-
items.push(this.self().getItemButton().set({
216-
label: this.tr("Empty folder")
217-
}));
218-
}
219-
return items;
220-
},
221-
222204
__convertEntries: function(content) {
223205
const items = [];
224206
if (this.getMode() === "list") {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ qx.Class.define("osparc.navigation.UserMenu", {
6161
control.addListener("execute", () => osparc.po.POCenterWindow.openWindow(), this);
6262
this.add(control);
6363
break;
64+
case "tester-center":
65+
control = new qx.ui.menu.Button(this.tr("Tester Center"));
66+
control.addListener("execute", () => osparc.tester.TesterCenterWindow.openWindow(), this);
67+
this.add(control);
68+
break;
6469
case "billing-center":
6570
control = new qx.ui.menu.Button(this.tr("Billing Center"));
6671
osparc.utils.Utils.setIdToWidget(control, "userMenuBillingCenterBtn");
@@ -157,6 +162,9 @@ qx.Class.define("osparc.navigation.UserMenu", {
157162
if (osparc.data.Permissions.getInstance().isProductOwner()) {
158163
this.getChildControl("po-center");
159164
}
165+
if (osparc.data.Permissions.getInstance().isTester()) {
166+
this.getChildControl("tester-center");
167+
}
160168
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
161169
this.getChildControl("billing-center");
162170
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2024 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.tester.Statics", {
19+
extend: osparc.po.BaseView,
20+
21+
members: {
22+
_createChildControlImpl: function(id) {
23+
let control;
24+
switch (id) {
25+
case "statics-container":
26+
control = osparc.ui.window.TabbedView.createSectionBox(this.tr("Statics"));
27+
this._add(control, {
28+
flex: 1
29+
});
30+
break;
31+
case "statics-content": {
32+
const statics = osparc.store.Store.getInstance().get("statics");
33+
const form = new qx.ui.form.Form();
34+
for (let [key, value] of Object.entries(statics)) {
35+
const textField = new qx.ui.form.TextField().set({
36+
value: typeof value === "object" ? JSON.stringify(value) : value.toString(),
37+
readOnly: true
38+
});
39+
form.add(textField, key, null, key);
40+
}
41+
const renderer = new qx.ui.form.renderer.Single(form);
42+
control = new qx.ui.container.Scroll(renderer);
43+
this.getChildControl("statics-container").add(control);
44+
break;
45+
}
46+
case "local-storage-container":
47+
control = osparc.ui.window.TabbedView.createSectionBox(this.tr("Local Storage"));
48+
this._add(control);
49+
break;
50+
case "local-storage-content": {
51+
const items = {
52+
...window.localStorage
53+
};
54+
const form = new qx.ui.form.Form();
55+
for (let [key, value] of Object.entries(items)) {
56+
const textField = new qx.ui.form.TextField().set({
57+
value: typeof value === "object" ? JSON.stringify(value) : value.toString(),
58+
readOnly: true
59+
});
60+
form.add(textField, key, null, key);
61+
}
62+
control = new qx.ui.form.renderer.Single(form);
63+
this.getChildControl("local-storage-container").add(control);
64+
break;
65+
}
66+
}
67+
return control || this.base(arguments, id);
68+
},
69+
70+
_buildLayout: function() {
71+
this.getChildControl("statics-content");
72+
this.getChildControl("local-storage-content");
73+
},
74+
}
75+
});
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2024 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.tester.TesterCenter", {
19+
extend: osparc.ui.window.TabbedView,
20+
21+
construct: function() {
22+
this.base(arguments);
23+
24+
const miniProfile = osparc.desktop.account.MyAccount.createMiniProfileView().set({
25+
paddingRight: 10
26+
});
27+
this.addWidgetOnTopOfTheTabs(miniProfile);
28+
29+
this.__addSocketMessagesPage();
30+
this.__addStaticsPage();
31+
},
32+
33+
members: {
34+
__addSocketMessagesPage: function() {
35+
const title = this.tr("Socket Messages");
36+
const iconSrc = "@FontAwesome5Solid/exchange-alt/22";
37+
const maintenance = new osparc.tester.WebSocketMessages();
38+
this.addTab(title, iconSrc, maintenance);
39+
},
40+
41+
__addStaticsPage: function() {
42+
const title = this.tr("Statics");
43+
const iconSrc = "@FontAwesome5Solid/wrench/22";
44+
const maintenance = new osparc.tester.Statics();
45+
this.addTab(title, iconSrc, maintenance);
46+
},
47+
}
48+
});
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* ************************************************************************
2+
3+
osparc - the simcore frontend
4+
5+
https://osparc.io
6+
7+
Copyright:
8+
2024 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.tester.TesterCenterWindow", {
19+
extend: osparc.ui.window.TabbedWindow,
20+
21+
construct: function() {
22+
this.base(arguments, "tester-center", this.tr("Tester Center"));
23+
24+
const width = 800;
25+
const maxHeight = 800;
26+
this.set({
27+
width,
28+
maxHeight,
29+
});
30+
31+
const testerCenter = new osparc.tester.TesterCenter();
32+
this._setTabbedView(testerCenter);
33+
},
34+
35+
statics: {
36+
openWindow: function() {
37+
const accountWindow = new osparc.tester.TesterCenterWindow();
38+
accountWindow.center();
39+
accountWindow.open();
40+
return accountWindow;
41+
}
42+
}
43+
});

0 commit comments

Comments
 (0)