From ecc4f6ca1a97eab48368794c52d9a7399b6f2512 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Agneray?= <francois.agneray@lam.fr>
Date: Tue, 7 Dec 2021 12:04:45 +0100
Subject: [PATCH] Add info toastr when archive is downloading

---
 .../components/result/datatable-actions.component.ts      | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/client/src/app/instance/search/components/result/datatable-actions.component.ts b/client/src/app/instance/search/components/result/datatable-actions.component.ts
index 70e64e95..5c294996 100644
--- a/client/src/app/instance/search/components/result/datatable-actions.component.ts
+++ b/client/src/app/instance/search/components/result/datatable-actions.component.ts
@@ -1,6 +1,8 @@
 import { Component, Input, Output, EventEmitter } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 
+import { ToastrService } from 'ngx-toastr';
+
 import { Dataset, Attribute } from 'src/app/metamodel/models';
 import { Criterion, ConeSearch, criterionToString } from 'src/app/instance/store/models';
 import { getHost } from 'src/app/shared/utils';
@@ -22,7 +24,7 @@ export class DatatableActionsComponent {
     @Input() sampRegistered: boolean;
     @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.
@@ -99,6 +101,10 @@ export class DatatableActionsComponent {
     click(event, href, extension): void {
         event.preventDefault();
 
+        if (extension === 'zip') {
+            this.toastr.info('Achive is under construction, please wait', 'Download archive');
+        }
+
         this.http.get(href, {responseType: "blob"}).subscribe(
             data => {
                 let downloadLink = document.createElement('a');
-- 
GitLab