Revision 54209
Added by Argiro Kokogiannaki over 5 years ago
statistics.component.ts | ||
---|---|---|
25 | 25 |
} from "../openaireLibrary/connect/statistics/statisticsEntities"; |
26 | 26 |
import {PiwikHelper} from '../utils/piwikHelper'; |
27 | 27 |
|
28 |
|
|
28 | 29 |
@Component({ |
29 | 30 |
selector: 'statistics', |
30 | 31 |
templateUrl: 'statistics.component.html', |
... | ... | |
47 | 48 |
allowedCharts: Map<string,string[]> = new Map<string,string[]>(); |
48 | 49 |
allowedEntities: string[] = []; |
49 | 50 |
|
50 |
statisticsSum: StatisticsSummary; |
|
51 |
statisticsDisplay: StatisticsDisplay; |
|
51 |
statisticsSum: StatisticsSummary =null;
|
|
52 |
statisticsDisplay: StatisticsDisplay = null;
|
|
52 | 53 |
chartsUrlMap: {}; |
53 | 54 |
|
54 | 55 |
displayedTimeline: string; |
... | ... | |
58 | 59 |
displayedProjectChart: string; |
59 | 60 |
displayedProjectChartUrl: string; |
60 | 61 |
displayedEntity: string; |
61 |
|
|
62 |
public errorCodes:ErrorCodes = new ErrorCodes(); |
|
63 |
status = null; |
|
62 | 64 |
constructor ( |
63 | 65 |
private route: ActivatedRoute, |
64 | 66 |
private _router: Router, |
... | ... | |
122 | 124 |
|
123 | 125 |
createStatisticsObjects() { |
124 | 126 |
// console.log(" Stats! "+ this.properties.statisticsAPIURL); |
127 |
this.status = this.errorCodes.LOADING; |
|
125 | 128 |
this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe ( |
126 | 129 |
res => { |
127 | 130 |
console.log('statisticsSum is:'); |
... | ... | |
130 | 133 |
this.statisticsSum["orp"]=res["other"]; |
131 | 134 |
} |
132 | 135 |
console.log(this.statisticsSum); |
136 |
this.getDisplayOptions(); |
|
133 | 137 |
}, |
134 | 138 |
error => { |
135 | 139 |
console.log(error); |
136 |
}, |
|
137 |
() => { |
|
138 |
this.getDisplayOptions(); |
|
140 |
this.status = this.errorCodes.ERROR; |
|
139 | 141 |
}); |
140 | 142 |
} |
141 | 143 |
|
... | ... | |
144 | 146 |
.subscribe( |
145 | 147 |
res => { |
146 | 148 |
this.statisticsDisplay = res; |
149 |
this.createChartUrlMap(); |
|
150 |
this.getCommunityInfo(); |
|
151 |
this.status = this.errorCodes.DONE; |
|
152 |
|
|
147 | 153 |
}, |
148 | 154 |
error => { |
149 | 155 |
console.log(error); |
150 |
}, |
|
151 |
() => { |
|
152 |
this.createChartUrlMap(); |
|
153 |
this.getCommunityInfo(); |
|
156 |
this.status = this.errorCodes.ERROR; |
|
154 | 157 |
} |
155 | 158 |
); |
156 | 159 |
} |
Also available in: Unified diff
Navbar:
pass properly boolean variables
add all related subitems route in rootmenuitem (for enabling/disabling routes)
Footer:
pass properly boolean variables
Content: update text
Organization/about/stats pages: add route enabled guard
Search/find: use input for placeholder text
Stats: add loading
Manage button: add svg instead of uikit