@@ -835,37 +835,30 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
835835 requestParams . folderId = this . getCurrentFolderId ( ) ;
836836 break ;
837837 case "templates" :
838+ case "searchTemplates" :
838839 requestParams . type = "template" ;
839840 requestParams . templateType = osparc . data . model . StudyUI . TEMPLATE_TYPE ;
840841 requestParams . accessRights = "non-public" ;
841842 break ;
842843 case "publicTemplates" :
844+ case "searchPublicTemplates" :
843845 requestParams . type = "template" ;
844846 requestParams . templateType = osparc . data . model . StudyUI . TEMPLATE_TYPE ;
845847 requestParams . accessRights = "public" ;
846848 break ;
847849 case "searchProjects" : {
848850 requestParams . type = "user" ;
849- // Use the ``search`` functionality only if the user types some text
850- // tags should only be used to filter the current context (search context ot workspace/folder context)
851- const filterData = this . _searchBarFilter . getFilterData ( ) ;
852- if ( filterData . text ) {
853- requestParams . text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
854- requestParams [ "tagIds" ] = filterData . tags . length ? filterData . tags . join ( "," ) : "" ;
855- }
856851 break ;
857852 }
858- case "searchTemplates" :
859- case "searchPublicTemplates" : {
860- requestParams . type = "template" ;
861- // Use the ``search`` functionality only if the user types some text
862- // tags should only be used to filter the current context (search context ot workspace/folder context)
863- const filterData = this . _searchBarFilter . getFilterData ( ) ;
864- if ( filterData . text ) {
865- requestParams . text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
866- requestParams [ "tagIds" ] = filterData . tags . length ? filterData . tags . join ( "," ) : "" ;
867- }
868- break ;
853+ }
854+
855+ if ( this . getCurrentContext ( ) . includes ( "search" ) ) {
856+ // Use the ``search`` functionality only if the user types some text
857+ // tags should only be used to filter the current context (search context ot workspace/folder context)
858+ const filterData = this . _searchBarFilter . getFilterData ( ) ;
859+ if ( filterData . text ) {
860+ requestParams . text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
861+ requestParams [ "tagIds" ] = filterData . tags . length ? filterData . tags . join ( "," ) : "" ;
869862 }
870863 }
871864
@@ -1216,7 +1209,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12161209 break ;
12171210 case "templates" :
12181211 case "searchTemplates" :
1219- this . _searchBarFilter . resetFilters ( ) ;
1212+ if ( this . getCurrentContext ( ) === "templates" ) {
1213+ this . _searchBarFilter . resetFilters ( ) ;
1214+ }
12201215 this . _searchBarFilter . getChildControl ( "text-field" ) . setPlaceholder ( "Search in Templates" ) ;
12211216 this . _toolbar . show ( ) ;
12221217 this . _loadingResourcesBtn . setFetching ( false ) ;
@@ -1225,7 +1220,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12251220 break ;
12261221 case "publicTemplates" :
12271222 case "searchPublicTemplates" :
1228- this . _searchBarFilter . resetFilters ( ) ;
1223+ if ( this . getCurrentContext ( ) === "publicTemplates" ) {
1224+ this . _searchBarFilter . resetFilters ( ) ;
1225+ }
12291226 this . _searchBarFilter . getChildControl ( "text-field" ) . setPlaceholder ( "Search in Public Projects" ) ;
12301227 this . _toolbar . show ( ) ;
12311228 this . _loadingResourcesBtn . setFetching ( false ) ;
0 commit comments