mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ACS-8771] bug fixes in insights, reduce jasmine.ajax (#10214)
* bug fixes in insights, reduce jasmine.ajax * bug fixes in insights, reduce jasmine.ajax
This commit is contained in:
parent
3a8ad1a596
commit
b58f1c9daa
@ -16,36 +16,36 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { Chart } from '../../diagram/models/chart/chart.model';
|
import { Chart } from '../../diagram/models/chart/chart.model';
|
||||||
import { ReportQuery } from '../../diagram/models/report/report-query.model';
|
import { ReportQuery } from '../../diagram/models/report/report-query.model';
|
||||||
import * as analyticMock from '../../mock';
|
import * as analyticMock from '../../mock';
|
||||||
import { AnalyticsGeneratorComponent } from '../components/analytics-generator.component';
|
import { AnalyticsGeneratorComponent } from '../components/analytics-generator.component';
|
||||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||||
|
import { AnalyticsService } from '@alfresco/adf-insights';
|
||||||
declare let jasmine: any;
|
|
||||||
|
|
||||||
describe('AnalyticsGeneratorComponent', () => {
|
describe('AnalyticsGeneratorComponent', () => {
|
||||||
let component: any;
|
let component: AnalyticsGeneratorComponent;
|
||||||
let fixture: ComponentFixture<AnalyticsGeneratorComponent>;
|
let fixture: ComponentFixture<AnalyticsGeneratorComponent>;
|
||||||
|
let analyticsService: AnalyticsService;
|
||||||
|
let getReportsByParamsSpy: jasmine.Spy;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [InsightsTestingModule]
|
imports: [InsightsTestingModule]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
analyticsService = TestBed.inject(AnalyticsService);
|
||||||
|
getReportsByParamsSpy = spyOn(analyticsService.reportApi, 'getReportsByParams').and.stub();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(AnalyticsGeneratorComponent);
|
fixture = TestBed.createComponent(AnalyticsGeneratorComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
jasmine.Ajax.install();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jasmine.Ajax.uninstall();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should render the Process definition overview report ', (done) => {
|
it('Should render the Process definition overview report ', (done) => {
|
||||||
|
getReportsByParamsSpy.and.returnValue(Promise.resolve(analyticMock.chartProcessDefOverview));
|
||||||
|
|
||||||
component.success.subscribe((res) => {
|
component.success.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
expect(res.length).toEqual(3);
|
expect(res.length).toEqual(3);
|
||||||
@ -80,22 +80,14 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
component.reportId = 1001;
|
component.reportId = '1001';
|
||||||
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: analyticMock.chartProcessDefOverview
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should render the Process definition overview report when [onChanges] is called ', (done) => {
|
it('Should render the Process definition overview report when [onChanges] is called ', (done) => {
|
||||||
|
getReportsByParamsSpy.and.returnValue(Promise.resolve(analyticMock.chartProcessDefOverview));
|
||||||
|
|
||||||
component.success.subscribe((res) => {
|
component.success.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
expect(res.length).toEqual(3);
|
expect(res.length).toEqual(3);
|
||||||
@ -130,22 +122,14 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
component.reportId = 1001;
|
component.reportId = '1001';
|
||||||
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: analyticMock.chartProcessDefOverview
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should render the Task overview report ', (done) => {
|
it('Should render the Task overview report ', (done) => {
|
||||||
|
getReportsByParamsSpy.and.returnValue(Promise.resolve(analyticMock.chartTaskOverview));
|
||||||
|
|
||||||
component.success.subscribe((res) => {
|
component.success.subscribe((res) => {
|
||||||
expect(res).toBeDefined();
|
expect(res).toBeDefined();
|
||||||
expect(res.length).toEqual(3);
|
expect(res.length).toEqual(3);
|
||||||
@ -183,9 +167,9 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
expect(res[2].type).toEqual('multiBar');
|
expect(res[2].type).toEqual('multiBar');
|
||||||
expect(res[2].labels).toBeDefined();
|
expect(res[2].labels).toBeDefined();
|
||||||
expect(res[2].labels.length).toEqual(3);
|
expect(res[2].labels.length).toEqual(3);
|
||||||
expect(res[2].labels[0]).toEqual(1);
|
expect(res[2].labels[0]).toEqual('1');
|
||||||
expect(res[2].labels[1]).toEqual(2);
|
expect(res[2].labels[1]).toEqual('2');
|
||||||
expect(res[2].labels[2]).toEqual(3);
|
expect(res[2].labels[2]).toEqual('3');
|
||||||
expect(res[2].datasets[0].label).toEqual('averages');
|
expect(res[2].datasets[0].label).toEqual('averages');
|
||||||
expect(res[2].datasets[0].data[0]).toEqual(0);
|
expect(res[2].datasets[0].data[0]).toEqual(0);
|
||||||
expect(res[2].datasets[0].data[1]).toEqual(5);
|
expect(res[2].datasets[0].data[1]).toEqual(5);
|
||||||
@ -202,24 +186,14 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
component.reportId = 1;
|
component.reportId = '1';
|
||||||
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: analyticMock.chartTaskOverview
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should reset the reports when the onChanged is call', async () => {
|
it('Should reset the reports when the onChanged is call', async () => {
|
||||||
component.reports = [new Chart({ id: 'fake', type: 'fake-type' })];
|
component.reports = [new Chart({ id: 'fake', type: 'fake-type' })];
|
||||||
component.reportId = 1;
|
component.reportId = '1';
|
||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -229,23 +203,15 @@ describe('AnalyticsGeneratorComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Should emit onError event with a 404 response ', (done) => {
|
it('Should emit onError event with a 404 response ', (done) => {
|
||||||
|
getReportsByParamsSpy.and.returnValue(Promise.reject(new Error('404')));
|
||||||
|
|
||||||
component.error.subscribe((err) => {
|
component.error.subscribe((err) => {
|
||||||
expect(err).toBeDefined();
|
expect(err).toBeDefined();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
component.reportId = 1;
|
component.reportId = '1';
|
||||||
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
component.reportParamQuery = new ReportQuery({ status: 'All' });
|
||||||
component.ngOnChanges();
|
component.ngOnChanges();
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
||||||
status: 404,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: []
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -101,18 +101,18 @@ export class AnalyticsGeneratorComponent implements OnChanges {
|
|||||||
if (reportParamQuery === undefined || reportParamQuery === null) {
|
if (reportParamQuery === undefined || reportParamQuery === null) {
|
||||||
reportParamQuery = new ReportQuery();
|
reportParamQuery = new ReportQuery();
|
||||||
}
|
}
|
||||||
this.analyticsService.getReportsByParams(reportId, reportParamQuery).subscribe(
|
this.analyticsService.getReportsByParams(reportId, reportParamQuery).subscribe({
|
||||||
(res) => {
|
next: (res) => {
|
||||||
this.reports = res;
|
this.reports = res;
|
||||||
if (this.reports) {
|
if (this.reports) {
|
||||||
this.selectFirstReport();
|
this.selectFirstReport();
|
||||||
}
|
}
|
||||||
this.success.emit(res);
|
this.success.emit(res);
|
||||||
},
|
},
|
||||||
(err: any) => {
|
error: (err: any) => {
|
||||||
this.error.emit(err);
|
this.error.emit(err);
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public reset() {
|
public reset() {
|
||||||
|
@ -19,8 +19,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { AnalyticsReportHeatMapComponent } from '../components/analytics-report-heat-map.component';
|
import { AnalyticsReportHeatMapComponent } from '../components/analytics-report-heat-map.component';
|
||||||
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
import { InsightsTestingModule } from '../../testing/insights.testing.module';
|
||||||
|
|
||||||
declare let jasmine: any;
|
|
||||||
|
|
||||||
describe('AnalyticsReportHeatMapComponent', () => {
|
describe('AnalyticsReportHeatMapComponent', () => {
|
||||||
let component: AnalyticsReportHeatMapComponent;
|
let component: AnalyticsReportHeatMapComponent;
|
||||||
let fixture: ComponentFixture<AnalyticsReportHeatMapComponent>;
|
let fixture: ComponentFixture<AnalyticsReportHeatMapComponent>;
|
||||||
@ -53,14 +51,6 @@ describe('AnalyticsReportHeatMapComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Rendering tests: Heat Map', () => {
|
describe('Rendering tests: Heat Map', () => {
|
||||||
beforeEach(() => {
|
|
||||||
jasmine.Ajax.install();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jasmine.Ajax.uninstall();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should render the dropdown with the metric options', async () => {
|
it('should render the dropdown with the metric options', async () => {
|
||||||
component.report = { totalCountsPercentages: { 'sid-fake-id': 10, 'fake-start-event': 30 } };
|
component.report = { totalCountsPercentages: { 'sid-fake-id': 10, 'fake-start-event': 30 } };
|
||||||
|
|
||||||
|
@ -64,42 +64,6 @@ describe('AnalyticsReportListComponent', () => {
|
|||||||
expect(component.isReportsEmpty()).toBeTruthy();
|
expect(component.isReportsEmpty()).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: very flaky test, to be refactored
|
|
||||||
// eslint-disable-next-line ban/ban
|
|
||||||
xit('should return the default reports when the report list is empty', (done) => {
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: []
|
|
||||||
});
|
|
||||||
|
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/default-reports').andReturn({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: []
|
|
||||||
});
|
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
|
||||||
status: 200,
|
|
||||||
contentType: 'json',
|
|
||||||
responseText: reportList
|
|
||||||
});
|
|
||||||
|
|
||||||
component.success.subscribe(() => {
|
|
||||||
fixture.detectChanges();
|
|
||||||
expect(element.querySelector('#report-list-0 .adf-activiti-filters__entry-icon').innerHTML).toBe('assignment');
|
|
||||||
expect(element.querySelector('#report-list-0 > span').innerHTML).toBe('Fake Test Process definition heat map');
|
|
||||||
expect(element.querySelector('#report-list-1 > span').innerHTML).toBe('Fake Test Process definition overview');
|
|
||||||
expect(element.querySelector('#report-list-2 > span').innerHTML).toBe('Fake Test Process instances overview');
|
|
||||||
expect(element.querySelector('#report-list-3 > span').innerHTML).toBe('Fake Test Task overview');
|
|
||||||
expect(element.querySelector('#report-list-4 > span').innerHTML).toBe('Fake Test Task service level agreement');
|
|
||||||
expect(component.isReportsEmpty()).toBeFalsy();
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Report render the report list relative to a single app', (done) => {
|
it('Report render the report list relative to a single app', (done) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ export class BarChart extends Chart {
|
|||||||
params.values.forEach((info: any) => {
|
params.values.forEach((info: any) => {
|
||||||
info.forEach((value: any, index: any) => {
|
info.forEach((value: any, index: any) => {
|
||||||
if (index % 2 === 0) {
|
if (index % 2 === 0) {
|
||||||
if (!this.labels.includes(value)) {
|
if (!this.labels.includes(value.toString())) {
|
||||||
this.labels.push(value);
|
this.labels.push(value.toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dataValue.push(value);
|
dataValue.push(value);
|
||||||
|
@ -23,7 +23,7 @@ export class PieChart extends Chart {
|
|||||||
|
|
||||||
if (obj.values) {
|
if (obj.values) {
|
||||||
obj.values.forEach((value: any) => {
|
obj.values.forEach((value: any) => {
|
||||||
this.add(value.key, value.y);
|
this.add(value.key.toString(), value.y.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,100 +16,136 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const chartProcessDefOverview = {
|
export const chartProcessDefOverview = {
|
||||||
elements: [{
|
elements: [
|
||||||
id: 'id1585876275153',
|
{
|
||||||
type: 'table',
|
id: 'id1585876275153',
|
||||||
rows: [
|
type: 'table',
|
||||||
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS', '9'],
|
rows: [
|
||||||
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES', '41'],
|
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS', '9'],
|
||||||
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES', '3'],
|
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES', '41'],
|
||||||
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES', '38']
|
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES', '3'],
|
||||||
]
|
['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES', '38']
|
||||||
}, {
|
]
|
||||||
id: 'id1585876413072',
|
},
|
||||||
type: 'pieChart',
|
{
|
||||||
title: 'Total process instances overview',
|
id: 'id1585876413072',
|
||||||
titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE',
|
type: 'pieChart',
|
||||||
values: [{
|
title: 'Total process instances overview',
|
||||||
key: 'Second Process',
|
titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE',
|
||||||
y: 4,
|
values: [
|
||||||
keyAndValue: ['Second Process', '4']
|
{
|
||||||
}, {
|
key: 'Second Process',
|
||||||
key: 'Simple process',
|
y: 4,
|
||||||
y: 30,
|
keyAndValue: ['Second Process', '4']
|
||||||
keyAndValue: ['Simple process', '30']
|
},
|
||||||
}, {
|
{
|
||||||
key: 'Third Process',
|
key: 'Simple process',
|
||||||
y: 7,
|
y: 30,
|
||||||
keyAndValue: ['Third Process', '7']
|
keyAndValue: ['Simple process', '30']
|
||||||
}]
|
},
|
||||||
}, {
|
{
|
||||||
id: 'id1585877659181',
|
key: 'Third Process',
|
||||||
type: 'table',
|
y: 7,
|
||||||
title: 'Process definition details',
|
keyAndValue: ['Third Process', '7']
|
||||||
titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE',
|
}
|
||||||
columnNames: ['Process definition', 'Total', 'Active', 'Completed'],
|
]
|
||||||
columnNameKeys: ['REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-PROCESS',
|
},
|
||||||
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-TOTAL',
|
{
|
||||||
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-ACTIVE',
|
id: 'id1585877659181',
|
||||||
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-COMPLETED'],
|
type: 'table',
|
||||||
columnsCentered: [false, false, false, false],
|
title: 'Process definition details',
|
||||||
rows: [
|
titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE',
|
||||||
['Second Process', '4', '0', '4'],
|
columnNames: ['Process definition', 'Total', 'Active', 'Completed'],
|
||||||
['Simple process', '30', '3', '27'],
|
columnNameKeys: [
|
||||||
['Third Process', '7', '0', '7']
|
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-PROCESS',
|
||||||
]
|
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-TOTAL',
|
||||||
}]
|
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-ACTIVE',
|
||||||
|
'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-COMPLETED'
|
||||||
|
],
|
||||||
|
columnsCentered: [false, false, false, false],
|
||||||
|
rows: [
|
||||||
|
['Second Process', '4', '0', '4'],
|
||||||
|
['Simple process', '30', '3', '27'],
|
||||||
|
['Third Process', '7', '0', '7']
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
export const chartTaskOverview = {
|
export const chartTaskOverview = {
|
||||||
elements: [{
|
elements: [
|
||||||
id: 'id792351752194',
|
{
|
||||||
type: 'barChart',
|
id: 'id792351752194',
|
||||||
title: 'title',
|
type: 'barChart',
|
||||||
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-HISTOGRAM-TITLE',
|
title: 'title',
|
||||||
values: [{
|
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-HISTOGRAM-TITLE',
|
||||||
key: 'series1',
|
values: [
|
||||||
values: [['2016-09-30T00:00:00.000+0000', 3], ['2016-10-04T00:00:00.000+0000', 1]]
|
{
|
||||||
}],
|
key: 'series1',
|
||||||
xAxisType: 'date_month',
|
values: [
|
||||||
yAxisType: 'count'
|
['2016-09-30T00:00:00.000+0000', 3],
|
||||||
}, {
|
['2016-10-04T00:00:00.000+0000', 1]
|
||||||
id: 'id792349721129',
|
]
|
||||||
type: 'masterDetailTable',
|
}
|
||||||
title: 'Detailed task statistics',
|
],
|
||||||
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TITLE',
|
xAxisType: 'date_month',
|
||||||
/* cspell:disable-next-line */
|
yAxisType: 'count'
|
||||||
columnNames: ['Task', 'Count', 'Sum', 'Min duration', 'Max duration', 'Average duration', 'Stddev duration'],
|
},
|
||||||
columnNameKeys: [
|
{
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TASK',
|
id: 'id792349721129',
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.COUNT',
|
type: 'masterDetailTable',
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.SUM',
|
title: 'Detailed task statistics',
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MIN-DURATION',
|
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TITLE',
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MAX-DURATION',
|
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.AVERAGE',
|
|
||||||
/* cspell:disable-next-line */
|
/* cspell:disable-next-line */
|
||||||
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.STDDE'],
|
columnNames: ['Task', 'Count', 'Sum', 'Min duration', 'Max duration', 'Average duration', 'Stddev duration'],
|
||||||
columnsCentered: [false, false, false, false],
|
columnNameKeys: [
|
||||||
rows: [
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TASK',
|
||||||
['fake 1 user task', '1', '2.0', '3.0', '4.0', '5.0', '6.0'],
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.COUNT',
|
||||||
['fake 2 user task', '1', '2.0', '3.0', '4.0', '5.0', '6.0']
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.SUM',
|
||||||
]
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MIN-DURATION',
|
||||||
}, {
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MAX-DURATION',
|
||||||
id: 'id10931125229538',
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.AVERAGE',
|
||||||
type: 'multiBarChart',
|
/* cspell:disable-next-line */
|
||||||
title: 'Task duration',
|
'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.STDDE'
|
||||||
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-DURATIONS-TITLE',
|
],
|
||||||
values: [{
|
columnsCentered: [false, false, false, false],
|
||||||
key: 'averages',
|
rows: [
|
||||||
values: [[1, 0], [2, 5], [3, 2]]
|
['fake 1 user task', '1', '2.0', '3.0', '4.0', '5.0', '6.0'],
|
||||||
}, {
|
['fake 2 user task', '1', '2.0', '3.0', '4.0', '5.0', '6.0']
|
||||||
key: 'minima',
|
]
|
||||||
values: [[1, 0], [2, 0], [3, 0]]
|
},
|
||||||
}, {
|
{
|
||||||
key: 'maxima',
|
id: 'id10931125229538',
|
||||||
values: [[1, 0], [2, 29], [3, 29]]
|
type: 'multiBarChart',
|
||||||
}],
|
title: 'Task duration',
|
||||||
yAxisType: 'count'
|
titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-DURATIONS-TITLE',
|
||||||
}]
|
values: [
|
||||||
|
{
|
||||||
|
key: 'averages',
|
||||||
|
values: [
|
||||||
|
[1, 0],
|
||||||
|
[2, 5],
|
||||||
|
[3, 2]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'minima',
|
||||||
|
values: [
|
||||||
|
[1, 0],
|
||||||
|
[2, 0],
|
||||||
|
[3, 0]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'maxima',
|
||||||
|
values: [
|
||||||
|
[1, 0],
|
||||||
|
[2, 29],
|
||||||
|
[3, 29]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxisType: 'count'
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
@ -28,24 +28,21 @@ export const reportDefParamNumber = {
|
|||||||
id: 2005,
|
id: 2005,
|
||||||
name: 'Fake Process instances overview',
|
name: 'Fake Process instances overview',
|
||||||
created: '2016-10-05T15:39:40.222+0000',
|
created: '2016-10-05T15:39:40.222+0000',
|
||||||
definition: '{ "parameters"' +
|
definition: '{ "parameters"' + ' :[{"id":"slowProcessInstanceInteger","name":null,"nameKey":null,"type":"integer","value":10,"dependsOn":null}]}'
|
||||||
' :[{"id":"slowProcessInstanceInteger","name":null,"nameKey":null,"type":"integer","value":10,"dependsOn":null}]}'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reportDefParamDuration = {
|
export const reportDefParamDuration = {
|
||||||
id: 2005,
|
id: 2005,
|
||||||
name: 'Fake Task service level agreement',
|
name: 'Fake Task service level agreement',
|
||||||
created: '2016-10-05T15:39:40.222+0000',
|
created: '2016-10-05T15:39:40.222+0000',
|
||||||
definition: '{ "parameters"' +
|
definition: '{ "parameters"' + ' :[{"id":"duration","name":null,"nameKey":null,"type":"duration","value":null,"dependsOn":null}]}'
|
||||||
' :[{"id":"duration","name":null,"nameKey":null,"type":"duration","value":null,"dependsOn":null}]}'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reportDefParamCheck = {
|
export const reportDefParamCheck = {
|
||||||
id: 2005,
|
id: 2005,
|
||||||
name: 'Fake Task service level agreement',
|
name: 'Fake Task service level agreement',
|
||||||
created: '2016-10-05T15:39:40.222+0000',
|
created: '2016-10-05T15:39:40.222+0000',
|
||||||
definition: '{ "parameters"' +
|
definition: '{ "parameters"' + ' :[{"id":"typeFiltering","name":null,"nameKey":null,"type":"boolean","value":true,"dependsOn":null}]}'
|
||||||
' :[{"id":"typeFiltering","name":null,"nameKey":null,"type":"boolean","value":true,"dependsOn":null}]}'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reportDefParamDateRange = {
|
export const reportDefParamDateRange = {
|
||||||
@ -93,7 +90,10 @@ export const reportDefParamProcessDefOptionsNoApp = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const reportDefParamProcessDefOptions = {
|
export const reportDefParamProcessDefOptions = {
|
||||||
size: 4, total: 4, start: 0, data: [
|
size: 4,
|
||||||
|
total: 4,
|
||||||
|
start: 0,
|
||||||
|
data: [
|
||||||
{
|
{
|
||||||
id: 'FakeProcessTest 1:1:1',
|
id: 'FakeProcessTest 1:1:1',
|
||||||
name: 'Fake Process Test 1 Name ',
|
name: 'Fake Process Test 1 Name ',
|
||||||
@ -118,7 +118,10 @@ export const reportDefParamProcessDefOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const reportDefParamProcessDefOptionsApp = {
|
export const reportDefParamProcessDefOptionsApp = {
|
||||||
size: 2, total: 2, start: 2, data: [
|
size: 2,
|
||||||
|
total: 2,
|
||||||
|
start: 2,
|
||||||
|
data: [
|
||||||
{
|
{
|
||||||
id: 'FakeProcessTest 1:1:1',
|
id: 'FakeProcessTest 1:1:1',
|
||||||
name: 'Fake Process Test 1 Name ',
|
name: 'Fake Process Test 1 Name ',
|
||||||
@ -148,10 +151,8 @@ export const reportNoParameterDefinitions = {
|
|||||||
|
|
||||||
export const reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2'];
|
export const reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2'];
|
||||||
|
|
||||||
export const fieldProcessDef = new ReportParameterDetailsModel(
|
export const fieldProcessDef = new ReportParameterDetailsModel({
|
||||||
{
|
id: 'processDefinitionId',
|
||||||
id: 'processDefinitionId',
|
type: 'processDefinition',
|
||||||
type: 'processDefinition',
|
value: 'fake-process-name:1:15027'
|
||||||
value: 'fake-process-name:1:15027'
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
@ -19,9 +19,10 @@ import { NgModule } from '@angular/core';
|
|||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { AppConfigService, AppConfigServiceMock, AuthModule, JWT_STORAGE_SERVICE, NoopTranslateModule, StorageService } from '@alfresco/adf-core';
|
import { AppConfigService, AppConfigServiceMock, AuthModule, JWT_STORAGE_SERVICE, NoopTranslateModule, StorageService } from '@alfresco/adf-core';
|
||||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||||
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, NoopTranslateModule],
|
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, NoopTranslateModule, HttpClientTestingModule],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService },
|
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService },
|
||||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user