Analytics - Improve look and feel and user experience (#1585)

* #1583 Improve look and feel and user experience

* #1583
Add layoutType property to report list
Improve unit test
Improve docs

* #1583 Review changes
This commit is contained in:
Maurizio Vitale
2017-02-03 16:12:17 +00:00
committed by Mario Romano
parent 6431d7c04f
commit 30b4db8161
13 changed files with 318 additions and 61 deletions

View File

@@ -44,6 +44,7 @@ export class AnalyticsGeneratorComponent implements OnChanges {
reports: Chart[];
showDetails: boolean = false;
currentChartPosition: number;
public barChartOptions: any = {
responsive: true,
@@ -83,6 +84,9 @@ export class AnalyticsGeneratorComponent implements OnChanges {
this.analyticsService.getReportsByParams(reportId, reportParamQuery).subscribe(
(res: Chart[]) => {
this.reports = res;
if (this.reports) {
this.selectFirstReport();
}
this.onSuccess.emit(res);
},
(err: any) => {
@@ -116,4 +120,16 @@ export class AnalyticsGeneratorComponent implements OnChanges {
isShowDetails(): boolean {
return this.showDetails;
}
isCurrent(position: number) {
return position === this.currentChartPosition ? true : false;
}
selectCurrent(position: number) {
this.currentChartPosition = position;
}
selectFirstReport() {
this.selectCurrent(0);
}
}