Skip to content

Commit 49c72f9

Browse files
committed
resourceType tutorial
1 parent d60c8bd commit 49c72f9

File tree

8 files changed

+46
-9
lines changed

8 files changed

+46
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
166166

167167
_populateCardMenu: function(card) {
168168
const studyData = card.getResourceData();
169-
if (studyData["resourceType"] === "template") {
169+
if (studyData["resourceType"] === "hypertool") {
170170
// The App Browser can also list templates (hypertools)
171171
this._populateTemplateCardMenu(card);
172172
} else {

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ qx.Class.define("osparc.dashboard.CardBase", {
325325
check: [
326326
"study",
327327
"template",
328-
"service",
328+
"tutorial",
329329
"hypertool",
330+
"service",
330331
],
331332
init: true,
332333
nullable: true,
@@ -519,6 +520,7 @@ qx.Class.define("osparc.dashboard.CardBase", {
519520
switch (resourceData["resourceType"]) {
520521
case "study":
521522
case "template":
523+
case "tutorial":
522524
case "hypertool":
523525
uuid = resourceData.uuid ? resourceData.uuid : null;
524526
owner = resourceData.prjOwner ? resourceData.prjOwner : "";
@@ -552,7 +554,12 @@ qx.Class.define("osparc.dashboard.CardBase", {
552554
workbench
553555
});
554556

555-
if (["study", "template", "hypertool"].includes(resourceData["resourceType"])) {
557+
if ([
558+
"study",
559+
"template",
560+
"tutorial",
561+
"hypertool"
562+
].includes(resourceData["resourceType"])) {
556563
osparc.store.Services.getStudyServices(resourceData.uuid)
557564
.then(resp => {
558565
const services = resp["services"];
@@ -1055,6 +1062,8 @@ qx.Class.define("osparc.dashboard.CardBase", {
10551062
toolTipText += osparc.product.Utils.getStudyAlias();
10561063
} else if (this.isResourceType("template")) {
10571064
toolTipText += osparc.product.Utils.getTemplateAlias();
1065+
} else if (this.isResourceType("tutorial")) {
1066+
toolTipText += osparc.product.Utils.getTutorialAlias();
10581067
} else if (this.isResourceType("hypertool")) {
10591068
toolTipText += osparc.product.Utils.getAppAlias();
10601069
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ qx.Class.define("osparc.dashboard.GridButtonItem", {
185185
// overridden
186186
_applyLastChangeDate: function(value, old) {
187187
if (value) {
188-
if (["study", "template", "hypertool"].includes(this.getResourceType())) {
188+
if ([
189+
"study",
190+
"template",
191+
"tutorial",
192+
"hypertool",
193+
].includes(this.getResourceType())) {
189194
const dateBy = this.getChildControl("date-by");
190195
dateBy.set({
191196
date: value,

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
186186
// overridden
187187
_applyLastChangeDate: function(value, old) {
188188
if (value) {
189-
if (["study", "template", "hypertool"].includes(this.getResourceType())) {
189+
if ([
190+
"study",
191+
"template",
192+
"tutorial",
193+
"hypertool",
194+
].includes(this.getResourceType())) {
190195
const dateBy = this.getChildControl("date-by");
191196
dateBy.set({
192197
date: value,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
916916
break;
917917
}
918918
case "template":
919+
case "tutorial":
919920
case "hypertool":
920921
this._createStudyFromTemplate(resourceData);
921922
break;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
2727
switch (resourceData["resourceType"]) {
2828
case "study":
2929
case "template":
30+
case "tutorial":
3031
case "hypertool": {
3132
const params = {
3233
url: {
@@ -54,6 +55,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
5455
switch (resourceData["resourceType"]) {
5556
case "study":
5657
case "template":
58+
case "tutorial":
5759
case "hypertool":
5860
osparc.store.Services.getStudyServicesMetadata(latestResourceData)
5961
.finally(() => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ qx.Class.define("osparc.dashboard.TutorialBrowser", {
9494
},
9595

9696
__setResourcesToList: function(tutorialsList) {
97-
tutorialsList.forEach(tutorial => tutorial["resourceType"] = "template");
97+
tutorialsList.forEach(tutorial => tutorial["resourceType"] = "tutorial");
9898
this._resourcesList = tutorialsList;
9999
this._reloadCards();
100100
},

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ qx.Class.define("osparc.product.Utils", {
8181
return alias;
8282
},
8383

84-
getServiceAlias: function(options = {}) {
85-
let alias = qx.locale.Manager.tr("service");
84+
getTutorialAlias: function(options = {}) {
85+
let alias = qx.locale.Manager.tr("tutorial");
8686
if (options.plural) {
87-
alias = qx.locale.Manager.tr("services");
87+
alias = qx.locale.Manager.tr("tutorials");
8888
}
8989

9090
if (options.firstUpperCase) {
@@ -111,6 +111,21 @@ qx.Class.define("osparc.product.Utils", {
111111
return alias;
112112
},
113113

114+
getServiceAlias: function(options = {}) {
115+
let alias = qx.locale.Manager.tr("service");
116+
if (options.plural) {
117+
alias = qx.locale.Manager.tr("services");
118+
}
119+
120+
if (options.firstUpperCase) {
121+
alias = osparc.utils.Utils.capitalize(alias);
122+
} else if (options.allUpperCase) {
123+
alias = alias.toUpperCase();
124+
}
125+
126+
return alias;
127+
},
128+
114129
getAppAlias: function(options = {}) {
115130
let alias = qx.locale.Manager.tr("app");
116131
if (options.plural) {

0 commit comments

Comments
 (0)