@@ -664,17 +664,23 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
664664 const requestParams = { } ;
665665 requestParams . orderBy = JSON . stringify ( this . getOrderBy ( ) ) ;
666666
667- const filterData = this . _searchBarFilter . getFilterData ( ) ;
668- // Use the ``search`` functionality only if the user types some text
669- // tags should only be used to filter the current context (search context ot workspace/folder context)
670- if ( filterData . text ) {
671- requestParams . text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
672- requestParams [ "tagIds" ] = filterData . tags . length ? filterData . tags . join ( "," ) : "" ;
673- return requestParams ;
667+ switch ( this . getCurrentContext ( ) ) {
668+ case "studiesAndFolders" :
669+ requestParams . workspaceId = this . getCurrentWorkspaceId ( ) ;
670+ requestParams . folderId = this . getCurrentFolderId ( ) ;
671+ break ;
672+ case "search" : {
673+ // Use the ``search`` functionality only if the user types some text
674+ // tags should only be used to filter the current context (search context ot workspace/folder context)
675+ const filterData = this . _searchBarFilter . getFilterData ( ) ;
676+ if ( filterData . text ) {
677+ requestParams . text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
678+ requestParams [ "tagIds" ] = filterData . tags . length ? filterData . tags . join ( "," ) : "" ;
679+ }
680+ break ;
681+ }
674682 }
675683
676- requestParams . workspaceId = this . getCurrentWorkspaceId ( ) ;
677- requestParams . folderId = this . getCurrentFolderId ( ) ;
678684 return requestParams ;
679685 } ,
680686
@@ -699,12 +705,19 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
699705 resolveWResponse : true
700706 } ;
701707
702- if ( this . getCurrentContext ( ) === "trash" ) {
703- return osparc . data . Resources . fetch ( "studies" , "getPageTrashed" , params , options ) ;
704- } else if ( "text" in requestParams ) {
705- return osparc . data . Resources . fetch ( "studies" , "getPageSearch" , params , options ) ;
708+ let request = null ;
709+ switch ( this . getCurrentContext ( ) ) {
710+ case "trash" :
711+ request = osparc . data . Resources . fetch ( "studies" , "getPageTrashed" , params , options ) ;
712+ break ;
713+ case "search" :
714+ request = osparc . data . Resources . fetch ( "studies" , "getPageSearch" , params , options ) ;
715+ break ;
716+ case "studiesAndFolders" :
717+ request = osparc . data . Resources . fetch ( "studies" , "getPage" , params , options ) ;
718+ break ;
706719 }
707- return osparc . data . Resources . fetch ( "studies" , "getPage" , params , options ) ;
720+ return request ;
708721 } ,
709722
710723 invalidateStudies : function ( ) {
0 commit comments