Skip to content

Commit 5589d3d

Browse files
committed
isTutorial
1 parent 084d291 commit 5589d3d

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
567567
collaboratorsView.getChildControl("study-link").show();
568568
} else if (osparc.utils.Resources.isTemplate(resourceData)) {
569569
collaboratorsView.getChildControl("template-link").show();
570+
} else if (osparc.utils.Resources.isTutorial(resourceData)) {
571+
collaboratorsView.getChildControl("template-link").show();
570572
}
571573
collaboratorsView.addListener("updateAccessRights", e => {
572574
const updatedData = e.getData();
@@ -735,7 +737,12 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
735737
});
736738
page.addToContent(servicesBootOpts);
737739

738-
if (osparc.utils.Resources.isStudy(resourceData) || osparc.utils.Resources.isTemplate(resourceData)) {
740+
if (
741+
osparc.utils.Resources.isStudy(resourceData) ||
742+
osparc.utils.Resources.isTemplate(resourceData) ||
743+
osparc.utils.Resources.isTutorial(resourceData) ||
744+
osparc.utils.Resources.isHypertool(resourceData)
745+
) {
739746
if (osparc.product.Utils.showDisableServiceAutoStart()) {
740747
const study = new osparc.data.model.Study(resourceData);
741748
const autoStartButton = osparc.info.StudyUtils.createDisableServiceAutoStart(study).set({

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,17 @@ qx.Class.define("osparc.share.CollaboratorsStudy", {
215215
if (gid in potentialCollaborators && "getUserId" in potentialCollaborators[gid]) {
216216
// it's a user, not an organization
217217
const uid = potentialCollaborators[gid].getUserId();
218-
if (this._resourceType === "study") {
219-
osparc.notification.Notifications.postNewStudy(uid, this._serializedDataCopy["uuid"]);
220-
} else if (this._resourceType === "template") {
221-
// do not push TEMPLATE_SHARED notification if users are not supposed to see the templates
222-
if (osparc.data.Permissions.getInstance().canRoleDo("user", "dashboard.templates.read")) {
223-
osparc.notification.Notifications.postNewTemplate(uid, this._serializedDataCopy["uuid"]);
224-
}
218+
switch (this._resourceType) {
219+
case "study":
220+
osparc.notification.Notifications.postNewStudy(uid, this._serializedDataCopy["uuid"]);
221+
break;
222+
case "template":
223+
case "tutorial":
224+
// do not push TEMPLATE_SHARED notification if users are not supposed to see the templates
225+
if (osparc.data.Permissions.getInstance().canRoleDo("user", "dashboard.templates.read")) {
226+
osparc.notification.Notifications.postNewTemplate(uid, this._serializedDataCopy["uuid"]);
227+
}
228+
break;
225229
}
226230
}
227231
});

services/static-webserver/client/source/class/osparc/ui/list/CollaboratorListItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ qx.Class.define("osparc.ui.list.CollaboratorListItem", {
7676
members: {
7777
__getRoleInfo: function(id) {
7878
const resource = this.getResourceType();
79-
if (["study", "template", "hypertool"].includes(resource)) {
79+
if (["study", "template", "tutorial", "hypertool"].includes(resource)) {
8080
return osparc.data.Roles.STUDY[id];
8181
} else if (resource === "service") {
8282
return osparc.data.Roles.SERVICES[id];

services/static-webserver/client/source/class/osparc/utils/Resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ qx.Class.define("osparc.utils.Resources", {
3131
return ((templateData["resourceType"] === "template") && ("uuid" in templateData));
3232
},
3333

34+
isTutorial: function(tutorialData) {
35+
return ((tutorialData["resourceType"] === "tutorial") && ("uuid" in tutorialData));
36+
},
37+
3438
isHypertool: function(hypertoolData) {
3539
return ((hypertoolData["resourceType"] === "hypertool") && ("uuid" in hypertoolData));
3640
},

0 commit comments

Comments
 (0)