@@ -1226,40 +1226,50 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12261226
12271227 this . _searchBarFilter . addListener ( "filterChanged" , e => {
12281228 const filterData = e . getData ( ) ;
1229- if ( filterData . text ) {
1230- let searchContext = null ;
1231- switch ( this . getCurrentContext ( ) ) {
1232- case osparc . dashboard . StudyBrowser . CONTEXT . TEMPLATES :
1233- case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES :
1234- searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES ;
1235- break ;
1236- case osparc . dashboard . StudyBrowser . CONTEXT . PUBLIC_TEMPLATES :
1237- case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES :
1238- searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES ;
1239- break ;
1240- case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
1241- // functions are not searchable yet
1242- searchContext = null ;
1243- break ;
1244- default :
1229+ let searchContext = null ;
1230+ let backToContext = null ;
1231+ switch ( this . getCurrentContext ( ) ) {
1232+ case osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS :
1233+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS :
1234+ case osparc . dashboard . StudyBrowser . CONTEXT . TRASH :
1235+ if ( filterData . text ) {
12451236 searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS ;
1246- break ;
1247- }
1248- if ( searchContext ) {
1249- this . _changeContext ( searchContext ) ;
1250- }
1251- } else {
1252- let backToContext = osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS ;
1253- switch ( this . getCurrentContext ( ) ) {
1254- case osparc . dashboard . StudyBrowser . CONTEXT . TEMPLATES :
1255- case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES :
1237+ } else {
1238+ backToContext = osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS ;
1239+ }
1240+ break ;
1241+ case osparc . dashboard . StudyBrowser . CONTEXT . TEMPLATES :
1242+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES :
1243+ if ( filterData . text ) {
1244+ searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_TEMPLATES ;
1245+ } else {
12561246 backToContext = osparc . dashboard . StudyBrowser . CONTEXT . TEMPLATES ;
1257- break ;
1258- case osparc . dashboard . StudyBrowser . CONTEXT . PUBLIC_TEMPLATES :
1259- case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES :
1247+ }
1248+ break ;
1249+ case osparc . dashboard . StudyBrowser . CONTEXT . PUBLIC_TEMPLATES :
1250+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES :
1251+ if ( filterData . text ) {
1252+ searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PUBLIC_TEMPLATES ;
1253+ } else {
12601254 backToContext = osparc . dashboard . StudyBrowser . CONTEXT . PUBLIC_TEMPLATES ;
1261- break ;
1262- }
1255+ }
1256+ break ;
1257+ case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
1258+ // functions are not searchable yet
1259+ searchContext = null ;
1260+ backToContext = osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS ;
1261+ break ;
1262+ default :
1263+ if ( filterData . text ) {
1264+ searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_PROJECTS ;
1265+ } else {
1266+ backToContext = osparc . dashboard . StudyBrowser . CONTEXT . PROJECTS ;
1267+ }
1268+ break ;
1269+ }
1270+ if ( searchContext ) {
1271+ this . _changeContext ( searchContext ) ;
1272+ } else if ( backToContext ) {
12631273 const workspaceId = this . getCurrentWorkspaceId ( ) ;
12641274 const folderId = this . getCurrentFolderId ( ) ;
12651275 this . _changeContext ( backToContext , workspaceId , folderId ) ;
0 commit comments