1
|
import {Component, Input} from '@angular/core';
|
2
|
|
3
|
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
4
|
|
5
|
import { ErrorCodes} from '../../utils/properties/errorCodes';
|
6
|
import{EnvProperties} from '../../utils/properties/env-properties';
|
7
|
|
8
|
@Component({
|
9
|
selector: 'projectsTab',
|
10
|
template: `
|
11
|
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'" tab_error_class=true></errorMessages>
|
12
|
|
13
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
|
14
|
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10">
|
15
|
<a [queryParams]="paramsForSearchLink"
|
16
|
routerLinkActive="router-link-active" [routerLink]="linkToSearchProjects" class="uk-button uk-button-text">
|
17
|
View all {{fetchProjects.searchUtils.totalResults | number}} results
|
18
|
</a>
|
19
|
</div>
|
20
|
<tab-result [(results)]="fetchProjects.results"
|
21
|
[(status)]= "fetchProjects.status"
|
22
|
type="project" urlParam="projectId">
|
23
|
</tab-result>
|
24
|
</div>
|
25
|
`
|
26
|
})
|
27
|
|
28
|
export class ProjectsTabComponent {
|
29
|
|
30
|
@Input() paramsForSearchLink = {};
|
31
|
@Input() fetchProjects : FetchProjects;
|
32
|
@Input() properties:EnvProperties ;
|
33
|
|
34
|
public linkToSearchProjects = "";
|
35
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
36
|
|
37
|
constructor () {}
|
38
|
|
39
|
ngOnInit() {
|
40
|
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;
|
41
|
}
|
42
|
|
43
|
ngOnDestroy() {}
|
44
|
}
|