@@ -1789,13 +1789,32 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
17891789 convertToPipelineButton [ "convertToPipelineButton" ] = true ;
17901790 const uiMode = osparc . study . Utils . getUiMode ( studyData ) ;
17911791 convertToPipelineButton . setVisibility ( uiMode === "standalone" ? "visible" : "excluded" ) ;
1792- convertToPipelineButton . addListener ( "execute" , ( ) => {
1793- this . __updateUIMode ( studyData , "workbench" )
1794- . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Something went wrong while converting to pipeline" ) ) ) ;
1795- } , this ) ;
1792+ convertToPipelineButton . addListener ( "execute" , ( ) => this . __convertToPipelineClicked ( studyData ) , this ) ;
17961793 return convertToPipelineButton ;
17971794 } ,
17981795
1796+ __convertToPipelineClicked : function ( studyData ) {
1797+ let message = this . tr ( "Would you like to convert this project to a pipeline?" ) ;
1798+ message += "<br>" + this . tr ( "Alternatively, you can create a copy of the project and convert the copy instead." ) ;
1799+ const confirmationWin = new osparc . ui . window . Confirmation ( ) ;
1800+ confirmationWin . set ( {
1801+ caption : this . tr ( "Convert to Pipeline" ) ,
1802+ confirmText : this . tr ( "Convert" ) ,
1803+ confirmAction : "create" ,
1804+ message,
1805+ } )
1806+ confirmationWin . getChildControl ( "cancel-button" ) . set ( {
1807+ label : this . tr ( "Create a copy and convert it" ) ,
1808+ } ) ;
1809+ confirmationWin . addListener ( "close" , ( ) => {
1810+ if ( confirmationWin . getConfirmed ( ) ) {
1811+ this . __updateUIMode ( studyData , "workbench" )
1812+ . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Something went wrong while converting to pipeline" ) ) ) ;
1813+ }
1814+ } ) ;
1815+ confirmationWin . open ( ) ;
1816+ } ,
1817+
17991818 __updateUIMode : function ( studyData , uiMode ) {
18001819 const studyUI = osparc . utils . Utils . deepCloneObject ( studyData [ "ui" ] ) ;
18011820 studyUI [ "mode" ] = uiMode ;
0 commit comments