Project

General

Profile

1
import {Component, Input} from '@angular/core';
2

    
3
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
4

    
5
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
6

    
7
@Component({
8
    selector: 'relatedDatasourcesTab',
9
    template: `
10

    
11
        <div *ngIf="fetchPublications.results.length == 0" class = "uk-alert">
12
            There are no related dataproviders
13
        </div>
14

    
15
        <div *ngIf="fetchPublications.results.length > 0">
16
            <p>
17
                The results below are discovered through our pilot algorithms.
18
                <a href="mailto:">Let us know how we are doing!</a>
19
            </p>
20

    
21
            <table class="uk-table uk-table-striped">
22
                <thead>
23
                    <tr>
24
                        <th class="uk-text-center">Data Provider Name</th>
25
                        <th class="uk-text-center">Number of publications/ datasets</th>
26
                    </tr>
27
                </thead>
28
                <tbody>
29
                    <tr *ngFor="let item of fetchPublications.results">
30
                        <td class="uk-text-center">
31
                            <a href="{{item.url}}" target="_blank" class="uk-icon-external-link">
32
                                {{item.name}}
33
                            </a>
34
                        </td>
35
                        <td class="uk-text-center">
36
                            <a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and"
37
                                target="_blank" class="uk-icon-external-link">
38
                                {{item.count}}
39
                            </a>
40
                        </td>
41
                    </tr>
42
                </tbody>
43
            </table>
44
        </div>
45
    `
46
})
47

    
48
export class RelatedDatasourcesTabComponent {
49
    @Input() dataproviderId: string;
50
    @Input() fetchPublications : FetchPublications;
51
    private linkToSearchPublications = "";
52

    
53
    constructor () {}
54

    
55
    ngOnInit() {
56
        this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications()+"?&hostedBy=";//+ +"&ho=and&collectedFrom="+ +"&co=and";
57
    }
58

    
59
    ngOnDestroy() {}
60
}
(11-11/13)