openaire-library/landingPages/dataProvider/orpsTab.component.ts

40 lines
1.5 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: '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 : FetchResearchResults;
@Input() properties:EnvProperties ;
public linkToSearchOrps = "";
public errorCodes:ErrorCodes = new ErrorCodes();
constructor () {}
ngOnInit() {
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
}
}