43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import {Component, Input} from '@angular/core';
|
|
import { FetchResearchResults } from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
@Component({
|
|
selector: 'publicationsTab',
|
|
template: `
|
|
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
|
|
|
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
|
|
<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">
|
|
View all {{fetchPublications.searchUtils.totalResults | number}} results
|
|
</a>
|
|
</div>
|
|
<tab-result [results]="fetchPublications.results"
|
|
[status]= "fetchPublications.searchUtils.status"
|
|
type="publication" urlParam="articleId">
|
|
</tab-result>
|
|
</div>
|
|
`
|
|
})
|
|
|
|
export class PublicationsTabComponent {
|
|
@Input() paramsForSearchLink = {};//: string = "";
|
|
@Input() fetchPublications : FetchResearchResults;
|
|
@Input() properties:EnvProperties ;
|
|
|
|
public linkToSearchPublications = "";
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
constructor () {}
|
|
|
|
ngOnInit() {
|
|
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications
|
|
}
|
|
|
|
ngOnDestroy() {}
|
|
}
|