Skip to content
Snippets Groups Projects
Commit ecc4f6ca authored by François Agneray's avatar François Agneray
Browse files

Add info toastr when archive is downloading

parent 3a102013
No related branches found
No related tags found
1 merge request!29Develop
Pipeline #7049 passed
Pipeline: anis-next

#7050

    import { Component, Input, Output, EventEmitter } from '@angular/core'; import { Component, Input, Output, EventEmitter } from '@angular/core';
    import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
    import { ToastrService } from 'ngx-toastr';
    import { Dataset, Attribute } from 'src/app/metamodel/models'; import { Dataset, Attribute } from 'src/app/metamodel/models';
    import { Criterion, ConeSearch, criterionToString } from 'src/app/instance/store/models'; import { Criterion, ConeSearch, criterionToString } from 'src/app/instance/store/models';
    import { getHost } from 'src/app/shared/utils'; import { getHost } from 'src/app/shared/utils';
    ...@@ -22,7 +24,7 @@ export class DatatableActionsComponent { ...@@ -22,7 +24,7 @@ export class DatatableActionsComponent {
    @Input() sampRegistered: boolean; @Input() sampRegistered: boolean;
    @Output() broadcast: EventEmitter<string> = new EventEmitter(); @Output() broadcast: EventEmitter<string> = new EventEmitter();
    constructor(private appConfig: AppConfigService, private http: HttpClient) { } constructor(private appConfig: AppConfigService, private http: HttpClient, private toastr: ToastrService) { }
    /** /**
    * Checks if the download format is allowed by Anis Admin configuration. * Checks if the download format is allowed by Anis Admin configuration.
    ...@@ -99,6 +101,10 @@ export class DatatableActionsComponent { ...@@ -99,6 +101,10 @@ export class DatatableActionsComponent {
    click(event, href, extension): void { click(event, href, extension): void {
    event.preventDefault(); event.preventDefault();
    if (extension === 'zip') {
    this.toastr.info('Achive is under construction, please wait', 'Download archive');
    }
    this.http.get(href, {responseType: "blob"}).subscribe( this.http.get(href, {responseType: "blob"}).subscribe(
    data => { data => {
    let downloadLink = document.createElement('a'); let downloadLink = document.createElement('a');
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment