Skip to content

Commit f39e4bf

Browse files
committed
RequestServiceAccess
1 parent 464e86a commit f39e4bf

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
150150
if (["study", "template", "tutorial"].includes(resourceData["resourceType"])) {
151151
const cantReadServices = osparc.study.Utils.getCantReadServices(resourceData["services"]);
152152
if (cantReadServices.length) {
153-
const requestAccessButton = new qx.ui.form.Button(this.tr("Request Access"));
153+
const requestAccessButton = new qx.ui.form.Button(this.tr("Request Apps Access"));
154154
osparc.dashboard.resources.pages.BasePage.decorateHeaderButton(requestAccessButton);
155155
requestAccessButton.addListener("execute", () => {
156-
console.log("cantReadServices", cantReadServices);
156+
osparc.share.RequestServiceAccess.openRequestAccess(cantReadServices);
157157
});
158158
toolbar.add(requestAccessButton);
159159
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* oSPARC - The SIMCORE frontend - https://osparc.io
3+
* Copyright: 2025 IT'IS Foundation - https://itis.swiss
4+
* License: MIT - https://opensource.org/licenses/MIT
5+
* Authors: Odei Maiz (odeimaiz)
6+
*/
7+
8+
qx.Class.define("osparc.share.RequestServiceAccess", {
9+
extend: qx.ui.core.Widget,
10+
11+
construct: function(cantReadServicesData) {
12+
this.base(arguments);
13+
14+
this._setLayout(new qx.ui.layout.VBox(25));
15+
16+
this.__populateLayout(cantReadServicesData);
17+
},
18+
19+
statics: {
20+
openRequestAccess: function(cantReadServicesData) {
21+
const requestServiceAccess = new osparc.share.RequestServiceAccess(cantReadServicesData);
22+
const caption = qx.locale.Manager.tr("Request Apps Access");
23+
osparc.ui.window.Window.popUpInWindow(requestServiceAccess, caption, 500, 500).set({
24+
clickAwayClose: false,
25+
resizable: true,
26+
showClose: true
27+
});
28+
}
29+
},
30+
31+
members: {
32+
__populateLayout: function(cantReadServicesData) {
33+
const text = this.tr("In order to open the Project, the following users/groups need to give you access to some apps. Please contact the app owner(s):");
34+
this._add(new qx.ui.basic.Label().set({
35+
value: text,
36+
font: "text-14",
37+
rich: true,
38+
wrap: true
39+
}));
40+
41+
const grid = new qx.ui.layout.Grid(20, 10);
42+
grid.setColumnAlign(0, "center", "middle");
43+
grid.setColumnAlign(1, "center", "middle");
44+
const layout = new qx.ui.container.Composite(grid);
45+
this._add(layout);
46+
47+
// Header
48+
layout.add(new qx.ui.basic.Label(this.tr("Owner"), {
49+
row: idx+1,
50+
column: 0
51+
}));
52+
layout.add(new qx.ui.basic.Label(this.tr("App"), {
53+
row: idx+1,
54+
column: 1
55+
}));
56+
57+
cantReadServicesData.forEach((cantReadServiceData, idx) => {
58+
const group = osparc.store.Groups.getInstance().getGroup(cantReadServiceData["owner"]);
59+
if (group) {
60+
layout.add(new qx.ui.basic.Label(group.getLabel()), {
61+
row: idx+1,
62+
column: 0
63+
});
64+
const appLabel = new qx.ui.basic.Label().set({
65+
value: `${cantReadServiceData["key"]} : ${osparc.service.Utils.extractVersionDisplay(cantReadServiceData["release"])}`,
66+
});
67+
layout.add(appLabel, {
68+
row: i,
69+
column: 1
70+
});
71+
}
72+
});
73+
}
74+
}
75+
});

0 commit comments

Comments
 (0)