@@ -192,6 +192,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
192192 return ;
193193 }
194194
195+ let filterEnabled = false ;
195196 let request = null ;
196197 switch ( this . getCurrentContext ( ) ) {
197198 case osparc . dashboard . StudyBrowser . CONTEXT . WORKSPACES :
@@ -203,6 +204,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
203204 case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS : {
204205 const filterData = this . _searchBarFilter . getFilterData ( ) ;
205206 const text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ;
207+ filterEnabled = filterData . tags . length || filterData . sharedWith ;
206208 request = osparc . store . Workspaces . getInstance ( ) . searchWorkspaces ( text , this . getOrderBy ( ) ) ;
207209 break ;
208210 }
@@ -212,6 +214,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
212214 this . __setWorkspacesToList ( [ ] ) ;
213215 request
214216 . then ( workspaces => {
217+ if ( filterEnabled ) {
218+ return Promise . resolve ( ) ;
219+ }
215220 this . __setWorkspacesToList ( workspaces ) ;
216221 if ( this . getCurrentContext ( ) === osparc . dashboard . StudyBrowser . CONTEXT . TRASH ) {
217222 if ( workspaces . length ) {
@@ -239,6 +244,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
239244 return ;
240245 }
241246
247+ let filterEnabled = false ;
242248 let request = null ;
243249 switch ( this . getCurrentContext ( ) ) {
244250 case osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS : {
@@ -253,6 +259,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
253259 case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS : {
254260 const filterData = this . _searchBarFilter . getFilterData ( ) ;
255261 const text = filterData . text ? encodeURIComponent ( filterData . text ) : "" ; // name, description and uuid
262+ filterEnabled = filterData . tags . length || filterData . sharedWith ;
256263 request = osparc . store . Folders . getInstance ( ) . searchFolders ( text , this . getOrderBy ( ) ) ;
257264 break ;
258265 }
@@ -262,6 +269,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
262269 this . __setFoldersToList ( [ ] ) ;
263270 return request
264271 . then ( folders => {
272+ if ( filterEnabled ) {
273+ return Promise . resolve ( ) ;
274+ }
265275 this . __setFoldersToList ( folders ) ;
266276 if ( this . getCurrentContext ( ) === osparc . dashboard . StudyBrowser . CONTEXT . TRASH ) {
267277 if ( folders . length ) {
@@ -792,9 +802,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
792802 delete reqParams [ "limit" ] ;
793803 delete reqParams [ "offset" ] ;
794804 delete reqParams [ "filters" ] ;
795- if ( reqParams [ "text" ] ) {
796- // decodeURIComponent the text to compare it with the currentParams
797- reqParams [ "text" ] = decodeURIComponent ( reqParams [ "text" ] ) ;
805+ if ( "text" in reqParams ) {
806+ if ( reqParams [ "text" ] === "" ) {
807+ delete reqParams [ "text" ] ;
808+ } else {
809+ // decodeURIComponent the text to compare it with the currentParams
810+ reqParams [ "text" ] = decodeURIComponent ( reqParams [ "text" ] ) ;
811+ }
798812 }
799813
800814 const cParams = this . __getRequestParams ( ) ;
0 commit comments