Skip to content

Commit 5dd52be

Browse files
committed
tags filter only for templates
1 parent 810e941 commit 5dd52be

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,12 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
319319
this._addToLayout(resourcesContainer);
320320
},
321321

322-
_groupByChanged: function(groupBy) {
322+
__groupByChanged: function(groupBy) {
323323
this._resourcesContainer.setGroupBy(groupBy);
324324
this._reloadCards();
325+
if (this._resourceFilter) {
326+
this._resourceFilter.groupByChanged(groupBy);
327+
}
325328
},
326329

327330
__viewModeChanged: function(viewMode) {
@@ -348,14 +351,14 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
348351

349352
const dontGroup = new qx.ui.menu.RadioButton(this.tr("None"));
350353
osparc.utils.Utils.setIdToWidget(dontGroup, "groupByNone");
351-
dontGroup.addListener("execute", () => this._groupByChanged(null));
354+
dontGroup.addListener("execute", () => this.__groupByChanged(null));
352355

353356
groupByMenu.add(dontGroup);
354357
groupOptions.add(dontGroup);
355358

356359
if (this._resourceType === "template") {
357360
const groupByTag = new qx.ui.menu.RadioButton(this.tr("Tags"));
358-
groupByTag.addListener("execute", () => this._groupByChanged("tags"));
361+
groupByTag.addListener("execute", () => this.__groupByChanged("tags"));
359362
groupByMenu.add(groupByTag);
360363
groupOptions.add(groupByTag);
361364
if (
@@ -367,15 +370,15 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", {
367370
}
368371
} else if (this._resourceType === "service" && osparc.product.Utils.groupServices()) {
369372
const groupByFeatured = new qx.ui.menu.RadioButton(this.tr("Featured"));
370-
groupByFeatured.addListener("execute", () => this._groupByChanged("groupedServices"));
373+
groupByFeatured.addListener("execute", () => this.__groupByChanged("groupedServices"));
371374
groupByMenu.add(groupByFeatured);
372375
groupOptions.add(groupByFeatured);
373376
groupByFeatured.execute();
374377
groupByButton.exclude(); // don't let users change the grouping
375378
}
376379

377380
const groupByShared = new qx.ui.menu.RadioButton(this.tr("Shared with"));
378-
groupByShared.addListener("execute", () => this._groupByChanged("shared"));
381+
groupByShared.addListener("execute", () => this.__groupByChanged("shared"));
379382
groupByMenu.add(groupByShared);
380383
groupOptions.add(groupByShared);
381384

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
100100
}
101101
this._add(this.__createTrashBin());
102102
this.getChildControl("filters-spacer");
103-
this.getChildControl("tags-layout");
104103
break;
105104
}
106105
case "template":
@@ -449,6 +448,11 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
449448
tagsLayout.getChildren().forEach(item => item.setPaddingLeft(10)); // align them with the context
450449
}
451450
},
451+
452+
groupByChanged: function(groupBy) {
453+
const isTemplate = this.__resourceType === "template";
454+
this.getChildControl("tags-layout").setVisibility(isTemplate && groupBy === "tags" ? "visible" : "excluded");
455+
},
452456
/* /TAGS */
453457

454458
/* SERVICE TYPE */

0 commit comments

Comments
 (0)