2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
|
|
|
|
2018-02-15 11:36:12 +01:00
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
2018-02-05 14:14:59 +01:00
|
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'publicationsTab',
|
|
|
|
template: `
|
2018-06-08 13:21:42 +02:00
|
|
|
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-06-11 01:25:33 +02:00
|
|
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
|
2017-12-19 13:53:46 +01:00
|
|
|
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
|
|
|
|
<a [queryParams]="paramsForSearchLink"
|
|
|
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications" class="uk-button uk-button-text">
|
2018-05-18 14:47:26 +02:00
|
|
|
View all {{fetchPublications.searchUtils.totalResults | number}} results
|
2017-12-19 13:53:46 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<tab-result [(results)]="fetchPublications.results"
|
|
|
|
[(status)]= "fetchPublications.status"
|
|
|
|
type="publication" urlParam="articleId">
|
|
|
|
</tab-result>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class PublicationsTabComponent {
|
|
|
|
@Input() paramsForSearchLink = {};//: string = "";
|
|
|
|
@Input() fetchPublications : FetchPublications;
|
2018-02-05 14:14:59 +01:00
|
|
|
@Input() properties:EnvProperties ;
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
public linkToSearchPublications = "";
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {}
|
|
|
|
}
|