Skip to content

Commit

Permalink
adf-insights 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano committed Nov 29, 2017
1 parent 18dc071 commit 933cee2
Show file tree
Hide file tree
Showing 41 changed files with 1,075 additions and 724 deletions.
4 changes: 2 additions & 2 deletions demo-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@alfresco/adf-content-services": "2.0.0",
"@alfresco/adf-process-services": "2.0.0",
"@alfresco/adf-core": "2.0.0",
"@alfresco/adf-insights": "2.0.0",
"@alfresco/adf-insights": "2.0.1",
"chart.js": "2.5.0",
"classlist.js": "1.1.20150312",
"core-js": "2.4.1",
Expand All @@ -102,7 +102,7 @@
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"codelyzer": "4.0.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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');
});
}
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 0 additions & 6 deletions lib/insights/analytics-process/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
46 changes: 23 additions & 23 deletions lib/insights/analytics-process/services/analytics.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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[] = [];
Expand All @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion lib/insights/diagram/components/diagram.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { DiagramElementModel, DiagramModel } from '../models/diagram.model';
import { DiagramElementModel } from '../models/diagram/diagramElement.model';
import { DiagramModel } from '../models/diagram/diagram.model';
import { DiagramColorService } from '../services/diagram-color.service';
import { DiagramsService } from '../services/diagrams.service';
import { RaphaelService } from './raphael/raphael.service';
Expand Down
Loading

0 comments on commit 933cee2

Please sign in to comment.