1
|
import {Component, Input} from '@angular/core';
|
2
|
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
3
|
|
4
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'datasetsTab',
|
8
|
template: `
|
9
|
<div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
10
|
There are no datasets
|
11
|
</div>
|
12
|
|
13
|
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
|
14
|
<p>
|
15
|
The results below are discovered through our pilot algorithms.
|
16
|
<a href="mailto:">Let us know how we are doing!</a>
|
17
|
</p>
|
18
|
|
19
|
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
|
20
|
<search-result [(results)]="fetchDatasets.results" [(status)]= "fetchDatasets.searchUtils.status"></search-result>
|
21
|
</div>
|
22
|
`
|
23
|
})
|
24
|
|
25
|
export class DatasetsTabComponent {
|
26
|
@Input() paramsForSearchLink: string = "";
|
27
|
@Input() fetchDatasets : FetchDatasets;
|
28
|
public linkToSearchDatasets = "";
|
29
|
|
30
|
constructor () {}
|
31
|
|
32
|
ngOnInit() {
|
33
|
this.linkToSearchDatasets = OpenaireProperties.getLinkToAdvancedSearchDatasets()+this.paramsForSearchLink;
|
34
|
}
|
35
|
|
36
|
ngOnDestroy() {}
|
37
|
}
|