Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [Frontend] Tester Center #6745

Merged
merged 22 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ qx.Class.define("osparc.data.Permissions", {
"study.nodestree.uuid.read",
"study.filestree.uuid.read",
"study.logger.debug.read",
"statics.read"
],
"product_owner": [
"user.invitation.generate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ qx.Class.define("osparc.desktop.preferences.Preferences", {
if (osparc.product.Utils.showClusters()) {
this.__addClustersPage();
}
if (osparc.data.Permissions.getInstance().canDo("statics.read")) {
this.__addTestersPage();
}
},

members: {
Expand Down Expand Up @@ -85,12 +82,5 @@ qx.Class.define("osparc.desktop.preferences.Preferences", {
.catch(err => console.error(err));
}
},

__addTestersPage: function() {
const title = this.tr("Tester");
const iconSrc = "@FontAwesome5Solid/user-md/24";
const testerPage = new osparc.desktop.preferences.pages.TesterPage();
this.addTab(title, iconSrc, testerPage);
}
}
});

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,6 @@ qx.Class.define("osparc.file.FolderViewer", {
return control || this.base(arguments, id);
},

__getEmptyEntry: function() {
const items = [];
if (this.getMode() === "list") {
items.push([
"",
this.tr("Empty folder"),
"",
"",
""
]);
} else if (this.getMode() === "icons") {
items.push(this.self().getItemButton().set({
label: this.tr("Empty folder")
}));
}
return items;
},

__convertEntries: function(content) {
const items = [];
if (this.getMode() === "list") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ qx.Class.define("osparc.navigation.UserMenu", {
control.addListener("execute", () => osparc.po.POCenterWindow.openWindow(), this);
this.add(control);
break;
case "tester-center":
control = new qx.ui.menu.Button(this.tr("Tester Center"));
control.addListener("execute", () => osparc.tester.TesterCenterWindow.openWindow(), this);
this.add(control);
break;
case "billing-center":
control = new qx.ui.menu.Button(this.tr("Billing Center"));
osparc.utils.Utils.setIdToWidget(control, "userMenuBillingCenterBtn");
Expand Down Expand Up @@ -157,6 +162,9 @@ qx.Class.define("osparc.navigation.UserMenu", {
if (osparc.data.Permissions.getInstance().isProductOwner()) {
this.getChildControl("po-center");
}
if (osparc.data.Permissions.getInstance().isTester()) {
this.getChildControl("tester-center");
}
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
this.getChildControl("billing-center");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

Copyright:
2024 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

qx.Class.define("osparc.tester.Statics", {
extend: osparc.po.BaseView,

members: {
_createChildControlImpl: function(id) {
let control;
switch (id) {
case "statics-container":
control = osparc.ui.window.TabbedView.createSectionBox(this.tr("Statics"));
this._add(control);
break;
case "statics-content": {
const statics = osparc.store.Store.getInstance().get("statics");
const form = new qx.ui.form.Form();
for (let [key, value] of Object.entries(statics)) {
const textField = new qx.ui.form.TextField().set({
value: typeof value === "object" ? JSON.stringify(value) : value.toString(),
readOnly: true
});
form.add(textField, key, null, key);
}
control = new qx.ui.form.renderer.Single(form);
this.getChildControl("statics-container").add(control);
break;
}
case "local-storage-container":
control = osparc.ui.window.TabbedView.createSectionBox(this.tr("Local Storage"));
this._add(control);
break;
case "local-storage-content": {
const items = {
...window.localStorage
};
const form = new qx.ui.form.Form();
for (let [key, value] of Object.entries(items)) {
const textField = new qx.ui.form.TextField().set({
value: typeof value === "object" ? JSON.stringify(value) : value.toString(),
readOnly: true
});
form.add(textField, key, null, key);
}
control = new qx.ui.form.renderer.Single(form);
this.getChildControl("local-storage-container").add(control);
break;
}
}
return control || this.base(arguments, id);
},

_buildLayout: function() {
this.getChildControl("statics-content");
this.getChildControl("local-storage-content");
},
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

Copyright:
2024 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

qx.Class.define("osparc.tester.TesterCenter", {
extend: osparc.ui.window.TabbedView,

construct: function() {
this.base(arguments);

const miniProfile = osparc.desktop.account.MyAccount.createMiniProfileView().set({
paddingRight: 10
});
this.addWidgetOnTopOfTheTabs(miniProfile);

this.__addStaticsPage();
this.__addSocketMessagesPage();
},

members: {
__addStaticsPage: function() {
const title = this.tr("Statics");
const iconSrc = "@FontAwesome5Solid/wrench/22";
const maintenance = new osparc.tester.Statics();
this.addTab(title, iconSrc, maintenance);
},

__addSocketMessagesPage: function() {
const title = this.tr("Socket Messages");
const iconSrc = "@FontAwesome5Solid/wrench/22";
const maintenance = new osparc.tester.WebSocketMessages();
this.addTab(title, iconSrc, maintenance);
},
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* ************************************************************************

osparc - the simcore frontend

https://osparc.io

Copyright:
2024 IT'IS Foundation, https://itis.swiss

License:
MIT: https://opensource.org/licenses/MIT

Authors:
* Odei Maiz (odeimaiz)

************************************************************************ */

qx.Class.define("osparc.tester.TesterCenterWindow", {
extend: osparc.ui.window.TabbedWindow,

construct: function() {
this.base(arguments, "tester-center", this.tr("Tester Center"));

const width = 800;
const maxHeight = 800;
this.set({
width,
maxHeight,
});

const testerCenter = new osparc.tester.TesterCenter();
this._setTabbedView(testerCenter);
},

statics: {
openWindow: function() {
const accountWindow = new osparc.tester.TesterCenterWindow();
accountWindow.center();
accountWindow.open();
return accountWindow;
}
}
});
Loading
Loading