1
|
import {Component, Input} from '@angular/core';
|
2
|
import { FetchResearchResults } from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
3
|
|
4
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
5
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
6
|
|
7
|
@Component({
|
8
|
selector: 'orpsTab',
|
9
|
template: `
|
10
|
<errorMessages [status]="[fetchOrps.searchUtils.status]" [type]="'other research products'" tab_error_class=true></errorMessages>
|
11
|
|
12
|
<div *ngIf="fetchOrps.searchUtils.status == errorCodes.DONE">
|
13
|
<div class = "uk-text-right" *ngIf = "fetchOrps.searchUtils.totalResults > 10" >
|
14
|
<a [queryParams]="paramsForSearchLink"
|
15
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps" class="uk-button uk-button-text">
|
16
|
View all {{fetchOrps.searchUtils.totalResults | number}} results
|
17
|
</a>
|
18
|
</div>
|
19
|
<tab-result [results]="fetchOrps.results"
|
20
|
[status]= "fetchOrps.searchUtils.status"
|
21
|
type="other" urlParam="orpId">
|
22
|
</tab-result>
|
23
|
</div>
|
24
|
`
|
25
|
})
|
26
|
|
27
|
export class OrpsTabComponent {
|
28
|
@Input() paramsForSearchLink = {};
|
29
|
@Input() fetchOrps : FetchResearchResults;
|
30
|
@Input() properties:EnvProperties ;
|
31
|
public linkToSearchOrps = "";
|
32
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
33
|
|
34
|
constructor () {}
|
35
|
|
36
|
ngOnInit() {
|
37
|
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
|
38
|
}
|
39
|
|
40
|
ngOnDestroy() {}
|
41
|
}
|