diff --git a/portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts b/portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts
index 22fa2073..13e5a818 100644
--- a/portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts
+++ b/portal-2/src/app/landingPages/dataProvider/dataProvider.module.ts
@@ -5,7 +5,7 @@ import { RouterModule } from '@angular/router';
import {IFrameModule} from '../../utils/iframe.module';
// import { ResultLandingModule } from '../resultLanding.module';
-import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
+import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
import {MetricsModule} from '../metrics.module';
import { LandingModule } from '../landing.module';
@@ -33,7 +33,7 @@ import { DataProviderRoutingModule } from './dataProvider-routing.module';
imports: [
CommonModule, FormsModule, RouterModule,
DataProviderRoutingModule,
- SearchResultsModule, IFrameModule, MetricsModule, LandingModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule
+ TabResultModule, IFrameModule, MetricsModule, LandingModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule
],
declarations: [
diff --git a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts
index 733aab97..d2912f68 100644
--- a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts
+++ b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts
@@ -22,10 +22,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
View all {{fetchDatasets.searchUtils.totalResults}} results
-
-
+
`
})
diff --git a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts
index 20be0b80..a08e9f3e 100644
--- a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts
+++ b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts
@@ -22,11 +22,11 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
View all {{fetchDataproviders.searchUtils.totalResults}} results
-
-
+
`
})
diff --git a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts
index 828a7cf8..990d06ac 100644
--- a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts
+++ b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts
@@ -23,10 +23,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
View all {{fetchProjects.searchUtils.totalResults}} results
-
-
+
`
})
diff --git a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts
index 158e93db..55fec3fe 100644
--- a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts
+++ b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts
@@ -25,10 +25,10 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
View all {{fetchPublications.searchUtils.totalResults}} results
-
-
+
`
})
diff --git a/portal-2/src/app/landingPages/organization/organization.component.html b/portal-2/src/app/landingPages/organization/organization.component.html
index c3ddf4b4..cb04c035 100644
--- a/portal-2/src/app/landingPages/organization/organization.component.html
+++ b/portal-2/src/app/landingPages/organization/organization.component.html
@@ -136,10 +136,10 @@
View all {{fetchDataproviders.searchUtils.totalResults}} results
-
-
+
-
+
Results (CSV)
-
+
`
})
@@ -29,6 +30,8 @@ export class SearchDownloadComponent {
@Output() downloadClick = new EventEmitter();
private downloadURLAPI: string;
+ @ViewChild (ModalLoading) loading : ModalLoading ;
+
constructor ( private _reportsService: ReportsService) {}
ngOnInit() {
@@ -57,9 +60,34 @@ export class SearchDownloadComponent {
}
downloadfile(url:string,filename:string){
console.log("Downloading file: "+ url);
- this._reportsService.downloadCSVFile(url)
- .subscribe(data => window.open(window.URL.createObjectURL(data),"reports.csv"),
- error => console.log("Error downloading the file."),
- () => console.log('Completed file download.'));
+ this.openLoading();
+ this.setMessageLoading("Downloading CSV file");
+
+ this._reportsService.downloadCSVFile(url).subscribe(
+ data => {
+ this.closeLoading();
+ window.open(window.URL.createObjectURL(data),filename+".csv")
+ },
+ error => console.log("Error downloading the file."),
+ () => console.log('Completed file download.')
+ );
+ }
+
+
+ public openLoading(){
+ if(this.loading){
+ this.loading.open();
}
+ }
+ public closeLoading(){
+ if(this.loading){
+ this.loading.close();
+ }
+ }
+ public setMessageLoading(message: string){
+ if(this.loading){
+ this.loading.message = message;
+ }
+ }
+
}
diff --git a/portal-2/src/app/searchPages/searchUtils/searchDownload.module.ts b/portal-2/src/app/searchPages/searchUtils/searchDownload.module.ts
index ad327a33..2fd947e4 100644
--- a/portal-2/src/app/searchPages/searchUtils/searchDownload.module.ts
+++ b/portal-2/src/app/searchPages/searchUtils/searchDownload.module.ts
@@ -3,10 +3,11 @@ import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {SearchDownloadComponent} from './searchDownload.component';
+import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
@NgModule({
imports: [
- CommonModule, FormsModule
+ CommonModule, FormsModule, LoadingModalModule
],
declarations: [
SearchDownloadComponent
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
index 5bcfd9f5..a0cb0cd8 100644
--- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
+++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
@@ -43,9 +43,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
@@ -58,9 +56,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
diff --git a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts
index dc1216bb..1655a28a 100644
--- a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts
+++ b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts
@@ -17,19 +17,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
-
-
-
-
-
- [no title available]
-
-
-
-
+
@@ -142,14 +130,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
})
export class SearchResultComponent {
- @Input() page: number;
- @Input() totalResults: number;
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() urlParam: string;
@Input() showLoading: boolean = false;
- @Input() lazy: string = "true";
public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper:RouterHelper = new RouterHelper();