1
|
import {Component, Input} from '@angular/core';
|
2
|
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
3
|
|
4
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'publicationsTab',
|
8
|
template: `
|
9
|
<div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert">
|
10
|
There are no publications
|
11
|
</div>
|
12
|
|
13
|
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
14
|
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
|
15
|
<!--a [href] = "linkToSearchPublications">
|
16
|
View all {{fetchPublications.searchUtils.totalResults}} results
|
17
|
</a-->
|
18
|
<a [queryParams]="paramsForSearchLink"
|
19
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">
|
20
|
View all {{fetchPublications.searchUtils.totalResults}} results
|
21
|
</a>
|
22
|
</div>
|
23
|
<tab-result [(results)]="fetchPublications.results"
|
24
|
[(status)]= "fetchPublications.status"
|
25
|
type="publication" urlParam="articleId">
|
26
|
</tab-result>
|
27
|
</div>
|
28
|
`
|
29
|
})
|
30
|
|
31
|
export class PublicationsTabComponent {
|
32
|
@Input() paramsForSearchLink = {};//: string = "";
|
33
|
@Input() fetchPublications : FetchPublications;
|
34
|
public linkToSearchPublications = "";
|
35
|
|
36
|
constructor () {}
|
37
|
|
38
|
ngOnInit() {
|
39
|
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();//+this.paramsForSearchLink;
|
40
|
console.info("publications tab: init");
|
41
|
}
|
42
|
|
43
|
ngOnDestroy() {}
|
44
|
}
|