Skip to content

Commit 85d48fa

Browse files
committed
Merge branch 'master' into 7846-require-parent-info-when-running-function
2 parents fb19c75 + 522bfc6 commit 85d48fa

File tree

22 files changed

+312
-84
lines changed

22 files changed

+312
-84
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
136136
icon: "@FontAwesome5Solid/copy/16",
137137
paddingLeft: 10, // align it with the context
138138
});
139+
osparc.utils.Utils.setIdToWidget(templatesButton, "templatesFilterItem");
139140
templatesButton.addListener("changeValue", e => {
140141
const templatesEnabled = e.getData();
141142
if (templatesEnabled) {
@@ -153,6 +154,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
153154
icon: "@FontAwesome5Solid/globe/16",
154155
paddingLeft: 10, // align it with the context
155156
});
157+
osparc.utils.Utils.setIdToWidget(publicProjectsButton, "publicProjectsFilterItem");
156158
publicProjectsButton.addListener("changeValue", e => {
157159
const templatesEnabled = e.getData();
158160
if (templatesEnabled) {

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

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,29 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
141141
__classifiersPage: null,
142142
__qualityPage: null,
143143

144-
__addOpenButton: function(page) {
144+
__addToolbarButtons: function(page) {
145145
const resourceData = this.__resourceData;
146146

147147
const toolbar = this.self().createToolbar();
148148
page.addToHeader(toolbar);
149149

150-
if (["study", "template"].includes(this.__resourceData["resourceType"])) {
150+
if (["study", "template", "tutorial"].includes(resourceData["resourceType"])) {
151+
const cantReadServices = osparc.study.Utils.getCantReadServices(resourceData["services"]);
152+
if (cantReadServices.length) {
153+
const requestAccessButton = new qx.ui.form.Button(this.tr("Request Apps Access"));
154+
osparc.dashboard.resources.pages.BasePage.decorateHeaderButton(requestAccessButton);
155+
requestAccessButton.set({
156+
minWidth: 170,
157+
maxWidth: 170,
158+
});
159+
requestAccessButton.addListener("execute", () => {
160+
osparc.share.RequestServiceAccess.openRequestAccess(cantReadServices);
161+
});
162+
toolbar.add(requestAccessButton);
163+
}
164+
}
165+
166+
if (this.__resourceData["resourceType"] === "study") {
151167
const payDebtButton = new qx.ui.form.Button(this.tr("Credits required"));
152168
page.payDebtButton = payDebtButton;
153169
osparc.dashboard.resources.pages.BasePage.decorateHeaderButton(payDebtButton);
@@ -366,8 +382,9 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
366382
}
367383
});
368384

369-
370-
this.__getActivityOverviewPopUp();
385+
if (osparc.product.Utils.showComputationalActivity()) {
386+
this.__getActivityOverviewPopUp();
387+
}
371388
this.__getProjectFilesPopUp();
372389

373390
if (selectedTabId) {
@@ -405,7 +422,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
405422
const title = this.tr("Overview");
406423
const iconSrc = "@FontAwesome5Solid/info/22";
407424
const page = this.__infoPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
408-
this.__addOpenButton(page);
425+
this.__addToolbarButtons(page);
409426

410427
const lazyLoadContent = () => {
411428
const resourceData = this.__resourceData;
@@ -446,7 +463,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
446463
const title = this.tr("Billing Settings");
447464
const iconSrc = "@FontAwesome5Solid/cogs/22";
448465
const page = this.__billingSettings = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
449-
this.__addOpenButton(page);
466+
this.__addToolbarButtons(page);
450467

451468
if (resourceData["resourceType"] === "study") {
452469
const canBeOpened = osparc.study.Utils.canShowBillingOptions(resourceData);
@@ -473,7 +490,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
473490
const title = this.tr("Tiers");
474491
const iconSrc = "@FontAwesome5Solid/server/22";
475492
const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
476-
this.__addOpenButton(page);
493+
this.__addToolbarButtons(page);
477494

478495
const lazyLoadContent = () => {
479496
const pricingUnitsList = new osparc.service.PricingUnitsList(resourceData);
@@ -502,7 +519,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
502519
const title = this.tr("Pipeline View");
503520
const iconSrc = "@FontAwesome5Solid/eye/22";
504521
const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
505-
this.__addOpenButton(page);
522+
this.__addToolbarButtons(page);
506523

507524
const studyData = this.__resourceData;
508525
const enabled = osparc.study.Utils.canShowPreview(studyData);
@@ -528,7 +545,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
528545
const title = this.tr("Conversations");
529546
const iconSrc = "@FontAwesome5Solid/comments/22";
530547
const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
531-
this.__addOpenButton(page);
548+
this.__addToolbarButtons(page);
532549

533550
const lazyLoadContent = () => {
534551
const conversations = new osparc.study.Conversations(resourceData);
@@ -544,7 +561,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
544561
const title = this.tr("Sharing");
545562
const iconSrc = "@FontAwesome5Solid/share-alt/22";
546563
const page = this.__permissionsPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
547-
this.__addOpenButton(page);
564+
this.__addToolbarButtons(page);
548565

549566
const lazyLoadContent = () => {
550567
const resourceData = this.__resourceData;
@@ -587,7 +604,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
587604
const title = this.tr("Classifiers");
588605
const iconSrc = "@FontAwesome5Solid/search/22";
589606
const page = this.__classifiersPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
590-
this.__addOpenButton(page);
607+
this.__addToolbarButtons(page);
591608

592609
const lazyLoadContent = () => {
593610
const resourceData = this.__resourceData;
@@ -625,7 +642,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
625642
const title = this.tr("Quality");
626643
const iconSrc = "@FontAwesome5Solid/star-half/22";
627644
const page = this.__qualityPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
628-
this.__addOpenButton(page);
645+
this.__addToolbarButtons(page);
629646

630647
const lazyLoadContent = () => {
631648
const qualityEditor = new osparc.metadata.QualityEditor(resourceData);
@@ -655,7 +672,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
655672
const title = this.tr("Tags");
656673
const iconSrc = "@FontAwesome5Solid/tags/22";
657674
const page = this.__tagsPage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
658-
this.__addOpenButton(page);
675+
this.__addToolbarButtons(page);
659676

660677
const lazyLoadContent = () => {
661678
const tagManager = new osparc.form.tag.TagManager(resourceData);
@@ -681,7 +698,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
681698
const title = this.tr("Services Updates");
682699
const iconSrc = "@MaterialIcons/update/24";
683700
const page = this.__servicesUpdatePage = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
684-
this.__addOpenButton(page);
701+
this.__addToolbarButtons(page);
685702

686703
const studyData = this.__resourceData;
687704
const enabled = osparc.study.Utils.canShowServiceUpdates(studyData);
@@ -713,7 +730,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
713730
const title = this.tr("Boot Options");
714731
const iconSrc = "@FontAwesome5Solid/play-circle/22";
715732
const page = new osparc.dashboard.resources.pages.BasePage(title, iconSrc, id);
716-
this.__addOpenButton(page);
733+
this.__addToolbarButtons(page);
717734

718735
const studyData = this.__resourceData;
719736
const enabled = osparc.study.Utils.canShowServiceBootOptions(studyData);

services/static-webserver/client/source/class/osparc/jobs/JobsButton.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ qx.Class.define("osparc.jobs.JobsButton", {
2323

2424
this._setLayout(new qx.ui.layout.Canvas());
2525

26+
osparc.utils.Utils.setIdToWidget(this, "jobsButton");
27+
2628
this.set({
2729
width: 30,
2830
alignX: "center",

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ qx.Class.define("osparc.navigation.NavigationBar", {
117117

118118
// right-items
119119
this.getChildControl("tasks-button");
120-
this.getChildControl("jobs-button");
120+
if (osparc.product.Utils.showComputationalActivity()) {
121+
this.getChildControl("jobs-button");
122+
}
121123
this.getChildControl("notifications-button");
122124
this.getChildControl("expiration-icon");
123125
this.getChildControl("help");

services/static-webserver/client/source/class/osparc/product/Utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,13 @@ qx.Class.define("osparc.product.Utils", {
327327
return this.isS4LProduct() && licensesEnabled;
328328
},
329329

330+
showComputationalActivity: function() {
331+
if (this.isProduct("s4llite") || this.isProduct("tiplite")) {
332+
return false;
333+
}
334+
return true;
335+
},
336+
330337
getDefaultWelcomeCredits: function() {
331338
switch (osparc.product.Utils.getProductName()) {
332339
case "s4l":

services/static-webserver/client/source/class/osparc/share/CollaboratorsStudy.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -235,32 +235,7 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
235235
if (gids.length === 0) {
236236
return;
237237
}
238-
239-
const promises = [];
240-
gids.forEach(gid => {
241-
const params = {
242-
url: {
243-
"studyId": this._serializedDataCopy["uuid"],
244-
"gid": gid
245-
}
246-
};
247-
promises.push(osparc.data.Resources.fetch("studies", "checkShareePermissions", params));
248-
});
249-
Promise.all(promises)
250-
.then(values => {
251-
const noAccessible = values.filter(value => value["accessible"] === false);
252-
if (noAccessible.length) {
253-
const shareePermissions = new osparc.share.ShareePermissions(noAccessible);
254-
const win = osparc.ui.window.Window.popUpInWindow(shareePermissions, this.tr("Sharee permissions"), 500, 500, "@FontAwesome5Solid/exclamation-triangle/14").set({
255-
clickAwayClose: false,
256-
resizable: true,
257-
showClose: true
258-
});
259-
win.getChildControl("icon").set({
260-
textColor: "warning-yellow"
261-
});
262-
}
263-
});
238+
osparc.share.ShareePermissions.checkShareePermissions(this._serializedDataCopy["uuid"], gids);
264239
}
265240
}
266241
});
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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, 600, 400).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:");
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+
const layout = new qx.ui.container.Composite(grid);
43+
this._add(layout);
44+
45+
// Header
46+
layout.add(new qx.ui.basic.Label(this.tr("Owner")), {
47+
row: 0,
48+
column: 0
49+
});
50+
layout.add(new qx.ui.basic.Label(this.tr("Email")), {
51+
row: 0,
52+
column: 1
53+
});
54+
layout.add(new qx.ui.basic.Label(this.tr("App")), {
55+
row: 0,
56+
column: 2
57+
});
58+
59+
// Populate the grid with the cantReadServicesData
60+
cantReadServicesData.forEach((cantReadServiceData, idx) => {
61+
const group = osparc.store.Groups.getInstance().getGroup(cantReadServiceData["owner"]);
62+
if (group) {
63+
const username = new qx.ui.basic.Label(group.getLabel()).set({
64+
rich: true,
65+
selectable: true,
66+
});
67+
layout.add(username, {
68+
row: idx+1,
69+
column: 0
70+
});
71+
const email = new qx.ui.basic.Label(group.getEmail()).set({
72+
rich: true,
73+
selectable: true,
74+
});
75+
layout.add(email, {
76+
row: idx+1,
77+
column: 1
78+
});
79+
const appLabel = new qx.ui.basic.Label().set({
80+
value: `${cantReadServiceData["key"]}:${osparc.service.Utils.extractVersionDisplay(cantReadServiceData["release"])}`,
81+
rich: true,
82+
selectable: true,
83+
});
84+
layout.add(appLabel, {
85+
row: idx+1,
86+
column: 2
87+
});
88+
}
89+
});
90+
}
91+
}
92+
});

services/static-webserver/client/source/class/osparc/share/ShareePermissions.js

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
* Authors: Odei Maiz (odeimaiz)
66
*/
77

8+
/**
9+
* Data structure for showing sharee permissions. Array of objects with the following keys
10+
* - accessible: boolean
11+
* - gid: string // sharee group id
12+
* - inaccessible_services: Array of objects with keys "key" and "version"
13+
*/
814
qx.Class.define("osparc.share.ShareePermissions", {
915
extend: qx.ui.core.Widget,
1016

@@ -16,6 +22,37 @@ qx.Class.define("osparc.share.ShareePermissions", {
1622
this.__populateLayout(shareesData);
1723
},
1824

25+
statics: {
26+
checkShareePermissions: function(studyId, gids) {
27+
const promises = [];
28+
gids.forEach(gid => {
29+
const params = {
30+
url: {
31+
studyId,
32+
gid,
33+
}
34+
};
35+
promises.push(osparc.data.Resources.fetch("studies", "checkShareePermissions", params));
36+
});
37+
Promise.all(promises)
38+
.then(shareesData => {
39+
const inaccessibleShareesData = shareesData.filter(value => value["accessible"] === false);
40+
if (inaccessibleShareesData.length) {
41+
const shareePermissions = new osparc.share.ShareePermissions(inaccessibleShareesData);
42+
const caption = qx.locale.Manager.tr("Sharee permissions");
43+
const win = osparc.ui.window.Window.popUpInWindow(shareePermissions, caption, 500, 500, "@FontAwesome5Solid/exclamation-triangle/14").set({
44+
clickAwayClose: false,
45+
resizable: true,
46+
showClose: true
47+
});
48+
win.getChildControl("icon").set({
49+
textColor: "warning-yellow"
50+
});
51+
}
52+
});
53+
},
54+
},
55+
1956
members: {
2057
__populateLayout: function(shareesData) {
2158
const text = this.tr("The following users/groups will not be able to open the shared study, because they don't have access to some services. Please contact the service owner(s) to give permission.");
@@ -33,7 +70,7 @@ qx.Class.define("osparc.share.ShareePermissions", {
3370
this._add(layout);
3471
for (let i=0; i<shareesData.length; i++) {
3572
const shareeData = shareesData[i];
36-
const group = osparc.store.Groups.getInstance().getGroup(shareeData.gid);
73+
const group = osparc.store.Groups.getInstance().getGroup(shareeData["gid"]);
3774
if (group) {
3875
layout.add(new qx.ui.basic.Label(group.getLabel()), {
3976
row: i,
@@ -47,7 +84,9 @@ qx.Class.define("osparc.share.ShareePermissions", {
4784
});
4885
const infoButton = new qx.ui.form.Button(null, "@MaterialIcons/info_outline/14");
4986
infoButton.setAppearance("strong-button");
50-
const label = new qx.ui.basic.Label();
87+
const label = new qx.ui.basic.Label().set({
88+
alignY: "middle",
89+
});
5190
hBox.add(infoButton);
5291
hBox.add(label);
5392
osparc.store.Services.getService(inaccessibleService.key, inaccessibleService.version)

0 commit comments

Comments
 (0)