File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
168168 ! osparc . auth . Manager . getInstance ( ) . isLoggedIn ( ) ||
169169 ! osparc . utils . DisabledPlugins . isFoldersEnabled ( ) ||
170170 this . getCurrentContext ( ) === "studiesAndFolders" ||
171- this . getCurrentContext ( ) === "search" || // not yet implemented for workspaces
172171 this . __loadingWorkspaces
173172 ) {
174173 return ;
@@ -179,7 +178,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
179178 case "search" : {
180179 const filterData = this . _searchBarFilter . getFilterData ( ) ;
181180 const text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ;
182- request = osparc . store . Workspaces . getInstance ( ) . searchWorkspaces ( text ) ;
181+ request = osparc . store . Workspaces . getInstance ( ) . searchWorkspaces ( text , this . getOrderBy ( ) ) ;
183182 break ;
184183 }
185184 case "workspaces" : {
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ qx.Class.define("osparc.data.Resources", {
368368 getPageSearch : {
369369 useCache : false ,
370370 method : "GET" ,
371- url : statics . API + "/workspaces:search ?offset={offset}&limit={limit}&text={text }&order_by={orderBy}"
371+ url : statics . API + "/workspaces?offset={offset}&limit={limit}&filters={filters }&order_by={orderBy}"
372372 } ,
373373 getPageTrashed : {
374374 useCache : false ,
Original file line number Diff line number Diff line change @@ -103,16 +103,24 @@ qx.Class.define("osparc.store.Workspaces", {
103103 } ) ;
104104 } ,
105105
106- searchWorkspaces : function ( text ) {
106+ searchWorkspaces : function (
107+ text ,
108+ orderBy = {
109+ field : "modified_at" ,
110+ direction : "desc"
111+ } ,
112+ ) {
107113 if ( osparc . auth . Data . getInstance ( ) . isGuest ( ) ) {
108114 return new Promise ( resolve => {
109115 resolve ( [ ] ) ;
110116 } ) ;
111117 }
112118
119+ const curatedOrderBy = this . self ( ) . curateOrderBy ( orderBy ) ;
113120 const params = {
114121 url : {
115- text,
122+ filters : JSON . stringify ( { text : text } ) ,
123+ orderBy : JSON . stringify ( curatedOrderBy ) ,
116124 }
117125 } ;
118126 return osparc . data . Resources . getInstance ( ) . getAllPages ( "workspaces" , params , "getPageSearch" )
You can’t perform that action at this time.
0 commit comments