2018-07-26 18:38:59 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
2019-09-11 11:45:54 +02:00
|
|
|
import { FetchResearchResults } from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
2018-07-26 18:38:59 +02:00
|
|
|
|
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
|
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'orpsTab',
|
|
|
|
template: `
|
|
|
|
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'" tab_error_class=true></errorMessages>
|
|
|
|
|
|
|
|
<div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE">
|
|
|
|
<div class = "uk-text-right" *ngIf = "fetchOrps.searchUtils.totalResults > 10" >
|
|
|
|
<a [queryParams]="paramsForSearchLink"
|
|
|
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps" class="uk-button uk-button-text">
|
|
|
|
View all {{fetchOrps.searchUtils.totalResults | number}} results
|
|
|
|
</a>
|
|
|
|
</div>
|
2019-09-11 11:45:54 +02:00
|
|
|
<tab-result [results]="fetchOrps.results"
|
|
|
|
[status]= "fetchOrps.searchUtils.status"
|
2018-07-26 18:38:59 +02:00
|
|
|
type="other" urlParam="orpId">
|
|
|
|
</tab-result>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class OrpsTabComponent {
|
|
|
|
@Input() paramsForSearchLink = {};
|
2019-09-11 11:45:54 +02:00
|
|
|
@Input() fetchOrps : FetchResearchResults;
|
2018-07-26 18:38:59 +02:00
|
|
|
@Input() properties:EnvProperties ;
|
|
|
|
public linkToSearchOrps = "";
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
|
|
|
|
}
|
|
|
|
}
|