Revision 57594
Added by Konstantinos Triantafyllou over 4 years ago
indicators.component.ts | ||
---|---|---|
18 | 18 |
@Input() |
19 | 19 |
public stakeholder: Stakeholder = null; |
20 | 20 |
public indicatorUtils: IndicatorUtils = new IndicatorUtils(); |
21 |
/** |
|
22 |
* All charts and numbers |
|
23 |
*/ |
|
21 | 24 |
public charts: Indicator[] = []; |
22 | 25 |
public numbers: Indicator[] = []; |
26 |
/** |
|
27 |
* Displayed chart and numbers base on Top filters |
|
28 |
*/ |
|
23 | 29 |
public displayCharts: Indicator[] = []; |
24 | 30 |
public displayNumbers: Indicator[] = []; |
31 |
/** |
|
32 |
* Top filters |
|
33 |
*/ |
|
25 | 34 |
public chartType: string = 'all'; |
26 |
public isPublic: string = 'all';
|
|
27 |
public isActive: string = 'all';
|
|
35 |
public privacy: string = 'all';
|
|
36 |
public status: string = 'all';
|
|
28 | 37 |
public keyword: string = null; |
38 |
/** |
|
39 |
* Grid or List View |
|
40 |
*/ |
|
29 | 41 |
public grid: boolean = true; |
30 | 42 |
|
31 | 43 |
constructor(private sideBarService: SideBarService) {} |
... | ... | |
34 | 46 |
} |
35 | 47 |
|
36 | 48 |
ngOnChanges(changes: SimpleChanges): void { |
37 |
if(this.stakeholder) {
|
|
49 |
if(this.canEdit) {
|
|
38 | 50 |
this.charts = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]. |
39 | 51 |
subCategories[this.subcategoryIndex].charts; |
40 | 52 |
this.displayCharts = this.filterChartType(this.filterPrivacy( |
41 |
this.filterStatus(this.filterByKeyword(this.charts, this.keyword), this.isActive),
|
|
42 |
this.isPublic),
|
|
53 |
this.filterStatus(this.filterByKeyword(this.charts, this.keyword), this.status),
|
|
54 |
this.privacy),
|
|
43 | 55 |
this.chartType |
44 | 56 |
); |
45 | 57 |
this.numbers = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]. |
46 | 58 |
subCategories[this.subcategoryIndex].numbers; |
47 | 59 |
this.displayNumbers = this.filterPrivacy(this.filterStatus( |
48 | 60 |
this.filterByKeyword(this.numbers, this.keyword), |
49 |
this.isActive),
|
|
50 |
this.isPublic);
|
|
61 |
this.status),
|
|
62 |
this.privacy);
|
|
51 | 63 |
} |
52 | 64 |
} |
53 | 65 |
|
... | ... | |
107 | 119 |
return this.sideBarService.open; |
108 | 120 |
} |
109 | 121 |
|
122 |
get canEdit() { |
|
123 |
return this.stakeholder && |
|
124 |
this.stakeholder.topics[this.topicIndex] && |
|
125 |
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && |
|
126 |
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]; |
|
127 |
} |
|
128 |
|
|
110 | 129 |
public toggleOpen(event = null) { |
111 | 130 |
if (!event) { |
112 | 131 |
this.sideBarService.setOpen(!this.open); |
Also available in: Unified diff
[Monitor Dashboard]: Add delete functionality on elements. Add docs on components.