Project

General

Profile

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 = "alert alert-info " >
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="table table-striped">
23
                <thead>
24
                    <tr>
25
                        <th class="text-center">Data Provider Name</th>
26
                        <th class="text-center">Number of publications/ datasets</th>
27
                    </tr>
28
                </thead>
29
                <tbody>
30
                    <tr *ngFor="let item of searchPublicationsComponent.results">
31
                        <td class="text-center">
32
                            <a href="{{item.url}}" target="_blank">
33
                                {{item.name}}
34
                            </a>
35
                        </td>
36
                        <td class="text-center">
37
                            <a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and" target="_blank">
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() searchPublicationsComponent : SearchPublicationsComponent;
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
}
(8-8/10)