2018-05-08 14:59:30 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
2019-09-11 11:45:54 +02:00
|
|
|
import { FetchResearchResults } from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
2018-05-08 14:59:30 +02:00
|
|
|
|
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
|
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'softwareTab',
|
|
|
|
template: `
|
2018-06-08 13:21:42 +02:00
|
|
|
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'" tab_error_class=true></errorMessages>
|
2018-05-08 14:59:30 +02:00
|
|
|
|
2018-06-11 01:25:33 +02:00
|
|
|
<div *ngIf="fetchSoftware.searchUtils.status == errorCodes.DONE">
|
2018-05-08 14:59:30 +02:00
|
|
|
<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">
|
2018-05-18 14:47:26 +02:00
|
|
|
View all {{fetchSoftware.searchUtils.totalResults | number}} results
|
2018-05-08 14:59:30 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
2019-09-11 11:45:54 +02:00
|
|
|
<tab-result [results]="fetchSoftware.results"
|
|
|
|
[status]= "fetchSoftware.searchUtils.status"
|
|
|
|
type="software" urlParam="softwareId">
|
2018-05-08 14:59:30 +02:00
|
|
|
</tab-result>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class SoftwareTabComponent {
|
|
|
|
@Input() paramsForSearchLink = {};
|
2019-09-11 11:45:54 +02:00
|
|
|
@Input() fetchSoftware : FetchResearchResults;
|
2018-05-08 14:59:30 +02:00
|
|
|
@Input() properties:EnvProperties ;
|
|
|
|
public linkToSearchSoftware = "";
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|