adf-insights 2.0.1

This commit is contained in:
Eugenio Romano
2017-11-29 18:23:49 +00:00
parent 18dc0711f9
commit a25c6a39d3
41 changed files with 1075 additions and 724 deletions

View File

@@ -21,8 +21,8 @@ import { ChartsModule } from 'ng2-charts';
import { MaterialModule } from '../../material.module';
import { DiagramsModule } from '../../diagram/diagram.module';
import { Chart } from '../../diagram';
import { ReportQuery } from '../../diagram';
import { Chart } from '../../diagram/models/chart/chart.model';
import { ReportQuery } from '../../diagram/models/report/reportQuery.model';
import * as analyticMock from '../../mock';
import { AnalyticsGeneratorComponent } from '../components/analytics-generator.component';
import { AnalyticsProcessModule } from '../analytics-process.module';

View File

@@ -16,8 +16,8 @@
*/
import { Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation } from '@angular/core';
import { ReportQuery } from '../../diagram';
import { Chart } from '../../diagram';
import { ReportQuery } from '../../diagram/models/report/reportQuery.model';
import { Chart } from '../../diagram/models/chart/chart.model';
import { AnalyticsService } from '../services/analytics.service';
@Component({

View File

@@ -20,7 +20,7 @@ import { DiagramsModule } from '../../diagram/diagram.module';
import { AnalyticsProcessModule } from '../analytics-process.module';
import { AnalyticsReportListComponent } from '../components/analytics-report-list.component';
import { MaterialModule } from '../../material.module';
import { ReportParametersModel } from '../../diagram/models/report.model';
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
declare let jasmine: any;

View File

@@ -18,7 +18,7 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { ReportParametersModel } from '../../diagram';
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
import { AnalyticsService } from '../services/analytics.service';
@Component({

View File

@@ -17,7 +17,7 @@
import { SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportParametersModel } from '../../diagram';
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
import * as analyticParamsMock from '../../mock';
import { AnalyticsReportParametersComponent } from '../components/analytics-report-parameters.component';
import { AnalyticsProcessModule } from '../analytics-process.module';

View File

@@ -32,7 +32,10 @@ import {
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material';
import moment from 'moment-es6';
import { ParameterValueModel, ReportParameterDetailsModel, ReportParametersModel, ReportQuery } from '../../diagram';
import { ParameterValueModel } from '../../diagram/models/report/parameterValue.model';
import { ReportParameterDetailsModel } from '../../diagram/models/report/reportParameterDetails.model';
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
import { ReportQuery } from '../../diagram/models/report/reportQuery.model';
import { AnalyticsService } from '../services/analytics.service';
@Component({
@@ -147,37 +150,37 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
case 'processDefinition':
formBuilderGroup.processDefGroup = new FormGroup({
processDefinitionId: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'duration':
formBuilderGroup.durationGroup = new FormGroup({
duration: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'dateInterval':
formBuilderGroup.dateIntervalGroup = new FormGroup({
dateRangeInterval: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'boolean':
formBuilderGroup.typeFilteringGroup = new FormGroup({
typeFiltering: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'task':
formBuilderGroup.taskGroup = new FormGroup({
taskName: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'integer':
formBuilderGroup.processInstanceGroup = new FormGroup({
slowProcessInstanceInteger: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
case 'status':
formBuilderGroup.statusGroup = new FormGroup({
status: new FormControl(null, Validators.required, null)
}, Validators.required);
}, Validators.required);
break;
default:
return;
@@ -245,7 +248,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
public convertMomentDate(date: string) {
return moment(date, AnalyticsReportParametersComponent.FORMAT_DATE_ACTIVITI, true)
.format(AnalyticsReportParametersComponent.FORMAT_DATE_ACTIVITI) + 'T00:00:00.000Z';
.format(AnalyticsReportParametersComponent.FORMAT_DATE_ACTIVITI) + 'T00:00:00.000Z';
}
public getTodayDate() {
@@ -351,7 +354,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
doExport(paramQuery: ReportQuery) {
this.analyticsService.exportReportToCsv(this.reportId, paramQuery).subscribe(
(data: any) => {
let blob: Blob = new Blob([data], {type: 'text/csv'});
let blob: Blob = new Blob([data], { type: 'text/csv' });
this.contentService.downloadBlob(blob, paramQuery.reportName + '.csv');
});
}
@@ -365,7 +368,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
deleteReport(reportId: string) {
this.analyticsService.deleteReport(reportId).subscribe(() => {
this.deleteReportSuccess.emit(reportId);
}, error => this.logService.error(error));
}, error => this.logService.error(error));
}
ngAfterContentChecked() {

View File

@@ -16,7 +16,7 @@
*/
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
import { ReportQuery } from '../../diagram';
import { ReportQuery } from '../../diagram/models/report/reportQuery.model';
import { AnalyticsGeneratorComponent } from './analytics-generator.component';
@Component({

View File

@@ -20,8 +20,8 @@
/* tslint:disable::no-access-missing-member */
import { Component, ElementRef, Input, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ParameterValueModel } from '../../../../diagram/models/report.model';
import { ReportParameterDetailsModel } from '../../../../diagram/models/report.model';
import { ParameterValueModel } from '../../../../diagram/models/report/parameterValue.model';
import { ReportParameterDetailsModel } from '../../../../diagram/models/report/reportParameterDetails.model';
import { NumberWidgetAanlyticsComponent } from './../number/number.widget';
@Component({

View File

@@ -20,10 +20,4 @@ export * from './components/analytics-generator.component';
export * from './components/analytics-report-list.component';
export * from './components/analytics-report-parameters.component';
export * from './components/widgets/checkbox/checkbox.widget';
export * from './components/widgets/date-range/date-range.widget';
export * from './components/widgets/dropdown/dropdown.widget';
export * from './components/widgets/duration/duration.widget';
export * from './components/widgets/number/number.widget';
export * from './services/analytics.service';

View File

@@ -19,16 +19,16 @@ import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { ParameterValueModel, ReportParametersModel } from '../../diagram';
import {
BarChart,
Chart,
DetailsTableChart,
HeatMapChart,
MultiBarChart,
PieChart,
TableChart
} from '../../diagram';
import { ParameterValueModel } from '../../diagram/models/report/parameterValue.model';
import { ReportParametersModel } from '../../diagram/models/report/reportParameters.model';
import { BarChart } from '../../diagram/models/chart/barChart.model';
import { Chart } from '../../diagram/models/chart/chart.model';
import { DetailsTableChart } from '../../diagram/models/chart/detailsTableChart.model';
import { HeatMapChart } from '../../diagram/models/chart/heatMapChart.model';
import { MultiBarChart } from '../../diagram/models/chart/multiBarChart.model';
import { PieChart } from '../../diagram/models/chart/pieChart.model';
import { TableChart } from '../../diagram/models/chart/tableChart.model';
import 'rxjs/add/observable/throw';
@Injectable()
@@ -107,9 +107,9 @@ export class AnalyticsService {
getProcessStatusValues(): Observable<any> {
let paramOptions: ParameterValueModel[] = [];
paramOptions.push(new ParameterValueModel({id: 'All', name: 'All'}));
paramOptions.push(new ParameterValueModel({id: 'Active', name: 'Active'}));
paramOptions.push(new ParameterValueModel({id: 'Complete', name: 'Complete'}));
paramOptions.push(new ParameterValueModel({ id: 'All', name: 'All' }));
paramOptions.push(new ParameterValueModel({ id: 'Active', name: 'Active' }));
paramOptions.push(new ParameterValueModel({ id: 'Complete', name: 'Complete' }));
return Observable.create(observer => {
observer.next(paramOptions);
@@ -120,11 +120,11 @@ export class AnalyticsService {
getDateIntervalValues(): Observable<any> {
let paramOptions: ParameterValueModel[] = [];
paramOptions.push(new ParameterValueModel({id: 'byHour', name: 'By hour'}));
paramOptions.push(new ParameterValueModel({id: 'byDay', name: 'By day'}));
paramOptions.push(new ParameterValueModel({id: 'byWeek', name: 'By week'}));
paramOptions.push(new ParameterValueModel({id: 'byMonth', name: 'By month'}));
paramOptions.push(new ParameterValueModel({id: 'byYear', name: 'By year'}));
paramOptions.push(new ParameterValueModel({ id: 'byHour', name: 'By hour' }));
paramOptions.push(new ParameterValueModel({ id: 'byDay', name: 'By day' }));
paramOptions.push(new ParameterValueModel({ id: 'byWeek', name: 'By week' }));
paramOptions.push(new ParameterValueModel({ id: 'byMonth', name: 'By month' }));
paramOptions.push(new ParameterValueModel({ id: 'byYear', name: 'By year' }));
return Observable.create(observer => {
observer.next(paramOptions);
@@ -135,9 +135,9 @@ export class AnalyticsService {
getMetricValues(): Observable<any> {
let paramOptions: ParameterValueModel[] = [];
paramOptions.push(new ParameterValueModel({id: 'totalCount', name: 'Number of times a step is executed'}));
paramOptions.push(new ParameterValueModel({id: 'totalTime', name: 'Total time spent in a process step'}));
paramOptions.push(new ParameterValueModel({id: 'avgTime', name: 'Average time spent in a process step'}));
paramOptions.push(new ParameterValueModel({ id: 'totalCount', name: 'Number of times a step is executed' }));
paramOptions.push(new ParameterValueModel({ id: 'totalTime', name: 'Total time spent in a process step' }));
paramOptions.push(new ParameterValueModel({ id: 'avgTime', name: 'Average time spent in a process step' }));
return Observable.create(observer => {
observer.next(paramOptions);
@@ -157,7 +157,7 @@ export class AnalyticsService {
}
getProcessDefinitionsValues(appId: number): Observable<any> {
let options = {'appDefinitionId': appId};
let options = { 'appDefinitionId': appId };
return Observable.fromPromise(this.apiService.getInstance().activiti.processDefinitionsApi.getProcessDefinitions(options))
.map((res: any) => {
let paramOptions: ParameterValueModel[] = [];
@@ -173,7 +173,7 @@ export class AnalyticsService {
.map((res: any) => {
let paramOptions: ParameterValueModel[] = [];
res.forEach((opt) => {
paramOptions.push(new ParameterValueModel({id: opt, name: opt}));
paramOptions.push(new ParameterValueModel({ id: opt, name: opt }));
});
return paramOptions;
}).catch(err => this.handleError(err));