@@ -629,6 +629,27 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
629629 return null ;
630630 } ,
631631
632+ __getPageParams : function ( ) {
633+ const filterData = this . _searchBarFilter . getFilterData ( ) ;
634+ if ( filterData . text || filterData . tags . length ) {
635+ const searchParams = { } ;
636+ searchParams . text = "" ;
637+ searchParams . tags = "" ;
638+ if ( filterData . text ) {
639+ searchParams . text = encodeURIComponent ( filterData . text ) ; // name, description and uuid
640+ }
641+ if ( searchParams . tags ) {
642+ searchParams . tags = filterData . tags . join ( "," ) ;
643+ }
644+ return searchParams ;
645+ }
646+
647+ const contextParams = { } ;
648+ contextParams . workspaceId = this . getCurrentWorkspaceId ( ) ;
649+ contextParams . folderId = this . getCurrentFolderId ( ) ;
650+ return contextParams ;
651+ } ,
652+
632653 __getNextStudiesRequest : function ( ) {
633654 const params = {
634655 url : {
@@ -647,14 +668,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
647668 resolveWResponse : true
648669 } ;
649670
650- const filterData = this . _searchBarFilter . getFilterData ( ) ;
651- if ( filterData . text ) {
652- params . url . text = encodeURIComponent ( filterData . text ) ; // name, description and uuid
671+ const pageParams = this . __getPageParams ( ) ;
672+ Object . entries ( pageParams ) . forEach ( ( [ key , value ] ) => {
673+ params . url [ key ] = value ;
674+ } ) ;
675+ if ( "text" in pageParams ) {
653676 return osparc . data . Resources . fetch ( "studies" , "getPageSearch" , params , undefined , options ) ;
654677 }
655-
656- params . url . workspaceId = this . getCurrentWorkspaceId ( ) ;
657- params . url . folderId = this . getCurrentFolderId ( ) ;
658678 return osparc . data . Resources . fetch ( "studies" , "getPage" , params , undefined , options ) ;
659679 } ,
660680
0 commit comments