Add default metric

This commit is contained in:
mauriziovitale84 2016-10-26 12:56:26 +01:00
parent d58b2f4837
commit bff9adc6eb

View File

@ -37,7 +37,7 @@ export class AnalyticsReportHeatMapComponent implements OnInit {
field: any = {}; field: any = {};
metricForm: FormGroup; metricForm: FormGroup;
currentMetric: any; currentMetric: string;
constructor(private translate: AlfrescoTranslationService, constructor(private translate: AlfrescoTranslationService,
private analyticsService: AnalyticsService, private analyticsService: AnalyticsService,
@ -50,6 +50,7 @@ export class AnalyticsReportHeatMapComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.initForm(); this.initForm();
this.field.id = 'metrics'; this.field.id = 'metrics';
this.field.value = 'totalCount';
this.analyticsService.getMetricValues().subscribe( this.analyticsService.getMetricValues().subscribe(
(opts: any[]) => { (opts: any[]) => {
@ -80,4 +81,10 @@ export class AnalyticsReportHeatMapComponent implements OnInit {
}); });
} }
hasMetric() {
return (this.report.totalCountsPercentages ||
this.report.totalTimePercentages ||
this.report.avgTimePercentages) ? true : false;
}
} }