@@ -80,9 +80,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
8080 label : this . tr ( "Convert to Pipeline" ) ,
8181 icon : null ,
8282 } ) ;
83- control . addListener ( "execute" , ( ) => {
84- this . getStudy ( ) . getUi ( ) . setMode ( "pipeline" ) ;
85- } ) ;
83+ control . addListener ( "execute" , ( ) => this . __convertToPipelineClicked ( ) , this ) ;
8684 break ;
8785 case "study-menu-restore" :
8886 control = new qx . ui . menu . Button ( ) . set ( {
@@ -105,7 +103,9 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
105103 optionsMenu . setAppearance ( "menu-wider" ) ;
106104 optionsMenu . add ( this . getChildControl ( "study-menu-info" ) ) ;
107105 optionsMenu . add ( this . getChildControl ( "study-menu-reload" ) ) ;
108- optionsMenu . add ( this . getChildControl ( "study-menu-convert-to-pipeline" ) ) ;
106+ if ( osparc . product . Utils . hasConvertToPipelineEnabled ( ) ) {
107+ optionsMenu . add ( this . getChildControl ( "study-menu-convert-to-pipeline" ) ) ;
108+ }
109109 optionsMenu . add ( this . getChildControl ( "study-menu-restore" ) ) ;
110110 optionsMenu . add ( this . getChildControl ( "study-menu-open-logger" ) ) ;
111111 control = new qx . ui . form . MenuButton ( ) . set ( {
@@ -151,13 +151,11 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
151151 converter : mode => mode === "standalone" ? "visible" : "excluded"
152152 } ) ;
153153
154- const convertToPipelineButton = this . getChildControl ( "study-menu-convert-to-pipeline" ) ;
155154 if ( osparc . product . Utils . hasConvertToPipelineEnabled ( ) ) {
155+ const convertToPipelineButton = this . getChildControl ( "study-menu-convert-to-pipeline" ) ;
156156 study . getUi ( ) . bind ( "mode" , convertToPipelineButton , "visibility" , {
157157 converter : mode => mode === "standalone" ? "visible" : "excluded"
158158 } ) ;
159- } else {
160- convertToPipelineButton . exclude ( ) ;
161159 }
162160
163161 const restoreButton = this . getChildControl ( "study-menu-restore" ) ;
@@ -172,6 +170,10 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
172170 } else {
173171 this . exclude ( ) ;
174172 }
175- }
173+ } ,
174+
175+ __convertToPipelineClicked : function ( ) {
176+ this . getStudy ( ) . getUi ( ) . setMode ( "pipeline" ) ;
177+ } ,
176178 }
177179} ) ;
0 commit comments