Skip to content

Commit 43176dd

Browse files
committed
hasNewPlusButton
1 parent bd32496 commit 43176dd

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
252252
.catch(console.error)
253253
.finally(() => {
254254
// In favor of the NewPlusButton
255-
if (!["tis", "tiplite"].includes(osparc.product.Utils.getProductName())) {
255+
if (!osparc.product.Utils.hasNewPlusButton()) {
256256
this.__addNewFolderButton();
257257
}
258258
this.__loadingFolders = null;
@@ -922,20 +922,21 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
922922
}
923923
}
924924

925-
switch (osparc.product.Utils.getProductName()) {
926-
case "osparc":
927-
this.__addEmptyStudyPlusButton();
928-
break;
929-
case "tis":
930-
case "tiplite":
931-
// In favor of the NewPlusButton
932-
// this.__addTIPPlusButton();
933-
break;
934-
case "s4l":
935-
case "s4lacad":
936-
case "s4llite":
937-
this.__addPlusButtonsFromServices();
938-
break;
925+
if (!osparc.product.Utils.hasNewPlusButton()) {
926+
switch (osparc.product.Utils.getProductName()) {
927+
case "osparc":
928+
this.__addEmptyStudyPlusButton();
929+
break;
930+
case "tis":
931+
case "tiplite":
932+
this.__addTIPPlusButton();
933+
break;
934+
case "s4l":
935+
case "s4lacad":
936+
case "s4llite":
937+
this.__addPlusButtonsFromServices();
938+
break;
939+
}
939940
}
940941
},
941942

@@ -1072,7 +1073,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
10721073
this.__addSortByButton();
10731074
this._addViewModeButton();
10741075

1075-
if (osparc.product.Utils.isProduct("tis") || osparc.product.Utils.isProduct("tiplite")) {
1076+
if (osparc.product.Utils.hasNewPlusButton()) {
10761077
this.__addNewPlusButton();
10771078
}
10781079

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ qx.Class.define("osparc.product.Utils", {
293293
break;
294294
}
295295
return url;
296-
}
296+
},
297+
298+
hasNewPlusButton: function() {
299+
return [
300+
"tis",
301+
"tiplite",
302+
"s4l",
303+
"s4lacad",
304+
"s4llite",
305+
].includes(osparc.product.Utils.getProductName());
306+
},
297307
}
298308
});

0 commit comments

Comments
 (0)