2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
|
|
|
|
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
|
|
|
|
2018-02-15 11:36:12 +01:00
|
|
|
import { ErrorCodes} from '../../utils/properties/errorCodes';
|
2018-02-05 14:14:59 +01:00
|
|
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'projectsTab',
|
|
|
|
template: `
|
2018-06-08 13:21:42 +02:00
|
|
|
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'" tab_error_class=true></errorMessages>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-06-11 01:25:33 +02:00
|
|
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
|
2017-12-19 13:53:46 +01:00
|
|
|
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10">
|
|
|
|
<a [queryParams]="paramsForSearchLink"
|
|
|
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchProjects" class="uk-button uk-button-text">
|
2018-05-18 14:47:26 +02:00
|
|
|
View all {{fetchProjects.searchUtils.totalResults | number}} results
|
2017-12-19 13:53:46 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<tab-result [(results)]="fetchProjects.results"
|
|
|
|
[(status)]= "fetchProjects.status"
|
|
|
|
type="project" urlParam="projectId">
|
|
|
|
</tab-result>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ProjectsTabComponent {
|
|
|
|
|
|
|
|
@Input() paramsForSearchLink = {};
|
|
|
|
@Input() fetchProjects : FetchProjects;
|
2018-02-05 14:14:59 +01:00
|
|
|
@Input() properties:EnvProperties ;
|
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
public linkToSearchProjects = "";
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {}
|
|
|
|
}
|