Commit 88e5dae6 authored by Javi Corvi's avatar Javi Corvi
Browse files

icons and export with csv extension

parent 786d67c5
Pipeline #25832 passed with stage
in 1 minute and 4 seconds
......@@ -94,11 +94,11 @@
<!-- <a title="Export Findings" (click)="exportDocument" download="download.json">
<i class="fa fa-file-export" style="color:black;padding: 10px 30px; font-size: 2rem;"></i>
</a> -->
<!-- <a (click)="getAllEvidence()" style="text-decoration:none;cursor: pointer;">
<a (click)="getAllEvidence()" style="text-decoration:none;cursor: pointer;">
<i class="fa fa-eye" style="color:black;padding: 10px 30px; font-size: 2rem;" title="Show All Evidence"> </i>
</a> -->
</a>
<a (click)="findDocumentText()" style="text-decoration:none;cursor: pointer;">
<i class="fa fa-eye" style="color:black;padding: 10px 30px; font-size: 2rem;" title="Show Plain Text"> </i>
<i class="fa fa-file-text" style="color:black;padding: 10px 30px; font-size: 2rem;" title="Show Plain Text"> </i>
</a>
<a (click)="exportDocument()" style="text-decoration:none;cursor: pointer;">
<i class="fa fa-download" style="color:black;padding: 10px 30px; font-size: 2rem;" title="Export Findings"> </i>
......
......@@ -588,7 +588,7 @@ export class DocumentDetailComponent implements OnInit {
exportDocument() {
const id = +this.route.snapshot.paramMap.get('id');
this.documentService.exportDocument(id);
this.documentService.exportDocument(id, this.document.name);
}
......
......@@ -48,15 +48,17 @@ export class DocumentService {
}
/** GET document by id. Will 404 if id not found */
exportDocument(id: number): any {
exportDocument(id: number, name: string): any {
const url = `${this.documentsUrl}export/${id}`;
return this.http.get(url, {
responseType: 'blob',
observe: 'response'
})
.pipe(map(res => {
console.log(res.headers.get('content-disposition'));
return {
filename: id+'.txt',
data: res
filename: name + '.csv',
data: res.body
};
}))
.subscribe(res => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment