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

42 lines
1.5 KiB
TypeScript

import {Component, Input} from '@angular/core';
import { FetchSoftware } from '../../utils/fetchEntitiesClasses/fetchSoftware.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.totalResults > 0">
<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 : FetchSoftware;
@Input() properties:EnvProperties ;
public linkToSearchSoftware = "";
public errorCodes:ErrorCodes = new ErrorCodes();
constructor () {}
ngOnInit() {
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
}
ngOnDestroy() {}
}