2018-05-08 14:59:30 +02:00
|
|
|
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: `
|
2018-05-11 13:33:50 +02:00
|
|
|
<!--div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img class="loading-gif uk-align-center" ></div>
|
2018-05-08 14:59:30 +02:00
|
|
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
|
|
|
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
|
|
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
|
|
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">No research data found</div-->
|
|
|
|
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'"></errorMessages>
|
|
|
|
|
|
|
|
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
|
|
|
No research data available
|
|
|
|
</div-->
|
|
|
|
|
|
|
|
<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">
|
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>
|
|
|
|
<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() {}
|
|
|
|
}
|