@@ -381,13 +381,16 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
381381 return selectedTagIds ;
382382 } ,
383383
384- __populateTags : function ( ) {
384+ __populateTags : function ( presentTagIds = [ ] ) {
385385 const selectedTagIds = this . __getSelectedTagIds ( ) ;
386386 const tagsLayout = this . getChildControl ( "tags-layout" ) ;
387387 tagsLayout . removeAll ( ) ;
388388 const maxTags = 10 ;
389389 this . __tagButtons = [ ] ;
390- osparc . store . Tags . getInstance ( ) . getTags ( ) . forEach ( ( tag , idx ) => {
390+ osparc . store . Tags . getInstance ( ) . getTags ( ) . forEach ( tag => {
391+ if ( ! presentTagIds . includes ( tag . getTagId ( ) ) ) {
392+ return ;
393+ }
391394 const button = new qx . ui . form . ToggleButton ( null , "@FontAwesome5Solid/tag/16" ) ;
392395 button . id = tag . getTagId ( ) ;
393396 tag . bind ( "name" , button , "label" ) ;
@@ -406,7 +409,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
406409 this . fireDataEvent ( "changeSelectedTags" , selection ) ;
407410 } , this ) ;
408411
409- button . setVisibility ( idx >= maxTags ? "excluded" : "visible" ) ;
412+ button . setVisibility ( this . __tagButtons . length >= maxTags ? "excluded" : "visible" ) ;
410413
411414 this . __tagButtons . push ( button ) ;
412415 } ) ;
@@ -447,6 +450,10 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", {
447450 tagsLayout . getChildren ( ) . forEach ( item => item . setPaddingLeft ( 10 ) ) ; // align them with the context
448451 }
449452 } ,
453+
454+ showPresentTags : function ( presentTagIds ) {
455+ this . __populateTags ( presentTagIds ) ;
456+ } ,
450457 /* /TAGS */
451458
452459 /* SERVICE TYPE */
0 commit comments