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

41 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: 'softwareTab',
template: `
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'" tab_error_class=true></errorMessages>
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10" >
<a [queryParams]="paramsForSearchLink"
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text">
View all {{fetchSoftware.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [results]="fetchSoftware.results"
[status]= "fetchSoftware.searchUtils.status"
type="software" urlParam="softwareId">
</tab-result>
</div>
`
})
export class SoftwareTabComponent {
@Input() paramsForSearchLink = {};
@Input() fetchSoftware : FetchResearchResults;
@Input() properties:EnvProperties ;
public linkToSearchSoftware = "";
public errorCodes:ErrorCodes = new ErrorCodes();
constructor () {}
ngOnInit() {
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
}
}