@@ -161,6 +161,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
161161 __addItems : function ( ) {
162162 this . __addUIConfigItems ( ) ;
163163 if ( osparc . store . StaticInfo . getInstance ( ) . isDevFeaturesEnabled ( ) ) {
164+ this . __addHypertools ( ) ;
164165 this . __addOtherTabsAccess ( ) ;
165166 }
166167 this . getChildControl ( "new-folder" ) ;
@@ -187,6 +188,31 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
187188 }
188189 } ,
189190
191+ __addHypertools : function ( ) {
192+ const hypertools = osparc . store . Templates . getInstance ( ) . getTemplatesByType ( osparc . data . model . StudyUI . HYPERTOOL_TYPE ) ;
193+ if ( hypertools . length ) {
194+ const hypertoolsMenuButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/star/16" , this . tr ( "Hypertools" ) ) ;
195+ this . addAt ( hypertoolsMenuButton , this . __itemIdx ) ;
196+ this . __itemIdx ++ ;
197+
198+ const hypertoolsMenu = new qx . ui . menu . Menu ( ) . set ( {
199+ appearance : "menu-wider" ,
200+ } ) ;
201+ hypertoolsMenuButton . setMenu ( hypertoolsMenu ) ;
202+
203+ hypertools . forEach ( templateData => {
204+ const hypertoolButton = this . self ( ) . createMenuButton ( templateData [ "icon" ] , templateData [ "name" ] ) ;
205+ hypertoolButton . addListener ( "tap" , ( ) => {
206+ this . fireDataEvent ( "newStudyFromTemplateClicked" , {
207+ templateData,
208+ newStudyLabel : templateData [ "name" ] ,
209+ } ) ;
210+ } ) ;
211+ hypertoolsMenu . add ( hypertoolButton ) ;
212+ } ) ;
213+ }
214+ } ,
215+
190216 __addOtherTabsAccess : function ( ) {
191217 const moreMenuButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/star/16" , this . tr ( "More" ) ) ;
192218 this . addAt ( moreMenuButton , this . __itemIdx ) ;
@@ -195,30 +221,21 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", {
195221 const moreMenu = new qx . ui . menu . Menu ( ) . set ( {
196222 appearance : "menu-wider" ,
197223 } ) ;
224+ moreMenuButton . setMenu ( moreMenu ) ;
198225
199226 const permissions = osparc . data . Permissions . getInstance ( ) ;
200227 if ( permissions . canDo ( "dashboard.templates.read" ) ) {
201228 const templatesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/copy/16" , this . tr ( "Tutorials..." ) ) ;
202229 templatesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "templatesTab" ) , this ) ;
203230 moreMenu . add ( templatesButton ) ;
204-
205- const hypertoolsButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/copy/16" , this . tr ( "Hypertools..." ) ) ;
206- hypertoolsButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "hypertoolsTab" ) , this ) ;
207- const hypertools = osparc . store . Templates . getInstance ( ) . getTemplatesByType ( osparc . data . model . StudyUI . HYPERTOOL_TYPE ) ;
208- if ( hypertools . length ) {
209- moreMenu . add ( hypertoolsButton ) ;
210- }
211231 }
212232
213233 if ( permissions . canDo ( "dashboard.services.read" ) ) {
214234 const servicesButton = this . self ( ) . createMenuButton ( "@FontAwesome5Solid/cog/16" , this . tr ( "Services..." ) ) ;
215235 servicesButton . addListener ( "execute" , ( ) => this . fireDataEvent ( "changeTab" , "servicesTab" ) , this ) ;
216236 moreMenu . add ( servicesButton ) ;
217237 }
218-
219238 moreMenuButton . setVisibility ( moreMenu . getChildren ( ) . length ? "visible" : "excluded" ) ;
220-
221- moreMenuButton . setMenu ( moreMenu ) ;
222239 } ,
223240
224241 __getLastIdxFromCategory : function ( categoryId ) {
0 commit comments