@@ -181,15 +181,15 @@ qx.Class.define("osparc.jobs.RunsTable", {
181181 break ;
182182 }
183183 case "cancel" : {
184- this . __cancelRun ( rowData ) ;
184+ this . __cancelRunCollection ( rowData ) ;
185185 break ;
186186 }
187187 default :
188188 console . warn ( `Unknown action: ${ action } ` ) ;
189189 }
190190 } ,
191191
192- __cancelRun : function ( rowData ) {
192+ __cancelRunCollection : function ( rowData ) {
193193 const msg = this . tr ( "Are you sure you want to cancel" ) + " <b>" + rowData [ "name" ] + "</b>?" ;
194194 const confirmationWin = new osparc . ui . window . Confirmation ( msg ) . set ( {
195195 caption : this . tr ( "Cancel Run" ) ,
@@ -203,14 +203,17 @@ qx.Class.define("osparc.jobs.RunsTable", {
203203 confirmationWin . open ( ) ;
204204 confirmationWin . addListener ( "close" , ( ) => {
205205 if ( confirmationWin . getConfirmed ( ) ) {
206- const params = {
207- url : {
208- "studyId" : rowData [ "projectId" ] ,
209- } ,
210- } ;
211- // confirm with @matusdrobuliak 66 if this works
212- osparc . data . Resources . fetch ( "runPipeline" , "stopPipeline" , params )
213- . then ( ( ) => osparc . FlashMessenger . logAs ( this . tr ( "Stopping pipeline" ) , "INFO" ) )
206+ const promises = [ ] ;
207+ rowData [ "projectIds" ] . forEach ( projectId => {
208+ const params = {
209+ url : {
210+ "studyId" : projectId ,
211+ } ,
212+ } ;
213+ promises . push ( osparc . data . Resources . fetch ( "runPipeline" , "stopPipeline" , params ) )
214+ } ) ;
215+ Promise . all ( promises )
216+ . then ( ( ) => osparc . FlashMessenger . logAs ( this . tr ( "Stopping Run" ) , "INFO" ) )
214217 . catch ( err => osparc . FlashMessenger . logError ( err ) ) ;
215218 }
216219 } , this ) ;
0 commit comments