42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
|
import {Component, Input} from '@angular/core';
|
||
|
import { FetchOrps } from '../../utils/fetchEntitiesClasses/fetchOrps.class';
|
||
|
|
||
|
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>
|
||
|
<tab-result [(results)]="fetchOrps.results"
|
||
|
[(status)]= "fetchOrps.searchUtils.status"
|
||
|
type="other" urlParam="orpId">
|
||
|
</tab-result>
|
||
|
</div>
|
||
|
`
|
||
|
})
|
||
|
|
||
|
export class OrpsTabComponent {
|
||
|
@Input() paramsForSearchLink = {};
|
||
|
@Input() fetchOrps : FetchOrps;
|
||
|
@Input() properties:EnvProperties ;
|
||
|
public linkToSearchOrps = "";
|
||
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
||
|
|
||
|
constructor () {}
|
||
|
|
||
|
ngOnInit() {
|
||
|
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
|
||
|
}
|
||
|
|
||
|
ngOnDestroy() {}
|
||
|
}
|