1
|
import {Component, Input} from '@angular/core';
|
2
|
|
3
|
import { SearchPublicationsComponent } from '../../searchPages/simple/searchPublications.component';
|
4
|
import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component';
|
5
|
|
6
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
7
|
|
8
|
@Component({
|
9
|
selector: 'relatedDatasourcesTab',
|
10
|
template: `
|
11
|
|
12
|
<div *ngIf="searchPublicationsComponent.results.length == 0" class = "uk-alert">
|
13
|
There are no related dataproviders
|
14
|
</div>
|
15
|
|
16
|
<div *ngIf="searchPublicationsComponent.results.length > 0">
|
17
|
<p>
|
18
|
The results below are discovered through our pilot algorithms.
|
19
|
<a href="mailto:">Let us know how we are doing!</a>
|
20
|
</p>
|
21
|
|
22
|
<table class="uk-table uk-table-striped">
|
23
|
<thead>
|
24
|
<tr>
|
25
|
<th class="uk-text-center">Data Provider Name</th>
|
26
|
<th class="uk-text-center">Number of publications/ datasets</th>
|
27
|
</tr>
|
28
|
</thead>
|
29
|
<tbody>
|
30
|
<tr *ngFor="let item of searchPublicationsComponent.results">
|
31
|
<td class="uk-text-center">
|
32
|
<a href="{{item.url}}" target="_blank" class="uk-icon-external-link">
|
33
|
{{item.name}}
|
34
|
</a>
|
35
|
</td>
|
36
|
<td class="uk-text-center">
|
37
|
<a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and"
|
38
|
target="_blank" class="uk-icon-external-link">
|
39
|
{{item.count}}
|
40
|
</a>
|
41
|
</td>
|
42
|
</tr>
|
43
|
</tbody>
|
44
|
</table>
|
45
|
</div>
|
46
|
`
|
47
|
})
|
48
|
|
49
|
export class RelatedDatasourcesTabComponent {
|
50
|
@Input() dataproviderId: string;
|
51
|
@Input() searchPublicationsComponent : SearchPublicationsComponent;
|
52
|
private linkToSearchPublications = "";
|
53
|
|
54
|
constructor () {}
|
55
|
|
56
|
ngOnInit() {
|
57
|
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications()+"?&hostedBy=";//+ +"&ho=and&collectedFrom="+ +"&co=and";
|
58
|
}
|
59
|
|
60
|
ngOnDestroy() {}
|
61
|
}
|