@@ -58,6 +58,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
5858 SEARCH_PROJECTS : "searchProjects" ,
5959 SEARCH_TEMPLATES : "searchTemplates" ,
6060 SEARCH_PUBLIC_TEMPLATES : "searchPublicTemplates" ,
61+ SEARCH_FUNCTIONS : "searchFunctions" ,
6162 }
6263 } ,
6364
@@ -73,6 +74,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
7374 "searchProjects" , // osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PROJECTS,
7475 "searchTemplates" , // osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_TEMPLATES,
7576 "searchPublicTemplates" , // osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_PUBLIC_TEMPLATES,
77+ "searchFunctions" , // osparc.dashboard.StudyBrowser.CONTEXT.SEARCH_FUNCTIONS,
7678 ] ,
7779 nullable : false ,
7880 init : "studiesAndFolders" ,
@@ -336,7 +338,8 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
336338 this . __addResourcesToList ( filteredTemplates ) ;
337339 break ;
338340 }
339- case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS : {
341+ case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
342+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_FUNCTIONS : {
340343 const functions = resp [ "data" ] ;
341344 functions . forEach ( func => func [ "resourceType" ] = "function" ) ;
342345 this . __addResourcesToList ( functions ) ;
@@ -886,6 +889,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
886889 requestParams . accessRights = "public" ;
887890 break ;
888891 case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
892+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_FUNCTIONS :
889893 delete requestParams . orderBy ; // functions do not support ordering yet
890894 requestParams . includeExtras = "true" ;
891895 break ;
@@ -1285,9 +1289,12 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
12851289 }
12861290 break ;
12871291 case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
1288- // functions are not searchable yet
1289- searchContext = null ;
1290- backToContext = osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS ;
1292+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_FUNCTIONS :
1293+ if ( filterData && filterData . text ) {
1294+ searchContext = osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_FUNCTIONS ;
1295+ } else {
1296+ backToContext = osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS ;
1297+ }
12911298 break ;
12921299 default :
12931300 if ( filterData && filterData . text ) {
@@ -1395,10 +1402,11 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
13951402 this . __reloadStudies ( ) ;
13961403 break ;
13971404 case osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS :
1398- this . _searchBarFilter . resetFilters ( ) ;
1405+ case osparc . dashboard . StudyBrowser . CONTEXT . SEARCH_FUNCTIONS :
1406+ if ( this . getCurrentContext ( ) === osparc . dashboard . StudyBrowser . CONTEXT . FUNCTIONS ) {
1407+ this . _searchBarFilter . resetFilters ( ) ;
1408+ }
13991409 this . _searchBarFilter . getChildControl ( "text-field" ) . setPlaceholder ( "Search in Functions" ) ;
1400- // functions can't be searched yet
1401- this . _searchBarFilter . setEnabled ( false ) ;
14021410 // functions can't be sorted yet
14031411 this . __sortByButton . exclude ( ) ;
14041412 this . _loadingResourcesBtn . setFetching ( false ) ;
0 commit comments