@@ -180,7 +180,7 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
180180 const fetchPromise = dataStore . exportData ( paths ) ;
181181 const pollTasks = osparc . store . PollTasks . getInstance ( ) ;
182182 pollTasks . createPollingTask ( fetchPromise )
183- . then ( task => this . __exportDataTaskReceived ( task ) )
183+ . then ( task => osparc . task . ExportData . exportDataTaskReceived ( task ) )
184184 . catch ( err => osparc . FlashMessenger . logError ( err , this . tr ( "Unsuccessful files download" ) ) ) ;
185185 } ,
186186
@@ -245,71 +245,6 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
245245 }
246246 } ,
247247
248- __exportDataTaskReceived : function ( task ) {
249- const exportDataTaskUI = new osparc . task . ExportData ( ) ;
250- exportDataTaskUI . setTask ( task ) ;
251- osparc . task . TasksContainer . getInstance ( ) . addTaskUI ( exportDataTaskUI ) ;
252-
253- const progressWindow = new osparc . ui . window . Progress (
254- this . tr ( "Downloading files" ) ,
255- "@FontAwesome5Solid/download/14" ,
256- this . tr ( "Downloading files..." ) ,
257- ) ;
258- if ( task . getAbortHref ( ) ) {
259- const cancelButton = progressWindow . addCancelButton ( ) ;
260- cancelButton . setLabel ( this . tr ( "Ignore" ) ) ;
261- const abortButton = new qx . ui . form . Button ( ) . set ( {
262- label : this . tr ( "Cancel" ) ,
263- center : true ,
264- minWidth : 100 ,
265- } ) ;
266- abortButton . addListener ( "execute" , ( ) => task . abortRequested ( ) ) ;
267- progressWindow . addButton ( abortButton ) ;
268- abortButton . set ( {
269- appearance : "danger-button" ,
270- } ) ;
271- }
272- progressWindow . open ( ) ;
273-
274- task . addListener ( "updateReceived" , e => {
275- const data = e . getData ( ) ;
276- if ( data [ "task_progress" ] ) {
277- if ( "message" in data [ "task_progress" ] && data [ "task_progress" ] [ "message" ] ) {
278- progressWindow . setMessage ( data [ "task_progress" ] [ "message" ] ) ;
279- }
280- progressWindow . setProgress ( osparc . data . PollTask . extractProgress ( data ) * 100 ) ;
281- }
282- } , this ) ;
283- task . addListener ( "resultReceived" , e => {
284- const taskData = e . getData ( ) ;
285- if ( taskData [ "result" ] ) {
286- const params = {
287- url : {
288- locationId : 0 ,
289- fileUuid : encodeURIComponent ( taskData [ "result" ] ) ,
290- }
291- } ;
292- osparc . data . Resources . fetch ( "storageLink" , "getOne" , params )
293- . then ( data => {
294- if ( data && data . link ) {
295- const fileName = taskData [ "result" ] . split ( "/" ) . pop ( ) ;
296- osparc . utils . Utils . downloadLink ( data . link , "GET" , fileName ) ;
297- }
298- } )
299- }
300- progressWindow . close ( ) ;
301- } ) ;
302- task . addListener ( "taskAborted" , ( ) => {
303- osparc . FlashMessenger . logAs ( this . tr ( "Download aborted" ) , "WARNING" ) ;
304- progressWindow . close ( ) ;
305- } ) ;
306- task . addListener ( "pollingError" , e => {
307- const err = e . getData ( ) ;
308- osparc . FlashMessenger . logError ( err ) ;
309- progressWindow . close ( ) ;
310- } ) ;
311- } ,
312-
313248 __deleteTaskReceived : function ( task , paths ) {
314249 const taskUI = new osparc . task . TaskUI ( ) ;
315250 taskUI . setIcon ( "@FontAwesome5Solid/trash/14" ) ;
0 commit comments