@@ -34,7 +34,6 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
3434
3535 members : {
3636 __sortBy : null ,
37- __hypertools : null ,
3837
3938 // overridden
4039 initResources : function ( ) {
@@ -50,7 +49,6 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
5049 ] )
5150 . then ( resps => {
5251 const services = resps [ 0 ] ;
53- const hypertools = resps [ 1 ] ;
5452 // Show "Contact Us" message if services.length === 0
5553 // Most probably is a product-stranger user (it can also be that the catalog is down)
5654 if ( Object . keys ( services ) . length === 0 ) {
@@ -63,8 +61,6 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
6361 osparc . FlashMessenger . getInstance ( ) . logAs ( msg , "WARNING" ) ;
6462 }
6563
66- console . log ( "hypertools" , hypertools ) ;
67- this . __hypertools = hypertools ;
6864 this . getChildControl ( "resources-layout" ) ;
6965 this . reloadResources ( ) ;
7066 this . _hideLoadingPage ( ) ;
@@ -73,13 +69,32 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
7369
7470 reloadResources : function ( ) {
7571 this . __loadServices ( ) ;
72+ this . __loadHypertools ( ) ;
7673 } ,
7774
7875 __loadServices : function ( ) {
7976 const excludeFrontend = true ;
8077 const excludeDeprecated = true
8178 osparc . store . Services . getServicesLatestList ( excludeFrontend , excludeDeprecated )
82- . then ( servicesList => this . __setServicesToList ( servicesList . filter ( service => service !== null ) ) ) ;
79+ . then ( servicesList => {
80+ servicesList . forEach ( service => service [ "resourceType" ] = "service" ) ;
81+ this . _resourcesList . push ( ...servicesList . filter ( service => service !== null ) ) ;
82+ this . __sortAndReload ( ) ;
83+ } ) ;
84+ } ,
85+
86+ __loadHypertools : function ( ) {
87+ osparc . store . Templates . getTemplatesHypertools ( )
88+ . then ( hypertoolsList => {
89+ hypertoolsList . forEach ( hypertool => hypertool [ "resourceType" ] = "hypertool" ) ;
90+ this . _resourcesList . push ( ...hypertoolsList . filter ( hypertool => hypertool !== null ) ) ;
91+ this . __sortAndReload ( ) ;
92+ } ) ;
93+ } ,
94+
95+ __sortAndReload : function ( ) {
96+ osparc . service . Utils . sortObjectsBasedOn ( this . _resourcesList , this . __sortBy ) ;
97+ this . _reloadCards ( ) ;
8398 } ,
8499
85100 _updateServiceData : function ( serviceData ) {
@@ -92,13 +107,6 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
92107 }
93108 } ,
94109
95- __setServicesToList : function ( servicesList ) {
96- servicesList . forEach ( service => service [ "resourceType" ] = "service" ) ;
97- osparc . service . Utils . sortObjectsBasedOn ( servicesList , this . __sortBy ) ;
98- this . _resourcesList = servicesList ;
99- this . _reloadCards ( ) ;
100- } ,
101-
102110 _reloadCards : function ( ) {
103111 this . _resourcesContainer . setResourcesToList ( this . _resourcesList ) ;
104112 const cards = this . _resourcesContainer . reloadCards ( "services" ) ;
@@ -141,7 +149,7 @@ qx.Class.define("osparc.dashboard.AppBrowser", {
141149 } ) ;
142150 containerSortButtons . addListener ( "sortBy" , e => {
143151 this . __sortBy = e . getData ( ) ;
144- this . __setServicesToList ( this . _resourcesList ) ;
152+ this . __sortAndReload ( ) ;
145153 } , this ) ;
146154 this . _toolbar . add ( containerSortButtons ) ;
147155 } ,
0 commit comments