Skip to content

Commit 4eb6476

Browse files
authored
🎨 [Frontend] Enh: admins are also pos (ITISFoundation#8185)
1 parent fbfc6fc commit 4eb6476

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ qx.Class.define("osparc.data.Permissions", {
324324
},
325325

326326
isProductOwner: function() {
327-
return this.getRole() === "product_owner";
327+
return ["admin", "product_owner"].includes(this.getRole());
328328
},
329329

330330
isAdmin: function() {
331-
return this.getRole() === "admin";
331+
return ["admin"].includes(this.getRole());
332332
},
333333
}
334334
});

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ qx.Class.define("osparc.navigation.UserMenu", {
5151
control.addListener("execute", () => osparc.desktop.account.MyAccountWindow.openWindow(), this);
5252
this.add(control);
5353
break;
54-
case "admin-center":
55-
control = new qx.ui.menu.Button(this.tr("Admin Center"));
56-
control.addListener("execute", () => osparc.admin.AdminCenterWindow.openWindow(), this);
54+
case "tester-center":
55+
control = new qx.ui.menu.Button(this.tr("Tester Center"));
56+
control.addListener("execute", () => osparc.tester.TesterCenterWindow.openWindow(), this);
5757
this.add(control);
5858
break;
5959
case "po-center":
6060
control = new qx.ui.menu.Button(this.tr("PO Center"));
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);
64+
case "admin-center":
65+
control = new qx.ui.menu.Button(this.tr("Admin Center"));
66+
control.addListener("execute", () => osparc.admin.AdminCenterWindow.openWindow(), this);
6767
this.add(control);
6868
break;
6969
case "billing-center":
@@ -144,14 +144,14 @@ qx.Class.define("osparc.navigation.UserMenu", {
144144
this.getChildControl("log-in");
145145
} else {
146146
this.getChildControl("user-center");
147-
if (osparc.data.Permissions.getInstance().isAdmin()) {
148-
this.getChildControl("admin-center");
147+
if (osparc.data.Permissions.getInstance().isTester()) {
148+
this.getChildControl("tester-center");
149149
}
150150
if (osparc.data.Permissions.getInstance().isProductOwner()) {
151151
this.getChildControl("po-center");
152152
}
153-
if (osparc.data.Permissions.getInstance().isTester()) {
154-
this.getChildControl("tester-center");
153+
if (osparc.data.Permissions.getInstance().isAdmin()) {
154+
this.getChildControl("admin-center");
155155
}
156156
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
157157
this.getChildControl("billing-center");
@@ -196,14 +196,14 @@ qx.Class.define("osparc.navigation.UserMenu", {
196196
this.getChildControl("log-in");
197197
} else {
198198
this.getChildControl("user-center");
199-
if (osparc.data.Permissions.getInstance().isAdmin()) {
200-
this.getChildControl("admin-center");
199+
if (osparc.data.Permissions.getInstance().isTester()) {
200+
this.getChildControl("tester-center");
201201
}
202202
if (osparc.data.Permissions.getInstance().isProductOwner()) {
203203
this.getChildControl("po-center");
204204
}
205-
if (osparc.data.Permissions.getInstance().isTester()) {
206-
this.getChildControl("tester-center");
205+
if (osparc.data.Permissions.getInstance().isAdmin()) {
206+
this.getChildControl("admin-center");
207207
}
208208
if (osparc.desktop.credits.Utils.areWalletsEnabled()) {
209209
this.getChildControl("billing-center");

services/static-webserver/client/source/class/osparc/po/UsersPending.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ qx.Class.define("osparc.po.UsersPending", {
340340
__createRejectButton: function(email) {
341341
const button = new osparc.ui.form.FetchButton("Reject");
342342
button.addListener("execute", () => {
343-
const msg = `Are you sure you want to reject ${email}.<br>The operation cannot be reverted"`;
343+
const msg = `Are you sure you want to reject ${email}.<br>The operation cannot be reverted`;
344344
const win = new osparc.ui.window.Confirmation(msg).set({
345345
caption: "Reject User",
346346
confirmText: "Reject",

0 commit comments

Comments
 (0)