You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by "tenthe (via GitHub)" <gi...@apache.org> on 2023/11/24 07:45:42 UTC

Re: [PR] feat(#2192): add download button in asset management overview

tenthe commented on code in PR #2224:
URL: https://github.com/apache/streampipes/pull/2224#discussion_r1404033699


##########
ui/src/app/assets/components/asset-overview/asset-overview.component.ts:
##########
@@ -147,4 +150,26 @@ export class SpAssetOverviewComponent implements OnInit {
                 this.loadAssets();
             });
     }
+
+    downloadAsset(asset: SpAssetModel) {
+        this.dataExportService
+            .getExportPreview([asset._id])
+            .pipe(
+                mergeMap(preview =>
+                    this.dataExportService.triggerExport(preview),
+                ),
+            )
+            .subscribe((data: Blob) => {
+                const blob = new Blob([data], { type: 'application/zip' });

Review Comment:
   Hi @IsaakKrut,
   Is it also possible to use the file-saver API here? If not, the existing approach is ok for me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org