@@ -109,8 +109,7 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
109109 setItemSelected : function ( selectedItem ) {
110110 if ( selectedItem ) {
111111 this . __selection = [ selectedItem ] ;
112- const isFile = osparc . file . FilesTree . isFile ( selectedItem ) ;
113- this . getChildControl ( "download-button" ) . setEnabled ( isFile ) ;
112+ this . getChildControl ( "download-button" ) . setEnabled ( true ) ; // folders can also be downloaded
114113 this . getChildControl ( "delete-button" ) . setEnabled ( true ) ; // folders can also be deleted
115114 this . getChildControl ( "selected-label" ) . setValue ( selectedItem . getLabel ( ) ) ;
116115 } else {
@@ -165,7 +164,7 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
165164 __retrieveURLAndDownloadFile : function ( file ) {
166165 const fileId = file . getFileId ( ) ;
167166 const locationId = file . getLocation ( ) ;
168- osparc . utils . Utils . downloadPaths ( locationId , fileId )
167+ osparc . utils . Utils . retrieveURLAndDownload ( locationId , fileId )
169168 . then ( data => {
170169 if ( data ) {
171170 osparc . DownloadLinkTracker . getInstance ( ) . downloadLinkUnattended ( data . link , data . fileName ) ;
@@ -283,17 +282,15 @@ qx.Class.define("osparc.file.FileLabelWithActions", {
283282 task . addListener ( "resultReceived" , e => {
284283 const data = e . getData ( ) ;
285284 if ( data [ "result" ] ) {
286- const link = data [ "result" ] ;
287-
288285 const params = {
289286 url : {
290287 locationId : 0 ,
291- fileUuid : link
288+ fileUuid : encodeURIComponent ( data [ "result" ] ) ,
292289 }
293290 } ;
294291 osparc . data . Resources . fetch ( "storageLink" , "getOne" , params )
295292 . then ( data2 => {
296- console . log ( data2 ) ;
293+ osparc . utils . Utils . downloadLink ( data2 . link , "GET" , "hey" ) ;
297294 } )
298295 }
299296 progressWindow . close ( ) ;
0 commit comments