diff --git a/lib/insights/.eslintrc.json b/lib/insights/.eslintrc.json index 5db324d7ec6..4ed2241afef 100644 --- a/lib/insights/.eslintrc.json +++ b/lib/insights/.eslintrc.json @@ -20,18 +20,8 @@ "eslint-plugin-rxjs" ], "rules": { - "jsdoc/newline-after-description": "warn", - "@typescript-eslint/naming-convention": "warn", - "@typescript-eslint/consistent-type-assertions": "warn", - "@typescript-eslint/prefer-for-of": "warn", - "no-underscore-dangle": "warn", - "no-shadow": "warn", - "quote-props": "warn", - "object-shorthand": "warn", - "prefer-const": "warn", - "arrow-body-style": "warn", - "@angular-eslint/no-output-native": "warn", - "space-before-function-paren": "warn", + "no-underscore-dangle": ["error", { "allowAfterThis": true }], + "@angular-eslint/no-output-native": "off", "@angular-eslint/component-selector": [ "error", diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-heat-map.component.spec.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-heat-map.component.spec.ts index 95b536bfc94..50d06707e92 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-heat-map.component.spec.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-heat-map.component.spec.ts @@ -29,8 +29,8 @@ describe('AnalyticsReportHeatMapComponent', () => { let fixture: ComponentFixture; let element: HTMLElement; - const totalCountPercent: any = { 'sid-fake-id': 0, 'fake-start-event': 100 }; - const totalTimePercent: any = { 'sid-fake-id': 10, 'fake-start-event': 30 }; + const totalCountsPercentages: any = { 'sid-fake-id': 0, 'fake-start-event': 100 }; + const totalTimePercentages: any = { 'sid-fake-id': 10, 'fake-start-event': 30 }; const avgTimePercentages: any = { 'sid-fake-id': 5, 'fake-start-event': 50 }; const totalCountValues: any = { 'sid-fake-id': 2, 'fake-start-event': 3 }; @@ -50,12 +50,12 @@ describe('AnalyticsReportHeatMapComponent', () => { element = fixture.nativeElement; component.report = { - totalCountsPercentages: totalCountPercent, - totalCountValues: totalCountValues, - totalTimePercentages: totalTimePercent, - totalTimeValues: totalTimeValues, - avgTimeValues: avgTimeValues, - avgTimePercentages: avgTimePercentages + totalCountsPercentages, + totalCountValues, + totalTimePercentages, + totalTimeValues, + avgTimeValues, + avgTimePercentages }; }); @@ -96,14 +96,14 @@ describe('AnalyticsReportHeatMapComponent', () => { const field = { value: 'totalCount' }; component.onMetricChanges(field); expect(component.currentMetric).toEqual(totalCountValues); - expect(component.currentMetricColors).toEqual(totalCountPercent); + expect(component.currentMetricColors).toEqual(totalCountsPercentages); }); it('should change the currentMetric width totalTime', () => { const field = { value: 'totalTime' }; component.onMetricChanges(field); expect(component.currentMetric).toEqual(totalTimeValues); - expect(component.currentMetricColors).toEqual(totalTimePercent); + expect(component.currentMetricColors).toEqual(totalTimePercentages); }); it('should change the currentMetric width avgTime', () => { diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.spec.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.spec.ts index 4ebd5c01363..214611bb684 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.spec.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.spec.ts @@ -16,7 +16,7 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { AnalyticsReportListComponent } from '../components/analytics-report-list.component'; +import { AnalyticsReportListComponent, LAYOUT_GRID, LAYOUT_LIST } from '../components/analytics-report-list.component'; import { ReportParametersModel } from '../../diagram/models/report/report-parameters.model'; import { setupTestBed } from '@alfresco/adf-core'; import { InsightsTestingModule } from '../../testing/insights.testing.module'; @@ -27,14 +27,14 @@ declare let jasmine: any; describe('AnalyticsReportListComponent', () => { const reportList = [ - { 'id': 2002, 'name': 'Fake Test Process definition heat map' }, - { 'id': 2003, 'name': 'Fake Test Process definition overview' }, - { 'id': 2004, 'name': 'Fake Test Process instances overview' }, - { 'id': 2005, 'name': 'Fake Test Task overview' }, - { 'id': 2006, 'name': 'Fake Test Task service level agreement' } + { id: 2002, name: 'Fake Test Process definition heat map' }, + { id: 2003, name: 'Fake Test Process definition overview' }, + { id: 2004, name: 'Fake Test Process instances overview' }, + { id: 2005, name: 'Fake Test Task overview' }, + { id: 2006, name: 'Fake Test Task service level agreement' } ]; - const reportSelected = { 'id': 2003, 'name': 'Fake Test Process definition overview' }; + const reportSelected = { id: 2003, name: 'Fake Test Process definition overview' }; let component: AnalyticsReportListComponent; let fixture: ComponentFixture; @@ -159,13 +159,13 @@ describe('AnalyticsReportListComponent', () => { it('Should return false if the current report is different', () => { component.selectReport(reportSelected); - const anotherReport = { 'id': 111, 'name': 'Another Fake Test Process definition overview' }; + const anotherReport = { id: 111, name: 'Another Fake Test Process definition overview' }; expect(component.isSelected(anotherReport)).toBe(false); }); it('Should reload the report list', (done) => { component.initObserver(); - const report = new ReportParametersModel({ 'id': 2002, 'name': 'Fake Test Process definition heat map' }); + const report = new ReportParametersModel({ id: 2002, name: 'Fake Test Process definition heat map' }); component.reports = [report]; expect(component.reports.length).toEqual(1); component.reload(); @@ -213,14 +213,14 @@ describe('AnalyticsReportListComponent', () => { }); it('should display a grid when configured to', () => { - component.layoutType = AnalyticsReportListComponent.LAYOUT_GRID; + component.layoutType = LAYOUT_GRID; fixture.detectChanges(); expect(component.isGrid()).toBe(true); expect(component.isList()).toBe(false); }); it('should display a list when configured to', () => { - component.layoutType = AnalyticsReportListComponent.LAYOUT_LIST; + component.layoutType = LAYOUT_LIST; fixture.detectChanges(); expect(component.isGrid()).toBe(false); expect(component.isList()).toBe(true); diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.ts index 9c5c86b365c..5757e83befd 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-list.component.ts @@ -21,6 +21,9 @@ import { ReportParametersModel } from '../../diagram/models/report/report-parame import { AnalyticsService } from '../services/analytics.service'; import { share } from 'rxjs/operators'; +export const LAYOUT_LIST = 'LIST'; +export const LAYOUT_GRID = 'GRID'; + @Component({ selector: 'adf-analytics-report-list', templateUrl: './analytics-report-list.component.html', @@ -28,13 +31,9 @@ import { share } from 'rxjs/operators'; encapsulation: ViewEncapsulation.None }) export class AnalyticsReportListComponent implements OnInit { - - public static LAYOUT_LIST: string = 'LIST'; - public static LAYOUT_GRID: string = 'GRID'; - /** layout Type LIST or GRID. */ @Input() - layoutType: string = AnalyticsReportListComponent.LAYOUT_LIST; + layoutType: string = LAYOUT_LIST; /** appId ID of the target app. */ @Input() @@ -56,13 +55,12 @@ export class AnalyticsReportListComponent implements OnInit { @Output() error = new EventEmitter(); - private reportObserver: Observer; report$: Observable; - currentReport: any; - reports: ReportParametersModel[] = []; + private reportObserver: Observer; + constructor(private analyticsService: AnalyticsService) { this.report$ = new Observable((observer) => this.reportObserver = observer) .pipe(share()); @@ -140,25 +138,17 @@ export class AnalyticsReportListComponent implements OnInit { return this.reports === undefined || (this.reports && this.reports.length === 0); } - /** - * Reset the list - */ - private reset() { - if (!this.isReportsEmpty()) { - this.reports = []; - } - } - /** * Select the current report + * * @param report */ - public selectReport(report: any) { + selectReport(report: any) { this.currentReport = report; this.reportClick.emit(report); } - public selectReportByReportId(reportId: number) { + selectReportByReportId(reportId: number) { const reportFound = this.reports.find((report) => report.id === reportId); if (reportFound) { this.currentReport = reportFound; @@ -176,10 +166,19 @@ export class AnalyticsReportListComponent implements OnInit { } isList(): boolean { - return this.layoutType === AnalyticsReportListComponent.LAYOUT_LIST; + return this.layoutType === LAYOUT_LIST; } isGrid(): boolean { - return this.layoutType === AnalyticsReportListComponent.LAYOUT_GRID; + return this.layoutType === LAYOUT_GRID; + } + + /** + * Reset the list + */ + private reset() { + if (!this.isReportsEmpty()) { + this.reports = []; + } } } diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.spec.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.spec.ts index b9ab6cde295..d3c72dbbeaa 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.spec.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.spec.ts @@ -48,9 +48,7 @@ describe('AnalyticsReportParametersComponent', () => { service = TestBed.inject(AnalyticsService); component = fixture.componentInstance; element = fixture.nativeElement; - spyOn(component, 'isFormValid').and.callFake(() => { - return validForm; - }); + spyOn(component, 'isFormValid').and.callFake(() => validForm); fixture.detectChanges(); }); @@ -90,7 +88,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -110,7 +108,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -139,7 +137,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -201,7 +199,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -220,7 +218,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); component.toggleParameters(); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -245,7 +243,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -283,7 +281,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); }); @@ -317,7 +315,7 @@ describe('AnalyticsReportParametersComponent', () => { component.appId = appId; component.reportId = '1'; const change = new SimpleChange(null, appId, true); - component.ngOnChanges({'appId': change}); + component.ngOnChanges({appId: change}); }); @@ -330,7 +328,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, @@ -380,7 +378,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); }); @@ -392,7 +390,7 @@ describe('AnalyticsReportParametersComponent', () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); jasmine.Ajax.requests.mostRecent().respondWith({ status: 404, @@ -411,7 +409,7 @@ describe('AnalyticsReportParametersComponent', () => { beforeEach(async () => { const reportId = 1; const change = new SimpleChange(null, reportId, true); - component.ngOnChanges({'reportId': change}); + component.ngOnChanges({reportId: change}); fixture.detectChanges(); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -522,8 +520,8 @@ describe('AnalyticsReportParametersComponent', () => { it('Should show export and save button when the form became valid', fakeAsync(() => { validForm = false; fixture.detectChanges(); - let saveButton: HTMLButtonElement = element.querySelector('#save-button'); - let exportButton: HTMLButtonElement = element.querySelector('#export-button'); + let saveButton = element.querySelector('#save-button'); + let exportButton = element.querySelector('#export-button'); expect(saveButton).toBeNull(); expect(exportButton).toBeNull(); validForm = true; @@ -531,8 +529,8 @@ describe('AnalyticsReportParametersComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - saveButton = element.querySelector('#save-button'); - exportButton = element.querySelector('#export-button'); + saveButton = element.querySelector('#save-button'); + exportButton = element.querySelector('#export-button'); expect(saveButton).not.toBeNull(); expect(saveButton).toBeDefined(); diff --git a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts index 1895545e59f..c78ea90791f 100644 --- a/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts +++ b/lib/insights/src/lib/analytics-process/components/analytics-report-parameters.component.ts @@ -40,6 +40,8 @@ import { AnalyticsService } from '../services/analytics.service'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +const FORMAT_DATE_ACTIVITI = 'YYYY-MM-DD'; + @Component({ selector: 'adf-analytics-report-parameters', templateUrl: './analytics-report-parameters.component.html', @@ -47,9 +49,6 @@ import { takeUntil } from 'rxjs/operators'; encapsulation: ViewEncapsulation.None }) export class AnalyticsReportParametersComponent implements OnInit, OnChanges, OnDestroy, AfterContentChecked { - - public static FORMAT_DATE_ACTIVITI: string = 'YYYY-MM-DD'; - /** appId ID of the target app. */ @Input() appId: number; @@ -90,24 +89,18 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On reportNameDialog: any; onDropdownChanged = new EventEmitter(); - successReportParams = new EventEmitter(); - successParamOpt = new EventEmitter(); reportParameters: ReportParametersModel; - reportForm: FormGroup; - action: string; - isEditable: boolean = false; - reportName: string; - reportParamQuery: ReportQuery; - private hideParameters: boolean = true; formValidState: boolean = false; + + private hideParameters: boolean = true; private onDestroy$ = new Subject(); constructor(private analyticsService: AnalyticsService, @@ -115,7 +108,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On private logService: LogService, private contentService: ContentService, private dialog: MatDialog) { - } ngOnInit() { @@ -160,58 +152,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On } } - private generateFormGroupFromParameter(parameters: ReportParameterDetailsModel[]) { - const formBuilderGroup: any = {}; - parameters.forEach((param: ReportParameterDetailsModel) => { - switch (param.type) { - case 'dateRange': - formBuilderGroup.dateRange = new FormGroup({}, Validators.required); - break; - case 'processDefinition': - formBuilderGroup.processDefGroup = new FormGroup({ - processDefinitionId: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'duration': - formBuilderGroup.durationGroup = new FormGroup({ - duration: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'dateInterval': - formBuilderGroup.dateIntervalGroup = new FormGroup({ - dateRangeInterval: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'boolean': - formBuilderGroup.typeFilteringGroup = new FormGroup({ - typeFiltering: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'task': - formBuilderGroup.taskGroup = new FormGroup({ - taskName: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'integer': - formBuilderGroup.processInstanceGroup = new FormGroup({ - slowProcessInstanceInteger: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - case 'status': - formBuilderGroup.statusGroup = new FormGroup({ - status: new FormControl(null, Validators.required, null) - }, Validators.required); - break; - default: - return; - } - }); - this.reportForm = this.formBuilder.group(formBuilderGroup); - this.reportForm.valueChanges.subscribe((data) => this.onValueChanged(data)); - this.reportForm.statusChanges.subscribe(() => this.onStatusChanged()); - } - - public getReportParams(reportId: string) { + getReportParams(reportId: string) { this.analyticsService.getReportParams(reportId).subscribe( (res: ReportParametersModel) => { this.reportParameters = res; @@ -228,20 +169,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On ); } - private retrieveParameterOptions(parameters: ReportParameterDetailsModel[], appId: number, reportId?: string, processDefinitionId?: string) { - parameters.forEach((param) => { - this.analyticsService.getParamValuesByType(param.type, appId, reportId, processDefinitionId).subscribe( - (opts: ParameterValueModel[]) => { - param.options = opts; - this.successParamOpt.emit(opts); - }, - (err: any) => { - this.error.emit(err); - } - ); - }); - } - onProcessDefinitionChanges(field: any) { if (field.value) { this.onDropdownChanged.emit(field); @@ -266,16 +193,15 @@ 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'; + convertMomentDate(date: string) { + return moment(date, FORMAT_DATE_ACTIVITI, true).format(FORMAT_DATE_ACTIVITI) + 'T00:00:00.000Z'; } - public getTodayDate() { - return moment().format(AnalyticsReportParametersComponent.FORMAT_DATE_ACTIVITI); + getTodayDate() { + return moment().format(FORMAT_DATE_ACTIVITI); } - public convertNumber(value: string): number { + convertNumber(value: string): number { return value != null ? parseInt(value, 10) : 0; } @@ -314,15 +240,15 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On this.onDestroy$.complete(); } - public editEnable() { + editEnable() { this.isEditable = true; } - public editDisable() { + editDisable() { this.isEditable = false; } - public editTitle() { + editTitle() { this.analyticsService .updateReport(`${this.reportParameters.id}`, this.reportParameters.name) .subscribe( @@ -336,7 +262,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On ); } - public showDialog(event: string) { + showDialog(event: string) { this.dialog.open(this.reportNameDialog, { width: '500px' }); this.action = event; this.reportName = this.reportParameters.name + ' ( ' + this.getTodayDate() + ' )'; @@ -435,4 +361,69 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On get processInstanceGroup(): FormGroup { return this.reportForm.controls.processInstanceGroup as FormGroup; } + + private generateFormGroupFromParameter(parameters: ReportParameterDetailsModel[]) { + const formBuilderGroup: any = {}; + parameters.forEach((param: ReportParameterDetailsModel) => { + switch (param.type) { + case 'dateRange': + formBuilderGroup.dateRange = new FormGroup({}, Validators.required); + break; + case 'processDefinition': + formBuilderGroup.processDefGroup = new FormGroup({ + processDefinitionId: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'duration': + formBuilderGroup.durationGroup = new FormGroup({ + duration: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'dateInterval': + formBuilderGroup.dateIntervalGroup = new FormGroup({ + dateRangeInterval: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'boolean': + formBuilderGroup.typeFilteringGroup = new FormGroup({ + typeFiltering: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'task': + formBuilderGroup.taskGroup = new FormGroup({ + taskName: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'integer': + formBuilderGroup.processInstanceGroup = new FormGroup({ + slowProcessInstanceInteger: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + case 'status': + formBuilderGroup.statusGroup = new FormGroup({ + status: new FormControl(null, Validators.required, null) + }, Validators.required); + break; + default: + return; + } + }); + this.reportForm = this.formBuilder.group(formBuilderGroup); + this.reportForm.valueChanges.subscribe((data) => this.onValueChanged(data)); + this.reportForm.statusChanges.subscribe(() => this.onStatusChanged()); + } + + private retrieveParameterOptions(parameters: ReportParameterDetailsModel[], appId: number, reportId?: string, processDefinitionId?: string) { + parameters.forEach((param) => { + this.analyticsService.getParamValuesByType(param.type, appId, reportId, processDefinitionId).subscribe( + (opts: ParameterValueModel[]) => { + param.options = opts; + this.successParamOpt.emit(opts); + }, + (err: any) => { + this.error.emit(err); + } + ); + }); + } } diff --git a/lib/insights/src/lib/analytics-process/components/widgets/date-range/date-range.widget.ts b/lib/insights/src/lib/analytics-process/components/widgets/date-range/date-range.widget.ts index 0a8d1610acb..2ea99a425e2 100644 --- a/lib/insights/src/lib/analytics-process/components/widgets/date-range/date-range.widget.ts +++ b/lib/insights/src/lib/analytics-process/components/widgets/date-range/date-range.widget.ts @@ -26,6 +26,9 @@ import { Moment } from 'moment'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +const FORMAT_DATE_ACTIVITI = 'YYYY-MM-DD'; +const SHOW_FORMAT = 'DD/MM/YYYY'; + @Component({ selector: 'adf-date-range-widget', templateUrl: './date-range.widget.html', @@ -36,18 +39,14 @@ import { takeUntil } from 'rxjs/operators'; encapsulation: ViewEncapsulation.None }) export class DateRangeWidgetComponent implements OnInit, OnDestroy { - - public FORMAT_DATE_ACTIVITI: string = 'YYYY-MM-DD'; - public SHOW_FORMAT: string = 'DD/MM/YYYY'; - @Input('group') - public dateRange: FormGroup; + dateRange: FormGroup; @Input() field: any; @Output() - dateRangeChanged: EventEmitter = new EventEmitter(); + dateRangeChanged = new EventEmitter(); minDate: Moment; maxDate: Moment; @@ -67,16 +66,16 @@ export class DateRangeWidgetComponent implements OnInit, OnDestroy { .pipe(takeUntil(this.onDestroy$)) .subscribe(locale => this.dateAdapter.setLocale(locale)); - const momentDateAdapter = this.dateAdapter; - momentDateAdapter.overrideDisplayFormat = this.SHOW_FORMAT; + const momentDateAdapter = this.dateAdapter as MomentDateAdapter; + momentDateAdapter.overrideDisplayFormat = SHOW_FORMAT; if (this.field) { if (this.field.value && this.field.value.startDate) { - this.startDatePicker = moment(this.field.value.startDate, this.FORMAT_DATE_ACTIVITI); + this.startDatePicker = moment(this.field.value.startDate, FORMAT_DATE_ACTIVITI); } if (this.field.value && this.field.value.endDate) { - this.endDatePicker = moment(this.field.value.endDate, this.FORMAT_DATE_ACTIVITI); + this.endDatePicker = moment(this.field.value.endDate, FORMAT_DATE_ACTIVITI); } } @@ -106,14 +105,14 @@ export class DateRangeWidgetComponent implements OnInit, OnDestroy { } convertToMomentDateWithTime(date: string) { - return moment(date, this.FORMAT_DATE_ACTIVITI, true).format(this.FORMAT_DATE_ACTIVITI) + 'T00:00:00.000Z'; + return moment(date, FORMAT_DATE_ACTIVITI, true).format(FORMAT_DATE_ACTIVITI) + 'T00:00:00.000Z'; } dateCheck(formControl: AbstractControl) { const startDate = moment(formControl.get('startDate').value); const endDate = moment(formControl.get('endDate').value); const isAfterCheck = startDate.isAfter(endDate); - return isAfterCheck ? {'greaterThan': true} : null; + return isAfterCheck ? {greaterThan: true} : null; } isStartDateGreaterThanEndDate() { diff --git a/lib/insights/src/lib/analytics-process/services/analytics.service.spec.ts b/lib/insights/src/lib/analytics-process/services/analytics.service.spec.ts index fc3f2d30293..9819562b61c 100644 --- a/lib/insights/src/lib/analytics-process/services/analytics.service.spec.ts +++ b/lib/insights/src/lib/analytics-process/services/analytics.service.spec.ts @@ -61,7 +61,7 @@ describe('AnalyticsService', () => { ); jasmine.Ajax.requests.mostRecent().respondWith({ - 'status': 200, + status: 200, contentType: 'application/json', responseText: JSON.stringify(fakeReportList) }); @@ -78,7 +78,7 @@ describe('AnalyticsService', () => { ); jasmine.Ajax.requests.mostRecent().respondWith({ - 'status': 200, + status: 200, contentType: 'application/json', responseText: JSON.stringify(fakeReportList) }); diff --git a/lib/insights/src/lib/analytics-process/services/analytics.service.ts b/lib/insights/src/lib/analytics-process/services/analytics.service.ts index fc89bf12411..73eb7c71be4 100644 --- a/lib/insights/src/lib/analytics-process/services/analytics.service.ts +++ b/lib/insights/src/lib/analytics-process/services/analytics.service.ts @@ -33,13 +33,13 @@ import { ProcessDefinitionsApi, ReportApi } from '@alfresco/js-api'; @Injectable({ providedIn: 'root' }) export class AnalyticsService { - _reportApi: ReportApi; + private _reportApi: ReportApi; get reportApi(): ReportApi { this._reportApi = this._reportApi ?? new ReportApi(this.apiService.getInstance()); return this._reportApi; } - _processDefinitionsApi: ProcessDefinitionsApi; + private _processDefinitionsApi: ProcessDefinitionsApi; get processDefinitionsApi(): ProcessDefinitionsApi { this._processDefinitionsApi = this._processDefinitionsApi ?? new ProcessDefinitionsApi(this.apiService.getInstance()); return this._processDefinitionsApi; @@ -71,32 +71,21 @@ export class AnalyticsService { /** * Retrieve Report by name + * * @param reportName - string - The name of report */ getReportByName(reportName: string): Observable { return from(this.reportApi.getReportList()) .pipe( - map((response: any) => { - return response.find((report) => report.name === reportName); - }), + map((response: any) => response.find((report) => report.name === reportName)), catchError((err) => this.handleError(err)) ); } - private isReportValid(appId: number, report: ReportParametersModel) { - let isValid: boolean = true; - if (appId && appId !== 0 && report.name.includes('Process definition overview')) { - isValid = false; - } - return isValid; - } - getReportParams(reportId: string): Observable { return from(this.reportApi.getReportParams(reportId)) .pipe( - map((res: any) => { - return new ReportParametersModel(res); - }), + map((res: any) => new ReportParametersModel(res)), catchError((err) => this.handleError(err)) ); } @@ -166,7 +155,7 @@ export class AnalyticsService { } getProcessDefinitionsValues(appId: number): Observable { - const options = { 'appDefinitionId': appId }; + const options = { appDefinitionId: appId }; return from(this.processDefinitionsApi.getProcessDefinitions(options)) .pipe( map((res: any) => { @@ -272,4 +261,12 @@ export class AnalyticsService { this.logService.error(error); return throwError(error || 'Server error'); } + + private isReportValid(appId: number, report: ReportParametersModel) { + let isValid: boolean = true; + if (appId && appId !== 0 && report.name.includes('Process definition overview')) { + isValid = false; + } + return isValid; + } } diff --git a/lib/insights/src/lib/diagram/components/activities/diagram-task.component.ts b/lib/insights/src/lib/diagram/components/activities/diagram-task.component.ts index 5f83c08159f..8ae208f132a 100644 --- a/lib/insights/src/lib/diagram/components/activities/diagram-task.component.ts +++ b/lib/insights/src/lib/diagram/components/activities/diagram-task.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { ACTIVITY_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -43,7 +44,7 @@ export class DiagramTaskComponent implements OnInit { this.textPosition = {x: this.data.x + ( this.data.width / 2 ), y: this.data.y + ( this.data.height / 2 )}; this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, ACTIVITY_STROKE_COLOR); this.options.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/boundary-events/diagram-boundary-event.component.ts b/lib/insights/src/lib/diagram/components/boundary-events/diagram-boundary-event.component.ts index 3ef83d46320..7be2249b386 100644 --- a/lib/insights/src/lib/diagram/components/boundary-events/diagram-boundary-event.component.ts +++ b/lib/insights/src/lib/diagram/components/boundary-events/diagram-boundary-event.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -49,7 +50,7 @@ export class DiagramBoundaryEventComponent implements OnInit { this.circleRadiusInner = 12; this.circleRadiusOuter = 15; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); diff --git a/lib/insights/src/lib/diagram/components/boundary-events/diagram-throw-event.component.ts b/lib/insights/src/lib/diagram/components/boundary-events/diagram-throw-event.component.ts index 4cfadc24ec0..a15c9bae6e5 100644 --- a/lib/insights/src/lib/diagram/components/boundary-events/diagram-throw-event.component.ts +++ b/lib/insights/src/lib/diagram/components/boundary-events/diagram-throw-event.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -50,7 +51,7 @@ export class DiagramThrowEventComponent implements OnInit { this.circleRadiusInner = 12; this.circleRadiusOuter = 15; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); diff --git a/lib/insights/src/lib/diagram/components/diagram.component.ts b/lib/insights/src/lib/diagram/components/diagram.component.ts index f3983183f53..d0fa3afdec9 100644 --- a/lib/insights/src/lib/diagram/components/diagram.component.ts +++ b/lib/insights/src/lib/diagram/components/diagram.component.ts @@ -22,6 +22,9 @@ import { DiagramColorService } from '../services/diagram-color.service'; import { DiagramsService } from '../services/diagrams.service'; import { RaphaelService } from './raphael/raphael.service'; +const PADDING_WIDTH: number = 60; +const PADDING_HEIGHT: number = 60; + @Component({ selector: 'adf-diagram', styleUrls: ['./diagram.component.css'], @@ -65,9 +68,6 @@ export class DiagramComponent implements OnChanges { @Output() error = new EventEmitter(); - PADDING_WIDTH: number = 60; - PADDING_HEIGHT: number = 60; - diagram: DiagramModel; constructor(private diagramColorService: DiagramColorService, @@ -89,8 +89,8 @@ export class DiagramComponent implements OnChanges { this.diagramsService.getRunningProcessDefinitionModel(processInstanceId).subscribe( (res: any) => { this.diagram = new DiagramModel(res); - this.raphaelService.setting(this.diagram.diagramWidth + this.PADDING_WIDTH, - this.diagram.diagramHeight + this.PADDING_HEIGHT); + this.raphaelService.setting(this.diagram.diagramWidth + PADDING_WIDTH, + this.diagram.diagramHeight + PADDING_HEIGHT); this.setMetricValueToDiagramElement(this.diagram, this.metricPercentages, this.metricType); this.success.emit(res); }, @@ -104,8 +104,8 @@ export class DiagramComponent implements OnChanges { this.diagramsService.getProcessDefinitionModel(processDefinitionId).subscribe( (res: any) => { this.diagram = new DiagramModel(res); - this.raphaelService.setting(this.diagram.diagramWidth + this.PADDING_WIDTH, - this.diagram.diagramHeight + this.PADDING_HEIGHT); + this.raphaelService.setting(this.diagram.diagramWidth + PADDING_WIDTH, + this.diagram.diagramHeight + PADDING_HEIGHT); this.setMetricValueToDiagramElement(this.diagram, this.metricPercentages, this.metricType); this.success.emit(res); }, diff --git a/lib/insights/src/lib/diagram/components/events/diagram-end-event.component.ts b/lib/insights/src/lib/diagram/components/events/diagram-end-event.component.ts index 7491d8e484a..12dd0e9d86c 100644 --- a/lib/insights/src/lib/diagram/components/events/diagram-end-event.component.ts +++ b/lib/insights/src/lib/diagram/components/events/diagram-end-event.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -41,7 +42,7 @@ export class DiagramEndEventComponent implements OnInit { this.options.radius = 14; this.options.strokeWidth = 4; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); diff --git a/lib/insights/src/lib/diagram/components/events/diagram-start-event.component.ts b/lib/insights/src/lib/diagram/components/events/diagram-start-event.component.ts index ad8be689d37..6407f1c78c7 100644 --- a/lib/insights/src/lib/diagram/components/events/diagram-start-event.component.ts +++ b/lib/insights/src/lib/diagram/components/events/diagram-start-event.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -41,7 +42,7 @@ export class DiagramStartEventComponent implements OnInit { this.options.radius = 15; this.options.strokeWidth = 1; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); diff --git a/lib/insights/src/lib/diagram/components/gateways/diagram-event-gateway.component.ts b/lib/insights/src/lib/diagram/components/gateways/diagram-event-gateway.component.ts index c71f4148d58..08eae180f15 100644 --- a/lib/insights/src/lib/diagram/components/gateways/diagram-event-gateway.component.ts +++ b/lib/insights/src/lib/diagram/components/gateways/diagram-event-gateway.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -49,7 +50,7 @@ export class DiagramEventGatewayComponent implements OnInit { this.centerPentagon.x = this.data.x; this.centerPentagon.y = this.data.y; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/gateways/diagram-exclusive-gateway.component.ts b/lib/insights/src/lib/diagram/components/gateways/diagram-exclusive-gateway.component.ts index 1904c071ae7..7902c047532 100644 --- a/lib/insights/src/lib/diagram/components/gateways/diagram-exclusive-gateway.component.ts +++ b/lib/insights/src/lib/diagram/components/gateways/diagram-exclusive-gateway.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -45,7 +46,7 @@ export class DiagramExclusiveGatewayComponent implements OnInit { this.width = this.data.width; this.height = this.data.height; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/gateways/diagram-gateway.component.ts b/lib/insights/src/lib/diagram/components/gateways/diagram-gateway.component.ts index 06ab70e92d6..0449e2dcc3d 100644 --- a/lib/insights/src/lib/diagram/components/gateways/diagram-gateway.component.ts +++ b/lib/insights/src/lib/diagram/components/gateways/diagram-gateway.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -45,7 +46,7 @@ export class DiagramGatewayComponent implements OnInit { this.width = this.data.width; this.height = this.data.height; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/gateways/diagram-inclusive-gateway.component.ts b/lib/insights/src/lib/diagram/components/gateways/diagram-inclusive-gateway.component.ts index aa150f1eb6d..5ecccecb44e 100644 --- a/lib/insights/src/lib/diagram/components/gateways/diagram-inclusive-gateway.component.ts +++ b/lib/insights/src/lib/diagram/components/gateways/diagram-inclusive-gateway.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -43,7 +44,7 @@ export class DiagramInclusiveGatewayComponent implements OnInit { this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/gateways/diagram-parallel-gateway.component.ts b/lib/insights/src/lib/diagram/components/gateways/diagram-parallel-gateway.component.ts index b078706f4ac..9f086609278 100644 --- a/lib/insights/src/lib/diagram/components/gateways/diagram-parallel-gateway.component.ts +++ b/lib/insights/src/lib/diagram/components/gateways/diagram-parallel-gateway.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -45,7 +46,7 @@ export class DiagramParallelGatewayComponent implements OnInit { this.width = this.data.width; this.height = this.data.height; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts b/lib/insights/src/lib/diagram/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts index e1147d428a2..970fe04023c 100644 --- a/lib/insights/src/lib/diagram/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts +++ b/lib/insights/src/lib/diagram/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -47,7 +48,7 @@ export class DiagramIntermediateCatchingEventComponent implements OnInit { this.circleRadiusInner = 12; this.circleRadiusOuter = 15; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } diff --git a/lib/insights/src/lib/diagram/components/raphael/anchor.ts b/lib/insights/src/lib/diagram/components/raphael/anchor.ts index 37d3d4d2138..e4ad9103e78 100644 --- a/lib/insights/src/lib/diagram/components/raphael/anchor.ts +++ b/lib/insights/src/lib/diagram/components/raphael/anchor.ts @@ -15,27 +15,26 @@ * limitations under the License. */ -export class Anchor { - - public static ANCHOR_TYPE: any = { - main: 'main', - middle: 'middle', - first: 'first', - last: 'last' - }; +export const ANCHOR_TYPE = { + main: 'main', + middle: 'middle', + first: 'first', + last: 'last' +}; +export class Anchor { uuid: any = null; x: any = 0; y: any = 0; isFirst: any = false; isLast: any = false; typeIndex: any = 0; - type: any = Anchor.ANCHOR_TYPE.main; + type: any = ANCHOR_TYPE.main; constructor(uuid: any, type: any, x: any, y: any) { this.uuid = uuid; this.x = x; this.y = y; - this.type = (type === Anchor.ANCHOR_TYPE.middle) ? Anchor.ANCHOR_TYPE.middle : Anchor.ANCHOR_TYPE.main; + this.type = (type === ANCHOR_TYPE.middle) ? ANCHOR_TYPE.middle : ANCHOR_TYPE.main; } } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts index a8f2166ee41..8143d4beec2 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts @@ -71,8 +71,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements C3.24683871,3.62387097 3.24683871,5.54219355 4.43006452,6.72541935 C5.61329032,7.90864516 7.5316129,7.90864516 8.71483871,6.72541935 C8.80464516,6.6356129 8.88529032,6.54025806 8.96154839,6.44270968 C7.57341935,5.98864516 6.57045161,4.68387097 6.57032258,3.144`).attr({ - 'stroke': this.stroke, - 'fill': '#87C040', + stroke: this.stroke, + fill: '#87C040', 'stroke-width': this.strokeWidth }); @@ -86,8 +86,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements 5.91935484 C14.947871,5.82954839 14.8526452,5.74890323 14.7550968,5.67264516 C14.3010323,7.06064516 12.996129,8.06374194 11.4563871,8.06374194 L8.61277419,8.06374194 L10.7529032,10.204 C11.936129,11.3872258 13.8545806,11.3872258 15.0376774,10.204 C16.2209032,9.02077419 16.2209032,7.10245161 15.0376774,5.91935484`).attr({ - 'stroke': this.stroke, - 'fill': '#87C040', + stroke: this.stroke, + fill: '#87C040', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX + ',' + startY); @@ -96,8 +96,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements C6.19458065,2.89032258 5.98141935,4.52309677 4.89225806,5.61225806 L2.88154839,7.62309677 L5.9083871,7.62309677 C7.58154839,7.62309677 8.93806452,6.26658065 8.93806452,4.59329032 C8.93819355,2.92 7.58167742,1.5636129 5.9083871,1.5636129`).attr({ - 'stroke': this.stroke, - 'fill': '#ED9A2D', + stroke: this.stroke, + fill: '#ED9A2D', 'stroke-width': this.strokeWidth }); @@ -108,8 +108,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements C0.206451613,1.10554839 0.125806452,1.20077419 0.0495483871,1.29845161 C1.43754839,1.75251613 2.44064516,3.05729032 2.44064516,4.59703226 L2.44064516,7.44077419 L4.57574194,5.30554839 L4.58090323,5.30051613 C5.76412903,4.11729032 5.76412903,2.19896774 4.58090323,1.0156129`).attr({ - 'stroke': this.stroke, - 'fill': '#5698C6', + stroke: this.stroke, + fill: '#5698C6', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX2 + ',' + startY); @@ -139,8 +139,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements C4.04258065,4.74103226 2.12412903,4.74090323 0.941032258,5.92412903 C-0.242193548,7.10735484 -0.242193548,9.02567742 0.941032258,10.2089032 C1.03070968,10.2985806 1.12464516,10.3814194 1.22206452,10.4575484 C1.22529032,10.448 1.22929032,10.4388387 1.23251613,10.4292903`).attr({ - 'stroke': this.stroke, - 'fill': '#5698C6', + stroke: this.stroke, + fill: '#5698C6', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX + ',' + startY); @@ -152,8 +152,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements 7.54722581,3.20090323 7.54722581,4.58890323 L7.54722581,4.59612903M10.1385806,5.29819355 L8.444,6.99290323 L8.444,4.71522581 L8.44129032,4.58606452 C8.44129032,3.19896774 9.37341935,2.02954839 10.6454194,1.67019355 C11.2925161,2.82412903 11.1251613,4.3116129 10.1436129,5.29316129 L10.1385806,5.29819355`).attr({ - 'stroke': this.stroke, - 'fill': '#446BA5', + stroke: this.stroke, + fill: '#446BA5', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX + ',' + startY); @@ -161,8 +161,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements path1 = this.paper.path(`M11.4548387,7.61677419 L9.05832258,7.61677419 L10.6689032,6.00619355 L10.7583226,5.91303226 C11.7390968,4.93212903 13.2251613,4.7643871 14.3787097,5.40967742 C14.0202581,6.68322581 12.8500645,7.61677419 11.4620645,7.61677419 L11.4548387,7.61677419`).attr({ - 'stroke': this.stroke, - 'fill': '#FFF101', + stroke: this.stroke, + fill: '#FFF101', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX + ',' + startY); @@ -176,8 +176,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements 5.85690323,10.8347097 L5.86193548,10.8296774M4.53251613,8.50993548 L6.92903226,8.50993548 L5.31845161,10.1205161 L5.22903226,10.2136774 C4.24812903,11.1945806 2.76219355,11.3623226 1.60851613,10.7170323 C1.96709677,9.44335484 3.13716129,8.50993548 4.52529032,8.50993548 L4.53251613,8.50993548`).attr({ - 'stroke': this.stroke, - 'fill': '#45AB47', + stroke: this.stroke, + fill: '#45AB47', 'stroke-width': this.strokeWidth }); path1.transform('T' + startX + ',' + startY); diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts index 7b1cd7f6c6e..6b6bbd220c2 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts @@ -56,21 +56,19 @@ export class RaphaelIconBoxPublishDirective extends RaphaelBase implements OnIni } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { - + draw(position: Point) { const image = this.paper.image(); - image.attr({'x': position.x}); - image.attr({'y': position.y}); - image.attr({'id': 'image3398'}); - image.attr({'preserveAspectRatio': 'none'}); - image.attr({'height': '16'}); - image.attr({'width': '17'}); - image.attr({'src': `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAjCAYAAADxG9hnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI WXMAAA7DAAAO + image.attr({x: position.x}); + image.attr({y: position.y}); + image.attr({id: 'image3398'}); + image.attr({preserveAspectRatio: 'none'}); + image.attr({height: '16'}); + image.attr({width: '17'}); + image.attr({src: `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAjCAYAAADxG9hnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI WXMAAA7DAAAO wwHHb6hkAAAAB3RJTUUH3wQXDxwCFNe28AAACsdJREFUWMOVmGmMXtV5x3/POfe+ y2yeGc/mwbMZG9tDMGBTKC5GCU4pbYmSRlmowlIFJWnUprSiy4dI/UA/9EsVifZDmy ZIxEpo1Cql UKICqbABG+x4X4M9iz2bxzOefXnfee+95zz9cN9Z7NqVeqSje3XPec/5n/Ns//8rAAd6xvj0lmYA VJWTI9fN2d5BikslrDEYY0ABIX0aUBUUUJS1TZB0HZS lUsz8fBHF09neKnFU0t964B5trcoqwA8O fsI3HtmW/u7Hx3p5+oHNqCr7DpzLX3dh1+xC4Z7p2dnGKE7UGmOsNTYFIuXtUlQqsgJkGSdrgBRL 8dLCYlRUUTa1NrYXiqWZ diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts index 615969c2d05..8c984a14d99 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts @@ -63,8 +63,8 @@ export class RaphaelIconBusinessRuleDirective extends RaphaelBase implements OnI const path1 = this.paper.path(`m 1,2 0,14 16,0 0,-14 z m 1.45458,5.6000386 2.90906,0 0,2.7999224 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.7999224 -8.72718,0 z m -4.36364,4.1998844 2.90906,0 0,2.800116 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.800116 -8.72718,0 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-camel.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-camel.component.ts index 793bb80ccad..baeb3c22960 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-camel.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-camel.component.ts @@ -55,11 +55,10 @@ export class RaphaelIconCamelDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`m 8.1878027,15.383782 c -0.824818,-0.3427 0.375093,-1.1925 0.404055,-1.7743 0.230509,-0.8159 -0.217173,-1.5329 -0.550642,-2.2283 -0.106244,-0.5273 -0.03299,-1.8886005 -0.747194,-1.7818005 -0.712355,0.3776 -0.9225,1.2309005 -1.253911,1.9055005 -0.175574,1.0874 -0.630353,2.114 -0.775834,3.2123 -0.244009,0.4224 -1.741203,0.3888 -1.554386,-0.1397 @@ -80,8 +79,8 @@ export class RaphaelIconCamelDirective extends RaphaelBase implements OnInit { 0.152396,1.3997 0.157345,2.1104 0.07947,0.7464 0.171287,1.4944 0.238271,2.2351 0.237411,1.0076 -0.687542,1.1488 -1.414811,0.8598 z m 6.8675483,-1.8379 c 0.114364,-0.3658 0.206751,-1.2704 -0.114466,-1.3553 -0.152626,0.5835 -0.225018,1.1888 -0.227537,1.7919 0.147087,-0.1166 0.265559,-0.2643 0.342003,-0.4366 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-error.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-error.component.ts index 8f15b21dbdf..34ddbaa2fbd 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-error.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-error.component.ts @@ -55,16 +55,15 @@ export class RaphaelIconErrorDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`M 22.820839,11.171502 L 19.36734,24.58992 L 13.54138,14.281819 L 9.3386512,20.071607 L 13.048949,6.8323057 L 18.996148,16.132659 L 22.820839,11.171502 z`).attr({ - 'opacity': 1, - 'stroke': this.stroke, - 'fill': this.fillColors + opacity: 1, + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts index 33293b28e4c..9a30973e1f6 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts @@ -55,21 +55,19 @@ export class RaphaelIconGoogleDrivePublishDirective extends RaphaelBase implemen } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { - + draw(position: Point) { const image = this.paper.image(); - image.attr({'x': position.x}); - image.attr({'y': position.y}); - image.attr({'id': 'image3398'}); - image.attr({'preserveAspectRatio': 'none'}); - image.attr({'height': '16'}); - image.attr({'width': '17'}); - image.attr({'src': `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBA + image.attr({x: position.x}); + image.attr({y: position.y}); + image.attr({id: 'image3398'}); + image.attr({preserveAspectRatio: 'none'}); + image.attr({height: '16'}); + image.attr({width: '17'}); + image.attr({src: `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBA JqcGAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIHSURBVDiNpVI7a1RREP7mzLl3d+9mScxaiBLFwohxQcXCwjwao/gqFAQhRGOphQgmgs9oGxaV gFhpYPUPGMFCCzEqCgETg0uK4CuFoLhZyWNf994zFrqy9xJWwQ+mOB8z33wzZ4D/BIWJppG+plstc+mjK9yttbzALHExcoDaRxdqeRUWcFkGBz7G1s152CCQ7dUAqNOLuZf qOmi439MmhifF86e6uLj4MFXoCuVXWPkp2vZkZlkHYvRNAJYwtz79oXdMLfFMSMD2Dd9YdoSGTO9hQLoBQBESQvLpUNaZD1sGsN8d390dFBjpiwooHVBW6tvXCr2H4EFo6L diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-manual.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-manual.component.ts index e16627afdd4..0f95812affd 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-manual.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-manual.component.ts @@ -55,11 +55,10 @@ export class RaphaelIconManualDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`m 17,9.3290326 c -0.0069,0.5512461 -0.455166,1.0455894 -0.940778,1.0376604 l -5.792746,0 c 0.0053,0.119381 0.0026,0.237107 0.0061,0.355965 l 5.154918,0 c 0.482032,-0.0096 0.925529,0.49051 0.919525,1.037574 -0.0078,0.537128 -0.446283,1.017531 -0.919521,1.007683 l -5.245273,0 c -0.01507,0.104484 -0.03389,0.204081 -0.05316,0.301591 l 2.630175,0 @@ -70,9 +69,9 @@ export class RaphaelIconManualDirective extends RaphaelBase implements OnInit { 8.507351,5.7996113 8.4370292,5.7936859 l 6.3569748,-0.00871 c 0.497046,-0.00958 0.952273,0.5097676 0.94612,1.0738232 -0.0053,0.556126 -0.456176,1.0566566 -0.94612,1.0496854 l -4.72435,0 c 0.01307,0.1149374 0.0244,0.2281319 0.03721,0.3498661 l 5.952195,0 c 0.494517,-0.00871 0.947906,0.5066305 0.940795,1.0679848 z`).attr({ - 'opacity': 1, - 'stroke': this.stroke, - 'fill': this.fillColors + opacity: 1, + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-message.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-message.component.ts index 0f74a9325df..a4085a6a7a1 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-message.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-message.component.ts @@ -55,17 +55,16 @@ export class RaphaelIconMessageDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 L 17 15 L 12 10 L 9 13 L 6 10 z`).attr({ - 'opacity': this.fillOpacity, - 'stroke': this.stroke, - 'strokeWidth': this.strokeWidth, - 'fill': this.fillColors + opacity: this.fillOpacity, + stroke: this.stroke, + strokeWidth: this.strokeWidth, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-mule.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-mule.component.ts index 1a9f166605d..a209693d537 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-mule.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-mule.component.ts @@ -55,19 +55,18 @@ export class RaphaelIconMuleDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`M 8,0 C 3.581722,0 0,3.5817 0,8 c 0,4.4183 3.581722,8 8,8 4.418278,0 8,-3.5817 8,-8 L 16,7.6562 C 15.813571,3.3775 12.282847,0 8,0 z M 5.1875,2.7812 8,7.3437 10.8125,2.7812 c 1.323522,0.4299 2.329453,1.5645 2.8125,2.8438 1.136151,2.8609 -0.380702,6.4569 -3.25,7.5937 -0.217837,-0.6102 -0.438416,-1.2022 -0.65625,-1.8125 0.701032,-0.2274 1.313373,-0.6949 1.71875,-1.3125 0.73624,-1.2317 0.939877,-2.6305 -0.03125,-4.3125 l -2.75,4.0625 -0.65625,0 -0.65625,0 -2.75,-4 C 3.5268433,7.6916 3.82626,8.862 4.5625,10.0937 4.967877,10.7113 5.580218,11.1788 6.28125,11.4062 6.063416,12.0165 5.842837,12.6085 5.625,13.2187 2.755702,12.0819 1.238849,8.4858 2.375,5.625 2.858047,4.3457 3.863978,3.2112 5.1875,2.7812 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-receive.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-receive.component.ts index 4dab2e1151b..4a8b067304c 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-receive.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-receive.component.ts @@ -55,15 +55,14 @@ export class RaphaelIconReceiveDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`m 0.5,2.5 0,13 17,0 0,-13 z M 2,4 6.5,8.5 2,13 z M 4,4 14,4 9,9 z m 12,0 0,9 -4.5,-4.5 z M 7.5,9.5 9,11 10.5,9.5 15,14 3,14 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts index ee36b6129fe..8f71415f6e0 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts @@ -70,8 +70,8 @@ export class RaphaelIconRestCallDirective extends RaphaelBase implements OnInit 0.349146,0.04476 l 3.437744,-2.005351 q 0.125335,-0.08953 0.143239,-0.232763 l 0.17905,-3.392986 q 1.02058,-0.859435 1.745729,-1.575629 1.67411,-1.6830612 2.309735,-3.2049805 0.635625,-1.5219191 0.635625,-3.8585111 0,-0.1253369 -0.08505,-0.2148575 -0.08505,-0.089526 -0.201431,-0.089526 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-script.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-script.component.ts index 66af5f8f020..1b20e771e9d 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-script.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-script.component.ts @@ -55,16 +55,15 @@ export class RaphaelIconScriptDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`m 5,2 0,0.094 c 0.23706,0.064 0.53189,0.1645 0.8125,0.375 0.5582,0.4186 1.05109,1.228 1.15625,2.5312 l 8.03125,0 1,0 1,0 c 0,-3 -2,-3 -2,-3 l -10,0 z M 4,3 4,13 2,13 c 0,3 2,3 2,3 l 9,0 c 0,0 2,0 2,-3 L 15,6 6,6 6,5.5 C 6,4.1111 5.5595,3.529 5.1875,3.25 4.8155,2.971 4.5,3 4.5,3 L 4,3 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-send.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-send.component.ts index 2ab0dea3166..32e30c18e8c 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-send.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-send.component.ts @@ -55,15 +55,14 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 L 17 15 L 12 10 L 9 13 L 6 10 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-service.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-service.component.ts index 1e1097ed03f..6f2b020e217 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-service.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-service.component.ts @@ -55,11 +55,10 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path('M 8,1 7.5,2.875 c 0,0 -0.02438,0.250763 -0.40625,0.4375 C 7.05724,3.330353 7.04387,3.358818 7,3.375' + ' 6.6676654,3.4929791 6.3336971,3.6092802 6.03125,3.78125 6.02349,3.78566 6.007733,3.77681 6,3.78125 5.8811373,3.761018' + ' 5.8125,3.71875 5.8125,3.71875 l -1.6875,-1 -1.40625,1.4375 0.96875,1.65625 c 0,0 0.065705,0.068637 0.09375,0.1875' + @@ -78,9 +77,9 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { ' 11.405359,3.5035185 11.198648,3.4455201 11,3.375 10.95613,3.3588185 10.942759,3.3303534 10.90625,3.3125 10.524382,3.125763' + ' 10.5,2.875 10.5,2.875 L 10,1 8,1 z m 1,5 c 1.656854,0 3,1.3431458 3,3 0,1.656854 -1.343146,3 -3,3 C 7.3431458,12' + ' 6,10.656854 6,9 6,7.3431458 7.3431458,6 9,6 z').attr({ - 'opacity': 1, - 'stroke': this.stroke, - 'fill': this.fillColors + opacity: 1, + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-signal.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-signal.component.ts index 0867ccaaf4f..df6c1c0be7f 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-signal.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-signal.component.ts @@ -61,10 +61,10 @@ export class RaphaelIconSignalDirective extends RaphaelBase implements OnInit { public draw(position: Point) { const path1 = this.paper.path(`M 8.7124971,21.247342 L 23.333334,21.247342 L 16.022915,8.5759512 L 8.7124971,21.247342 z`).attr({ - 'opacity': this.fillOpacity, - 'stroke': this.stroke, - 'strokeWidth': this.strokeWidth, - 'fill': this.fillColors + opacity: this.fillOpacity, + stroke: this.stroke, + strokeWidth: this.strokeWidth, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-timer.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-timer.component.ts index f9294721f44..95fe3d1b59a 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-timer.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-timer.component.ts @@ -55,11 +55,10 @@ export class RaphaelIconTimerDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`M 10 0 C 4.4771525 0 0 4.4771525 0 10 C 0 15.522847 4.4771525 20 10 20 C 15.522847 20 20 15.522847 20 10 C 20 4.4771525 15.522847 1.1842379e-15 10 0 z M 9.09375 1.03125 C 9.2292164 1.0174926 9.362825 1.0389311 9.5 1.03125 L 9.5 3.5 L 10.5 3.5 L 10.5 1.03125 C 15.063526 1.2867831 18.713217 4.9364738 18.96875 9.5 L 16.5 9.5 L 16.5 10.5 L 18.96875 10.5 C 18.713217 @@ -67,8 +66,8 @@ export class RaphaelIconTimerDirective extends RaphaelBase implements OnInit { 10.5 L 3.5 10.5 L 3.5 9.5 L 1.03125 9.5 C 1.279102 5.0736488 4.7225326 1.4751713 9.09375 1.03125 z M 9.5 5 L 9.5 8.0625 C 8.6373007 8.2844627 8 9.0680195 8 10 C 8 11.104569 8.8954305 12 10 12 C 10.931981 12 11.715537 11.362699 11.9375 10.5 L 14 10.5 L 14 9.5 L 11.9375 9.5 C 11.756642 8.7970599 11.20294 8.2433585 10.5 8.0625 L 10.5 5 L 9.5 5 z`).attr({ - 'stroke': this.stroke, - 'fill': this.fillColors + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-user.component.ts b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-user.component.ts index 99e62c26cab..faad0e5eec5 100644 --- a/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-user.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/icons/raphael-icon-user.component.ts @@ -55,17 +55,16 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { } ngOnInit() { - this.draw(this.position); } - public draw(position: Point) { + draw(position: Point) { const path1 = this.paper.path(`m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c 0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17`).attr({ - 'opacity': 1, - 'stroke': this.stroke, - 'fill': this.fillColors + opacity: 1, + stroke: this.stroke, + fill: this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/lib/insights/src/lib/diagram/components/raphael/polyline.ts b/lib/insights/src/lib/diagram/components/raphael/polyline.ts index ecc1d36f159..1274a910bf2 100644 --- a/lib/insights/src/lib/diagram/components/raphael/polyline.ts +++ b/lib/insights/src/lib/diagram/components/raphael/polyline.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Anchor } from './anchor'; +import { Anchor, ANCHOR_TYPE } from './anchor'; /* eslint-disable */ export class Polyline { @@ -70,14 +70,14 @@ export class Polyline { // create anchors - this.pushAnchor(Anchor.ANCHOR_TYPE.first, this.getLine(0).x1, this.getLine(0).y1); + this.pushAnchor(ANCHOR_TYPE.first, this.getLine(0).x1, this.getLine(0).y1); for (var i = 1; i < linesCount; i++) { var line1 = this.getLine(i - 1); - this.pushAnchor(Anchor.ANCHOR_TYPE.main, line1.x2, line1.y2); + this.pushAnchor(ANCHOR_TYPE.main, line1.x2, line1.y2); } - this.pushAnchor(Anchor.ANCHOR_TYPE.last, this.getLine(linesCount - 1).x2, this.getLine(linesCount - 1).y2); + this.pushAnchor(ANCHOR_TYPE.last, this.getLine(linesCount - 1).x2, this.getLine(linesCount - 1).y2); this.rebuildPath(); } @@ -149,9 +149,9 @@ export class Polyline { pushAnchor(type, x, y) { var index; - if (type === Anchor.ANCHOR_TYPE.first) { + if (type === ANCHOR_TYPE.first) { index = 0; - } else if (type === Anchor.ANCHOR_TYPE.last) { + } else if (type === ANCHOR_TYPE.last) { index = this.getAnchorsCount(); } else if (!index) { index = this.anchors.length; @@ -165,7 +165,7 @@ export class Polyline { } } - var anchor: any = new Anchor(this.id, Anchor.ANCHOR_TYPE.main, x, y); + var anchor: any = new Anchor(this.id, ANCHOR_TYPE.main, x, y); this.anchors.push(anchor); } @@ -175,10 +175,10 @@ export class Polyline { } getAnchorByType(type, position) { - if (type === Anchor.ANCHOR_TYPE.first) { + if (type === ANCHOR_TYPE.first) { return this.anchors[0]; } - if (type === Anchor.ANCHOR_TYPE.last) { + if (type === ANCHOR_TYPE.last) { return this.anchors[this.getAnchorsCount() - 1]; } for (var i = 0; i < this.getAnchorsCount(); i++) { diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-circle.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-circle.component.ts index 9b0949f539c..8fefb1de9f6 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-circle.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-circle.component.ts @@ -58,13 +58,17 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { } ngOnInit() { - - const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = { + 'stroke-width': this.strokeWidth, + fill: this.fillColors, + stroke: this.stroke, + 'fill-opacity': this.fillOpacity + }; const drawElement = this.draw(this.center, this.radius, opts); drawElement.node.id = this.elementId; } - public draw(center: Point, radius: number, opts: any) { + draw(center: Point, radius: number, opts: any) { const circle = this.paper.circle(center.x, center.y, radius).attr(opts); return circle; } diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-cross.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-cross.component.ts index 83b70c2b840..a23d099f9df 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-cross.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-cross.component.ts @@ -55,12 +55,16 @@ export class RaphaelCrossDirective extends RaphaelBase implements OnInit { } ngOnInit() { - - const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = { + 'stroke-width': this.strokeWidth, + fill: this.fillColors, + stroke: this.stroke, + 'fill-opacity': this.fillOpacity + }; this.draw(this.center, this.width, this.height, opts); } - public draw(center: Point, width: number, height: number, opts?: any) { + draw(center: Point, width: number, height: number, opts?: any) { const quarterWidth = width / 4; const quarterHeight = height / 4; diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-flow-arrow.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-flow-arrow.component.ts index 2f45942a617..3b42a700505 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-flow-arrow.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-flow-arrow.component.ts @@ -20,8 +20,12 @@ import { Polyline } from './polyline'; import { RaphaelBase } from './raphael-base'; import { RaphaelService } from './raphael.service'; +// eslint-disable-next-line @typescript-eslint/naming-convention declare let Raphael: any; +const ARROW_WIDTH = 4; +const SEQUENCE_FLOW_STROKE = 1.5; + /** * Directive selectors without adf- prefix will be deprecated on 3.0.0 */ @@ -36,29 +40,25 @@ export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { @Output() error = new EventEmitter(); - ARROW_WIDTH = 4; - SEQUENCE_FLOW_STROKE = 1.5; - constructor(public elementRef: ElementRef, raphaelService: RaphaelService) { super(elementRef, raphaelService); } ngOnInit() { - this.draw(this.flow); } - public draw(flow: any) { + draw(flow: any) { const line = this.drawLine(flow); this.drawArrow(line); } - public drawLine(flow: any) { - const polyline = new Polyline(flow.id, flow.waypoints, this.SEQUENCE_FLOW_STROKE, this.paper); + drawLine(flow: any) { + const polyline = new Polyline(flow.id, flow.waypoints, SEQUENCE_FLOW_STROKE, this.paper); polyline.element = this.paper.path(polyline.path); - polyline.element.attr({'stroke-width': this.SEQUENCE_FLOW_STROKE}); - polyline.element.attr({'stroke': '#585858'}); + polyline.element.attr({'stroke-width': SEQUENCE_FLOW_STROKE}); + polyline.element.attr({stroke: '#585858'}); polyline.element.node.id = this.flow.id; @@ -67,9 +67,9 @@ export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { return line; } - public drawArrow(line: any) { - const doubleArrowWidth = 2 * this.ARROW_WIDTH; - const width = this.ARROW_WIDTH / 2 + .5; + drawArrow(line: any) { + const doubleArrowWidth = 2 * ARROW_WIDTH; + const width = ARROW_WIDTH / 2 + .5; const arrowHead: any = this.paper.path('M0 0L-' + width + '-' + doubleArrowWidth + 'L' + width + ' -' + doubleArrowWidth + 'z'); arrowHead.transform('t' + line.x2 + ',' + line.y2); @@ -78,8 +78,7 @@ export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { arrowHead.attr('fill', '#585858'); - arrowHead.attr('stroke-width', this.SEQUENCE_FLOW_STROKE); + arrowHead.attr('stroke-width', SEQUENCE_FLOW_STROKE); arrowHead.attr('stroke', '#585858'); - } } diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-multiline-text.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-multiline-text.component.ts index bc7adf08f5a..47221a50c06 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-multiline-text.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-multiline-text.component.ts @@ -20,6 +20,8 @@ import { Point } from './models/point'; import { RaphaelBase } from './raphael-base'; import { RaphaelService } from './raphael.service'; +const TEXT_PADDING = 3; + /** * Directive selectors without adf- prefix will be deprecated on 3.0.0 */ @@ -43,8 +45,6 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit @Output() error = new EventEmitter(); - TEXT_PADDING = 3; - constructor(public elementRef: ElementRef, raphaelService: RaphaelService) { super(elementRef, raphaelService); @@ -58,16 +58,16 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit } draw(position: Point, text: string) { - const textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({ + const textPaper = this.paper.text(position.x + TEXT_PADDING, position.y + TEXT_PADDING, text).attr({ 'text-anchor': 'middle', 'font-family': 'Arial', 'font-size': '11', - 'fill': '#373e48' + fill: '#373e48' }); const formattedText = this.formatText(textPaper, text, this.elementWidth); textPaper.attr({ - 'text': formattedText + text: formattedText }); textPaper.transform(this.transform); return textPaper; @@ -76,7 +76,7 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit private formatText(textPaper, text, elementWidth) { const pText = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; textPaper.attr({ - 'text': pText + text: pText }); const letterWidth = textPaper.getBBox().width / text.length; const removedLineBreaks = text.split('\n'); diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-pentagon.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-pentagon.component.ts index 4a2ce95f16c..b976013a5e6 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-pentagon.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-pentagon.component.ts @@ -52,18 +52,17 @@ export class RaphaelPentagonDirective extends RaphaelBase implements OnInit { } ngOnInit() { - const opts = { 'stroke-width': this.strokeWidth, - 'fill': this.fillColors, - 'stroke': this.stroke, + fill: this.fillColors, + stroke: this.stroke, 'fill-opacity': this.fillOpacity, 'stroke-linejoin': 'bevel' }; this.draw(this.center, opts); } - public draw(center: Point, opts?: any) { + draw(center: Point, opts?: any) { const shape = this.paper.path('M 20.327514,22.344972 L 11.259248,22.344216 L 8.4577203,13.719549' + ' L 15.794545,8.389969 L 23.130481,13.720774 L 20.327514,22.344972 z').attr(opts); shape.transform('T' + (center.x + 4) + ',' + (center.y + 4)); diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-plus.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-plus.component.ts index 8569f3a49c7..81b291b9d3f 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-plus.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-plus.component.ts @@ -49,11 +49,16 @@ export class RaphaelPlusDirective extends RaphaelBase implements OnInit { } ngOnInit() { - const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = { + 'stroke-width': this.strokeWidth, + fill: this.fillColors, + stroke: this.stroke, + 'fill-opacity': this.fillOpacity + }; this.draw(this.center, opts); } - public draw(center: Point, opts?: any) { + draw(center: Point, opts?: any) { const path = this.paper.path('M 6.75,16 L 25.75,16 M 16,6.75 L 16,25.75').attr(opts); return path.transform('T' + (center.x + 4) + ',' + (center.y + 4)); } diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-rect.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-rect.component.ts index f49676bfb06..b67e497bcac 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-rect.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-rect.component.ts @@ -64,18 +64,17 @@ export class RaphaelRectDirective extends RaphaelBase implements OnInit { } ngOnInit() { - const opts = { 'stroke-width': this.strokeWidth, - 'fill': this.fillColors, - 'stroke': this.stroke, + fill: this.fillColors, + stroke: this.stroke, 'fill-opacity': this.fillOpacity }; const elementDraw = this.draw(this.leftCorner, this.width, this.height, this.radius, opts); elementDraw.node.id = this.elementId; } - public draw(leftCorner: Point, width: number, height: number, radius: number, opts: any) { + draw(leftCorner: Point, width: number, height: number, radius: number, opts: any) { return this.paper.rect(leftCorner.x, leftCorner.y, width, height, radius).attr(opts); } } diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-rhombus.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-rhombus.component.ts index 51582e92085..00f42a01902 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-rhombus.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-rhombus.component.ts @@ -58,13 +58,17 @@ export class RaphaelRhombusDirective extends RaphaelBase implements OnInit { } ngOnInit() { - - const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = { + 'stroke-width': this.strokeWidth, + fill: this.fillColors, + stroke: this.stroke, + 'fill-opacity': this.fillOpacity + }; const elementDraw = this.draw(this.center, this.width, this.height, opts); elementDraw.node.id = this.elementId; } - public draw(center: Point, width: number, height: number, opts?: any) { + draw(center: Point, width: number, height: number, opts?: any) { return this.paper.path('M' + center.x + ' ' + (center.y + (height / 2)) + 'L' + (center.x + (width / 2)) + ' ' + (center.y + height) + 'L' + (center.x + width) + ' ' + (center.y + (height / 2)) + diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael-text.component.ts b/lib/insights/src/lib/diagram/components/raphael/raphael-text.component.ts index ef707480cb1..35dd2f3f2eb 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael-text.component.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael-text.component.ts @@ -58,7 +58,7 @@ export class RaphaelTextDirective extends RaphaelBase implements OnInit { 'text-anchor' : 'middle', 'font-family' : 'Arial', 'font-size' : '11', - 'fill' : '#373e48' + fill : '#373e48' }); textPaper.transform(this.transform); diff --git a/lib/insights/src/lib/diagram/components/raphael/raphael.service.ts b/lib/insights/src/lib/diagram/components/raphael/raphael.service.ts index cf4e263b69b..d76354678e0 100644 --- a/lib/insights/src/lib/diagram/components/raphael/raphael.service.ts +++ b/lib/insights/src/lib/diagram/components/raphael/raphael.service.ts @@ -17,20 +17,17 @@ import { Injectable , OnDestroy } from '@angular/core'; +// eslint-disable-next-line @typescript-eslint/naming-convention declare let Raphael: any; @Injectable({ providedIn: 'root' }) export class RaphaelService implements OnDestroy { - paper: any; width: number = 300; height: number = 400; private ctx: any; - constructor() { - } - - public getInstance(element: any): any { + getInstance(element: any): any { if (!this.paper) { this.ctx = element.nativeElement; this.refresh(); @@ -38,12 +35,7 @@ export class RaphaelService implements OnDestroy { return this.paper; } - private refresh(): any { - this.ngOnDestroy(); - this.paper = this.getPaperBuilder(this.ctx); - } - - public getPaperBuilder(ctx: any): any { + getPaperBuilder(ctx: any): any { if (typeof Raphael === 'undefined') { throw new Error('insights configuration issue: Embedding Chart.js lib is mandatory'); } @@ -51,19 +43,24 @@ export class RaphaelService implements OnDestroy { return paper; } - public ngOnDestroy(): any { + ngOnDestroy(): any { if (this.paper) { this.paper.clear(); this.paper = void 0; } } - public setting(width: number, height: number): void { + setting(width: number, height: number): void { this.width = width; this.height = height; } - public reset(): any { + reset(): any { + this.ngOnDestroy(); + } + + private refresh(): any { this.ngOnDestroy(); + this.paper = this.getPaperBuilder(this.ctx); } } diff --git a/lib/insights/src/lib/diagram/components/structural/diagram-event-subprocess.component.ts b/lib/insights/src/lib/diagram/components/structural/diagram-event-subprocess.component.ts index c8c97d3bb5e..677b0b4de05 100644 --- a/lib/insights/src/lib/diagram/components/structural/diagram-event-subprocess.component.ts +++ b/lib/insights/src/lib/diagram/components/structural/diagram-event-subprocess.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -46,7 +47,7 @@ export class DiagramEventSubprocessComponent implements OnInit { this.height = this.data.height; this.options.fillColors = 'none'; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.strokeWidth = 1; } } diff --git a/lib/insights/src/lib/diagram/components/structural/diagram-subprocess.component.ts b/lib/insights/src/lib/diagram/components/structural/diagram-subprocess.component.ts index 16e4f9551a7..0454619e023 100644 --- a/lib/insights/src/lib/diagram/components/structural/diagram-subprocess.component.ts +++ b/lib/insights/src/lib/diagram/components/structural/diagram-subprocess.component.ts @@ -18,6 +18,7 @@ /* eslint-disable @angular-eslint/component-selector */ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { MAIN_STROKE_COLOR } from '../../constants/diagram-colors'; import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ @@ -46,7 +47,7 @@ export class DiagramSubprocessComponent implements OnInit { this.height = this.data.height; this.options.fillColors = 'none'; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, MAIN_STROKE_COLOR); this.options.strokeWidth = 1; } } diff --git a/lib/insights/src/lib/diagram/components/tooltip/diagram-tooltip.component.ts b/lib/insights/src/lib/diagram/components/tooltip/diagram-tooltip.component.ts index 4069dc220e9..883742a3717 100644 --- a/lib/insights/src/lib/diagram/components/tooltip/diagram-tooltip.component.ts +++ b/lib/insights/src/lib/diagram/components/tooltip/diagram-tooltip.component.ts @@ -18,8 +18,9 @@ /* eslint-disable @angular-eslint/component-selector */ import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core'; -const POSITION = { BOTTOM: 'bottom', LEFT: 'left', RIGHT: 'right', TOP: 'top' }; -const STRATEGY = { CURSOR: 'cursor', ELEMENT: 'element' }; + +const POSITION = { bottom: 'bottom', left: 'left', right: 'right', top: 'top' }; +const STRATEGY = { cursor: 'cursor', element: 'element' }; const IS_ACTIVE_CLASS = 'adf-is-active'; @Component({ @@ -28,27 +29,27 @@ const IS_ACTIVE_CLASS = 'adf-is-active'; styleUrls: ['./diagram-tooltip.component.scss'] }) export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { - - private tooltipElement: any; - private targetElement: any; - private boundMouseEnterHandler: EventListenerObject; - private boundMouseLeaveAndScrollHandler: EventListenerObject; - - @ViewChild('tooltipContent', { static: true }) tooltipContent: ElementRef; + @ViewChild('tooltipContent', { static: true }) + tooltipContent: ElementRef; @Input() data: any; @Input() - position: string = 'bottom'; + position = POSITION.bottom; @Input() - strategy: string = 'cursor'; + strategy = STRATEGY.cursor; + + private tooltipElement: any; + private targetElement: any; + private boundMouseEnterHandler: EventListenerObject; + private boundMouseLeaveAndScrollHandler: EventListenerObject; /** * Set up event listeners for the target element (defined in the data.id) */ - public ngAfterViewInit() { + ngAfterViewInit() { this.tooltipElement = this.tooltipContent.nativeElement; if (this.data.id) { @@ -100,7 +101,7 @@ export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { private handleMouseEnter(event): void { let props; - if (this.strategy === STRATEGY.ELEMENT) { + if (this.strategy === STRATEGY.element) { props = event.target.getBoundingClientRect(); } else { props = { top: (event.pageY - 150), left: event.pageX, width: event.layerX, height: 50 }; @@ -111,7 +112,7 @@ export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { const marginTop = -1 * (this.tooltipElement.offsetHeight / 2); let left = props.left + (props.width / 2); - if (this.position === POSITION.LEFT || this.position === POSITION.RIGHT) { + if (this.position === POSITION.left || this.position === POSITION.right) { left = (props.width / 2); if (top + marginTop < 0) { this.tooltipElement.style.top = '0'; @@ -130,11 +131,11 @@ export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { } } - if (this.position === POSITION.TOP) { + if (this.position === POSITION.top) { this.tooltipElement.style.top = props.top - this.tooltipElement.offsetHeight - 10 + 'px'; - } else if (this.position === POSITION.RIGHT) { + } else if (this.position === POSITION.right) { this.tooltipElement.style.left = props.left + props.width + 10 + 'px'; - } else if (this.position === POSITION.LEFT) { + } else if (this.position === POSITION.left) { this.tooltipElement.style.left = props.left - this.tooltipElement.offsetWidth - 10 + 'px'; } else { this.tooltipElement.style.top = props.top + props.height + 10 + 'px'; diff --git a/lib/insights/src/lib/diagram/constants/diagram-colors.ts b/lib/insights/src/lib/diagram/constants/diagram-colors.ts new file mode 100644 index 00000000000..ce15fe80a5a --- /dev/null +++ b/lib/insights/src/lib/diagram/constants/diagram-colors.ts @@ -0,0 +1,22 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const CURRENT_COLOR = '#017501'; +export const COMPLETED_COLOR = '#2632aa'; +export const ACTIVITY_STROKE_COLOR = '#bbbbbb'; +export const ACTIVITY_FILL_COLOR = '#f9f9f9'; +export const MAIN_STROKE_COLOR = '#585858'; diff --git a/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts b/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts index 76fbe1f855a..3fcc4dab245 100644 --- a/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts +++ b/lib/insights/src/lib/diagram/models/chart/bar-chart.model.ts @@ -65,8 +65,8 @@ export class BarChart extends Chart { } } - xAxisTickFormatFunction = function (xAxisType) { - return function (value) { + xAxisTickFormatFunction(xAxisType) { + return (value) => { if (xAxisType !== null && xAxisType !== undefined) { if ('date_day' === xAxisType) { return moment(new Date(value)).format('DD'); @@ -80,8 +80,8 @@ export class BarChart extends Chart { }; }; - yAxisTickFormatFunction = function (yAxisType) { - return function (value) { + yAxisTickFormatFunction(yAxisType) { + return (value) => { if (yAxisType !== null && yAxisType !== undefined) { if ('count' === yAxisType) { const label = '' + value; diff --git a/lib/insights/src/lib/diagram/models/chart/chart.model.ts b/lib/insights/src/lib/diagram/models/chart/chart.model.ts index 5d3c86145a7..352ec6c8d9a 100644 --- a/lib/insights/src/lib/diagram/models/chart/chart.model.ts +++ b/lib/insights/src/lib/diagram/models/chart/chart.model.ts @@ -45,6 +45,34 @@ export class Chart { } } + hasData(): boolean { + return this.data && this.data.length > 0; + } + + hasDatasets(): boolean { + return this.datasets && this.datasets.length > 0; + } + + hasDetailsTable(): boolean { + return !!this.detailsTable; + } + + hasZeroValues(): boolean { + let isZeroValues = false; + + if (this.hasData()) { + isZeroValues = true; + + this.data.forEach((value) => { + if (value.toString() !== '0') { + isZeroValues = false; + } + }); + } + + return isZeroValues; + } + private convertType(type: string) { let chartType = ''; switch (type) { @@ -106,32 +134,4 @@ export class Chart { } return typeIcon; } - - hasData(): boolean { - return this.data && this.data.length > 0; - } - - hasDatasets(): boolean { - return this.datasets && this.datasets.length > 0; - } - - hasDetailsTable(): boolean { - return !!this.detailsTable; - } - - hasZeroValues(): boolean { - let isZeroValues = false; - - if (this.hasData()) { - isZeroValues = true; - - this.data.forEach((value) => { - if (value.toString() !== '0') { - isZeroValues = false; - } - }); - } - - return isZeroValues; - } } diff --git a/lib/insights/src/lib/diagram/models/report/parameter-value.model.ts b/lib/insights/src/lib/diagram/models/report/parameter-value.model.ts index ab2ad254a4e..3a6689714c0 100644 --- a/lib/insights/src/lib/diagram/models/report/parameter-value.model.ts +++ b/lib/insights/src/lib/diagram/models/report/parameter-value.model.ts @@ -28,7 +28,7 @@ export class ParameterValueModel { this.version = obj && obj.version || null; } - get label () { + get label() { return this.version ? `${this.name} (v ${this.version}) ` : this.name; } } diff --git a/lib/insights/src/lib/diagram/models/report/report-definition.model.ts b/lib/insights/src/lib/diagram/models/report/report-definition.model.ts index 1abf7b03b15..d63576b4b8d 100644 --- a/lib/insights/src/lib/diagram/models/report/report-definition.model.ts +++ b/lib/insights/src/lib/diagram/models/report/report-definition.model.ts @@ -28,9 +28,7 @@ export class ReportDefinitionModel { } findParam(name: string): ReportParameterDetailsModel { - this.parameters.forEach((param) => { - return param.type === name ? param : null; - }); + this.parameters.forEach((param) => param.type === name ? param : null); return null; } } diff --git a/lib/insights/src/lib/diagram/services/diagram-color.service.ts b/lib/insights/src/lib/diagram/services/diagram-color.service.ts index 0fbbd54527b..f7d666812e7 100644 --- a/lib/insights/src/lib/diagram/services/diagram-color.service.ts +++ b/lib/insights/src/lib/diagram/services/diagram-color.service.ts @@ -16,24 +16,16 @@ */ import { Injectable } from '@angular/core'; +import { ACTIVITY_FILL_COLOR, COMPLETED_COLOR, CURRENT_COLOR } from '../constants/diagram-colors'; + +const TASK_STROKE = 1; +const TASK_HIGHLIGHT_STROKE = 2; @Injectable({ providedIn: 'root' }) export class DiagramColorService { - - static CURRENT_COLOR = '#017501'; - static COMPLETED_COLOR = '#2632aa'; - static ACTIVITY_STROKE_COLOR = '#bbbbbb'; - static MAIN_STROKE_COLOR = '#585858'; - - static ACTIVITY_FILL_COLOR = '#f9f9f9'; - - static TASK_STROKE = 1; - static TASK_HIGHLIGHT_STROKE = 2; - static CALL_ACTIVITY_STROKE = 2; - totalColors: any; - setTotalColors(totalColors) { + setTotalColors(totalColors: any) { this.totalColors = totalColors; } @@ -46,25 +38,25 @@ export class DiagramColorService { const colorPercentage = this.totalColors[key]; return this.convertColorToHsb(colorPercentage); } else { - return DiagramColorService.ACTIVITY_FILL_COLOR; + return ACTIVITY_FILL_COLOR; } } - getBpmnColor(data, defaultColor) { + getBpmnColor(data: any, defaultColor: any) { if (data.current) { - return DiagramColorService.CURRENT_COLOR; + return CURRENT_COLOR; } else if (data.completed) { - return DiagramColorService.COMPLETED_COLOR; + return COMPLETED_COLOR; } else { return defaultColor; } } - getBpmnStrokeWidth(data) { + getBpmnStrokeWidth(data: any) { if (data.current || data.completed) { - return DiagramColorService.TASK_HIGHLIGHT_STROKE; + return TASK_HIGHLIGHT_STROKE; } else { - return DiagramColorService.TASK_STROKE; + return TASK_STROKE; } } diff --git a/lib/insights/src/lib/mock/analytics/analytics-component.mock.ts b/lib/insights/src/lib/mock/analytics/analytics-component.mock.ts index b48ee2db521..8e0fc24b5bc 100644 --- a/lib/insights/src/lib/mock/analytics/analytics-component.mock.ts +++ b/lib/insights/src/lib/mock/analytics/analytics-component.mock.ts @@ -15,46 +15,46 @@ * limitations under the License. */ -export let chartProcessDefOverview = { - 'elements': [{ - 'id': 'id1585876275153', - 'type': 'table', - 'rows': [ +export const chartProcessDefOverview = { + elements: [{ + id: 'id1585876275153', + type: 'table', + rows: [ ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS', '9'], ['__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES', '41'], ['__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', - 'titleKey': 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE', - 'values': [{ - 'key': 'Second Process', - 'y': 4, - 'keyAndValue': ['Second Process', '4'] + id: 'id1585876413072', + type: 'pieChart', + title: 'Total process instances overview', + titleKey: 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.PROC-INST-CHART-TITLE', + values: [{ + key: 'Second Process', + y: 4, + keyAndValue: ['Second Process', '4'] }, { - 'key': 'Simple process', - 'y': 30, - 'keyAndValue': ['Simple process', '30'] + key: 'Simple process', + y: 30, + keyAndValue: ['Simple process', '30'] }, { - 'key': 'Third Process', - 'y': 7, - 'keyAndValue': ['Third Process', '7'] + key: 'Third Process', + y: 7, + keyAndValue: ['Third Process', '7'] }] }, { - 'id': 'id1585877659181', - 'type': 'table', - 'title': 'Process definition details', - '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', + id: 'id1585877659181', + type: 'table', + title: 'Process definition details', + 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', 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-COMPLETED'], - 'columnsCentered': [false, false, false, false], - 'rows': [ + columnsCentered: [false, false, false, false], + rows: [ ['Second Process', '4', '0', '4'], ['Simple process', '30', '3', '27'], ['Third Process', '7', '0', '7'] @@ -62,26 +62,26 @@ export let chartProcessDefOverview = { }] }; -export let chartTaskOverview = { - 'elements': [{ - 'id': 'id792351752194', - 'type': 'barChart', - 'title': 'title', - 'titleKey': 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-HISTOGRAM-TITLE', - 'values': [{ - 'key': 'series1', - 'values': [['2016-09-30T00:00:00.000+0000', 3], ['2016-10-04T00:00:00.000+0000', 1]] +export const chartTaskOverview = { + elements: [{ + id: 'id792351752194', + type: 'barChart', + title: 'title', + titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-HISTOGRAM-TITLE', + values: [{ + key: 'series1', + values: [['2016-09-30T00:00:00.000+0000', 3], ['2016-10-04T00:00:00.000+0000', 1]] }], - 'xAxisType': 'date_month', - 'yAxisType': 'count' + xAxisType: 'date_month', + yAxisType: 'count' }, { - 'id': 'id792349721129', - 'type': 'masterDetailTable', - 'title': 'Detailed task statistics', - 'titleKey': 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TITLE', + id: 'id792349721129', + type: 'masterDetailTable', + title: 'Detailed task statistics', + titleKey: 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TITLE', /* cspell:disable-next-line */ - 'columnNames': ['Task', 'Count', 'Sum', 'Min duration', 'Max duration', 'Average duration', 'Stddev duration'], - 'columnNameKeys': [ + columnNames: ['Task', 'Count', 'Sum', 'Min duration', 'Max duration', 'Average duration', 'Stddev duration'], + columnNameKeys: [ 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TASK', 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.COUNT', 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.SUM', @@ -90,26 +90,26 @@ export let chartTaskOverview = { 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.AVERAGE', /* cspell:disable-next-line */ 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.STDDE'], - 'columnsCentered': [false, false, false, false], - 'rows': [ + columnsCentered: [false, false, false, false], + rows: [ ['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'] ] }, { - 'id': 'id10931125229538', - 'type': 'multiBarChart', - 'title': 'Task duration', - 'titleKey': 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.TASK-DURATIONS-TITLE', - 'values': [{ - 'key': 'averages', - 'values': [[1, 0], [2, 5], [3, 2]] + id: 'id10931125229538', + type: 'multiBarChart', + title: 'Task duration', + 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: 'minima', + values: [[1, 0], [2, 0], [3, 0]] }, { - 'key': 'maxima', - 'values': [[1, 0], [2, 29], [3, 29]] + key: 'maxima', + values: [[1, 0], [2, 29], [3, 29]] }], - 'yAxisType': 'count' + yAxisType: 'count' }] }; diff --git a/lib/insights/src/lib/mock/analytics/analytics-params-report-component.mock.ts b/lib/insights/src/lib/mock/analytics/analytics-params-report-component.mock.ts index 8d96c6c09bc..bacb379e05e 100644 --- a/lib/insights/src/lib/mock/analytics/analytics-params-report-component.mock.ts +++ b/lib/insights/src/lib/mock/analytics/analytics-params-report-component.mock.ts @@ -17,138 +17,138 @@ import { ReportParameterDetailsModel } from '../../diagram/models/report/report-parameter-details.model'; -export let reportDefParamStatus = { - 'id': 2005, - 'name': 'Fake Task overview status', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" :[{"id":"status","name":null,"nameKey":null,"type":"status","value":null,"dependsOn":null}]}' +export const reportDefParamStatus = { + id: 2005, + name: 'Fake Task overview status', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" :[{"id":"status","name":null,"nameKey":null,"type":"status","value":null,"dependsOn":null}]}' }; -export let reportDefParamNumber = { - 'id': 2005, - 'name': 'Fake Process instances overview', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters"' + +export const reportDefParamNumber = { + id: 2005, + name: 'Fake Process instances overview', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters"' + ' :[{"id":"slowProcessInstanceInteger","name":null,"nameKey":null,"type":"integer","value":10,"dependsOn":null}]}' }; -export let reportDefParamDuration = { - 'id': 2005, - 'name': 'Fake Task service level agreement', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters"' + +export const reportDefParamDuration = { + id: 2005, + name: 'Fake Task service level agreement', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters"' + ' :[{"id":"duration","name":null,"nameKey":null,"type":"duration","value":null,"dependsOn":null}]}' }; -export let reportDefParamCheck = { - 'id': 2005, - 'name': 'Fake Task service level agreement', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters"' + +export const reportDefParamCheck = { + id: 2005, + name: 'Fake Task service level agreement', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters"' + ' :[{"id":"typeFiltering","name":null,"nameKey":null,"type":"boolean","value":true,"dependsOn":null}]}' }; -export let reportDefParamDateRange = { - 'id': 2005, - 'name': 'Fake Process instances overview', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" :[{"id":"dateRange","name":null,"nameKey":null,"type":"dateRange","value":null,"dependsOn":null}]}' +export const reportDefParamDateRange = { + id: 2005, + name: 'Fake Process instances overview', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" :[{"id":"dateRange","name":null,"nameKey":null,"type":"dateRange","value":null,"dependsOn":null}]}' }; -export let reportDefParamRangeInterval = { - 'id': 2006, - 'name': 'Fake Task overview RangeInterval', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" :[{"id":"dateRangeInterval","name":null,"nameKey":null,"type":"dateInterval","value":null,"dependsOn":null}]}' +export const reportDefParamRangeInterval = { + id: 2006, + name: 'Fake Task overview RangeInterval', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" :[{"id":"dateRangeInterval","name":null,"nameKey":null,"type":"dateInterval","value":null,"dependsOn":null}]}' }; -export let reportDefParamProcessDef = { - 'id': 2006, - 'name': 'Fake Task overview ProcessDefinition', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" :[{"id":"processDefinitionId","name":null,"nameKey":null,"type":"processDefinition","value":null,"dependsOn":null}]}' +export const reportDefParamProcessDef = { + id: 2006, + name: 'Fake Task overview ProcessDefinition', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" :[{"id":"processDefinitionId","name":null,"nameKey":null,"type":"processDefinition","value":null,"dependsOn":null}]}' }; -export let reportDefParamProcessDefOptionsNoApp = [ +export const reportDefParamProcessDefOptionsNoApp = [ { - 'id': 'FakeProcessTest 1:1:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 1 + id: 'FakeProcessTest 1:1:1', + name: 'Fake Process Test 1 Name ', + version: 1 }, { - 'id': 'FakeProcessTest 1:2:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 2 + id: 'FakeProcessTest 1:2:1', + name: 'Fake Process Test 1 Name ', + version: 2 }, { - 'id': 'FakeProcessTest 2:1:1', - 'name': 'Fake Process Test 2 Name ', - 'version': 1 + id: 'FakeProcessTest 2:1:1', + name: 'Fake Process Test 2 Name ', + version: 1 }, { - 'id': 'FakeProcessTest 3:1:1', - 'name': 'Fake Process Test 3 Name ', - 'version': 1 + id: 'FakeProcessTest 3:1:1', + name: 'Fake Process Test 3 Name ', + version: 1 } ]; -export let reportDefParamProcessDefOptions = { - 'size': 4, 'total': 4, 'start': 0, 'data': [ +export const reportDefParamProcessDefOptions = { + size: 4, total: 4, start: 0, data: [ { - 'id': 'FakeProcessTest 1:1:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 1 + id: 'FakeProcessTest 1:1:1', + name: 'Fake Process Test 1 Name ', + version: 1 }, { - 'id': 'FakeProcessTest 1:2:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 2 + id: 'FakeProcessTest 1:2:1', + name: 'Fake Process Test 1 Name ', + version: 2 }, { - 'id': 'FakeProcessTest 2:1:1', - 'name': 'Fake Process Test 2 Name ', - 'version': 1 + id: 'FakeProcessTest 2:1:1', + name: 'Fake Process Test 2 Name ', + version: 1 }, { - 'id': 'FakeProcessTest 3:1:1', - 'name': 'Fake Process Test 3 Name ', - 'version': 1 + id: 'FakeProcessTest 3:1:1', + name: 'Fake Process Test 3 Name ', + version: 1 } ] }; -export let reportDefParamProcessDefOptionsApp = { - 'size': 2, 'total': 2, 'start': 2, 'data': [ +export const reportDefParamProcessDefOptionsApp = { + size: 2, total: 2, start: 2, data: [ { - 'id': 'FakeProcessTest 1:1:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 1 + id: 'FakeProcessTest 1:1:1', + name: 'Fake Process Test 1 Name ', + version: 1 }, { - 'id': 'FakeProcessTest 1:2:1', - 'name': 'Fake Process Test 1 Name ', - 'version': 2 + id: 'FakeProcessTest 1:2:1', + name: 'Fake Process Test 1 Name ', + version: 2 } ] }; -export let reportDefParamTask = { - 'id': 2006, - 'name': 'Fake Task service level agreement', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" :[{"id":"taskName","name":null,"nameKey":null,"type":"task","value":null,"dependsOn":"processDefinitionId"}]}' +export const reportDefParamTask = { + id: 2006, + name: 'Fake Task service level agreement', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" :[{"id":"taskName","name":null,"nameKey":null,"type":"task","value":null,"dependsOn":"processDefinitionId"}]}' }; -export let reportNoParameterDefinitions = { - 'id': 2006, - 'name': 'Fake Task service level agreement', - 'created': '2016-10-05T15:39:40.222+0000', - 'definition': '{ "parameters" : []}' +export const reportNoParameterDefinitions = { + id: 2006, + name: 'Fake Task service level agreement', + created: '2016-10-05T15:39:40.222+0000', + definition: '{ "parameters" : []}' }; -export let reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2']; +export const reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2']; -export let fieldProcessDef = new ReportParameterDetailsModel( +export const fieldProcessDef = new ReportParameterDetailsModel( { id: 'processDefinitionId', type: 'processDefinition', diff --git a/lib/insights/src/lib/mock/analytics/analytics.service.mock.ts b/lib/insights/src/lib/mock/analytics/analytics.service.mock.ts index 252f47aca0e..845b2a27b61 100644 --- a/lib/insights/src/lib/mock/analytics/analytics.service.mock.ts +++ b/lib/insights/src/lib/mock/analytics/analytics.service.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let fakeReportList = [ +export const fakeReportList = [ { id: '1', name: 'Fake Report 1' diff --git a/lib/insights/src/lib/mock/diagram/diagram-activities.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-activities.mock.ts index 9ed3e44ecc6..5c643c5aff7 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-activities.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-activities.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let userTask = { +export const userTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake User task', type: 'UserTask', @@ -26,7 +26,7 @@ export let userTask = { properties: [{}] }; -export let userTaskActive = { +export const userTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -39,7 +39,7 @@ export let userTaskActive = { properties: [{}] }; -export let userTaskCompleted = { +export const userTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -52,7 +52,7 @@ export let userTaskCompleted = { properties: [{}] }; -export let manualTask = { +export const manualTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Manual task', type: 'ManualTask', @@ -63,7 +63,7 @@ export let manualTask = { properties: [{}] }; -export let manualTaskActive = { +export const manualTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -76,7 +76,7 @@ export let manualTaskActive = { properties: [{}] }; -export let manualTaskCompleted = { +export const manualTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -89,7 +89,7 @@ export let manualTaskCompleted = { properties: [{}] }; -export let serviceTask = { +export const serviceTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Service task', type: 'ServiceTask', @@ -100,7 +100,7 @@ export let serviceTask = { properties: [{}] }; -export let serviceTaskActive = { +export const serviceTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -113,7 +113,7 @@ export let serviceTaskActive = { properties: [{}] }; -export let serviceTaskCompleted = { +export const serviceTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -126,7 +126,7 @@ export let serviceTaskCompleted = { properties: [{}] }; -export let receiveTask = { +export const receiveTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Receive task', type: 'ReceiveTask', @@ -137,7 +137,7 @@ export let receiveTask = { properties: [{}] }; -export let receiveTaskActive = { +export const receiveTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -150,7 +150,7 @@ export let receiveTaskActive = { properties: [{}] }; -export let receiveTaskCompleted = { +export const receiveTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -163,7 +163,7 @@ export let receiveTaskCompleted = { properties: [{}] }; -export let scriptTask = { +export const scriptTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Script task', type: 'ScriptTask', @@ -174,7 +174,7 @@ export let scriptTask = { properties: [{}] }; -export let scriptTaskActive = { +export const scriptTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -187,7 +187,7 @@ export let scriptTaskActive = { properties: [{}] }; -export let scriptTaskCompleted = { +export const scriptTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -200,7 +200,7 @@ export let scriptTaskCompleted = { properties: [{}] }; -export let businessRuleTask = { +export const businessRuleTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake BusinessRule task', type: 'BusinessRuleTask', @@ -211,7 +211,7 @@ export let businessRuleTask = { properties: [{}] }; -export let businessRuleTaskActive = { +export const businessRuleTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -224,7 +224,7 @@ export let businessRuleTaskActive = { properties: [{}] }; -export let businessRuleTaskCompleted = { +export const businessRuleTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -237,7 +237,7 @@ export let businessRuleTaskCompleted = { properties: [{}] }; -export let mailTask = { +export const mailTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Mail task', type: 'ServiceTask', @@ -249,7 +249,7 @@ export let mailTask = { taskType: 'mail' }; -export let mailTaskActive = { +export const mailTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -263,7 +263,7 @@ export let mailTaskActive = { taskType: 'mail' }; -export let mailTaskCompleted = { +export const mailTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -277,7 +277,7 @@ export let mailTaskCompleted = { taskType: 'mail' }; -export let camelTask = { +export const camelTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Camel task', type: 'ServiceTask', @@ -289,7 +289,7 @@ export let camelTask = { taskType: 'camel' }; -export let camelTaskActive = { +export const camelTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -303,7 +303,7 @@ export let camelTaskActive = { taskType: 'camel' }; -export let camelTaskCompleted = { +export const camelTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -317,7 +317,7 @@ export let camelTaskCompleted = { taskType: 'camel' }; -export let restCallTask = { +export const restCallTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Rest Call task', type: 'ServiceTask', @@ -329,7 +329,7 @@ export let restCallTask = { taskType: 'rest_call' }; -export let restCallTaskActive = { +export const restCallTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -343,7 +343,7 @@ export let restCallTaskActive = { taskType: 'rest_call' }; -export let restCallTaskCompleted = { +export const restCallTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -357,7 +357,7 @@ export let restCallTaskCompleted = { taskType: 'rest_call' }; -export let muleTask = { +export const muleTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Mule task', type: 'ServiceTask', @@ -369,7 +369,7 @@ export let muleTask = { taskType: 'mule' }; -export let muleTaskActive = { +export const muleTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -383,7 +383,7 @@ export let muleTaskActive = { taskType: 'mule' }; -export let muleTaskCompleted = { +export const muleTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -397,7 +397,7 @@ export let muleTaskCompleted = { taskType: 'mule' }; -export let alfrescoPublishTask = { +export const alfrescoPublishTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Alfresco Publish task', type: 'ServiceTask', @@ -409,7 +409,7 @@ export let alfrescoPublishTask = { taskType: 'alfresco_publish' }; -export let alfrescoPublishTaskActive = { +export const alfrescoPublishTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -423,7 +423,7 @@ export let alfrescoPublishTaskActive = { taskType: 'alfresco_publish' }; -export let alfrescoPublishTaskCompleted = { +export const alfrescoPublishTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -437,7 +437,7 @@ export let alfrescoPublishTaskCompleted = { taskType: 'alfresco_publish' }; -export let googleDrivePublishTask = { +export const googleDrivePublishTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Google Drive Publish task', type: 'ServiceTask', @@ -449,7 +449,7 @@ export let googleDrivePublishTask = { taskType: 'google_drive_publish' }; -export let googleDrivePublishTaskActive = { +export const googleDrivePublishTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -463,7 +463,7 @@ export let googleDrivePublishTaskActive = { taskType: 'google_drive_publish' }; -export let googleDrivePublishTaskCompleted = { +export const googleDrivePublishTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -477,7 +477,7 @@ export let googleDrivePublishTaskCompleted = { taskType: 'google_drive_publish' }; -export let boxPublishTask = { +export const boxPublishTask = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', name: 'Fake Box Publish task', type: 'ServiceTask', @@ -489,7 +489,7 @@ export let boxPublishTask = { taskType: 'box_publish' }; -export let boxPublishTaskActive = { +export const boxPublishTaskActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -503,7 +503,7 @@ export let boxPublishTaskActive = { taskType: 'box_publish' }; -export let boxPublishTaskCompleted = { +export const boxPublishTaskCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', diff --git a/lib/insights/src/lib/mock/diagram/diagram-boundary.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-boundary.mock.ts index f1be20009a6..efd8d013131 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-boundary.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-boundary.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let boundaryTimeEvent = { +export const boundaryTimeEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'BoundaryEvent', width: 31, @@ -26,7 +26,7 @@ export let boundaryTimeEvent = { eventDefinition: {type: 'timer'} }; -export let boundaryTimeEventActive = { +export const boundaryTimeEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -39,7 +39,7 @@ export let boundaryTimeEventActive = { eventDefinition: {type: 'timer'} }; -export let boundaryTimeEventCompleted = { +export const boundaryTimeEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -52,7 +52,7 @@ export let boundaryTimeEventCompleted = { eventDefinition: {type: 'timer'} }; -export let boundaryErrorEvent = { +export const boundaryErrorEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'BoundaryEvent', width: 31, @@ -63,7 +63,7 @@ export let boundaryErrorEvent = { eventDefinition: {type: 'error'} }; -export let boundaryErrorEventActive = { +export const boundaryErrorEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -76,7 +76,7 @@ export let boundaryErrorEventActive = { eventDefinition: {type: 'error'} }; -export let boundaryErrorEventCompleted = { +export const boundaryErrorEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -89,7 +89,7 @@ export let boundaryErrorEventCompleted = { eventDefinition: {type: 'error'} }; -export let boundarySignalEvent = { +export const boundarySignalEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'BoundaryEvent', width: 31, @@ -100,7 +100,7 @@ export let boundarySignalEvent = { eventDefinition: {type: 'signal'} }; -export let boundarySignalEventActive = { +export const boundarySignalEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -113,7 +113,7 @@ export let boundarySignalEventActive = { eventDefinition: {type: 'signal'} }; -export let boundarySignalEventCompleted = { +export const boundarySignalEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -126,7 +126,7 @@ export let boundarySignalEventCompleted = { eventDefinition: {type: 'signal'} }; -export let boundaryMessageEvent = { +export const boundaryMessageEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'BoundaryEvent', width: 31, @@ -137,7 +137,7 @@ export let boundaryMessageEvent = { eventDefinition: {type: 'message'} }; -export let boundaryMessageEventActive = { +export const boundaryMessageEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -150,7 +150,7 @@ export let boundaryMessageEventActive = { eventDefinition: {type: 'message'} }; -export let boundaryMessageEventCompleted = { +export const boundaryMessageEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', diff --git a/lib/insights/src/lib/mock/diagram/diagram-events.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-events.mock.ts index 86b845a5b77..a33a14addc1 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-events.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-events.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let startEvent = { +export const startEvent = { id: 'startEvent1', type: 'StartEvent', width: 30, @@ -25,7 +25,7 @@ export let startEvent = { properties: [{}] }; -export let startEventActive = { +export const startEventActive = { completed: false, current: true, id: 'startEvent1', @@ -37,7 +37,7 @@ export let startEventActive = { properties: [{}] }; -export let startEventCompleted = { +export const startEventCompleted = { completed: true, current: false, id: 'startEvent1', @@ -49,7 +49,7 @@ export let startEventCompleted = { properties: [{}] }; -export let startTimeEvent = { +export const startTimeEvent = { id: 'startEvent1', type: 'StartEvent', width: 30, @@ -60,7 +60,7 @@ export let startTimeEvent = { properties: [{}] }; -export let startTimeEventActive = { +export const startTimeEventActive = { completed: false, current: true, id: 'startEvent1', @@ -73,7 +73,7 @@ export let startTimeEventActive = { properties: [{}] }; -export let startTimeEventCompleted = { +export const startTimeEventCompleted = { completed: true, current: false, id: 'startEvent1', @@ -86,7 +86,7 @@ export let startTimeEventCompleted = { properties: [{}] }; -export let startSignalEvent = { +export const startSignalEvent = { id: 'startEvent1', type: 'StartEvent', width: 30, @@ -97,7 +97,7 @@ export let startSignalEvent = { properties: [{}] }; -export let startSignalEventActive = { +export const startSignalEventActive = { completed: false, current: true, id: 'startEvent1', @@ -110,7 +110,7 @@ export let startSignalEventActive = { properties: [{}] }; -export let startSignalEventCompleted = { +export const startSignalEventCompleted = { completed: true, current: false, id: 'startEvent1', @@ -123,7 +123,7 @@ export let startSignalEventCompleted = { properties: [{}] }; -export let startMessageEvent = { +export const startMessageEvent = { id: 'startEvent1', type: 'StartEvent', width: 30, @@ -134,7 +134,7 @@ export let startMessageEvent = { properties: [{}] }; -export let startMessageEventActive = { +export const startMessageEventActive = { completed: false, current: true, id: 'startEvent1', @@ -147,7 +147,7 @@ export let startMessageEventActive = { properties: [{}] }; -export let startMessageEventCompleted = { +export const startMessageEventCompleted = { completed: true, current: false, id: 'startEvent1', @@ -160,7 +160,7 @@ export let startMessageEventCompleted = { properties: [{}] }; -export let startErrorEvent = { +export const startErrorEvent = { id: 'startEvent1', type: 'StartEvent', width: 30, @@ -171,7 +171,7 @@ export let startErrorEvent = { properties: [{}] }; -export let startErrorEventActive = { +export const startErrorEventActive = { completed: false, current: true, id: 'startEvent1', @@ -184,7 +184,7 @@ export let startErrorEventActive = { properties: [{}] }; -export let startErrorEventCompleted = { +export const startErrorEventCompleted = { completed: true, current: false, id: 'startEvent1', @@ -197,7 +197,7 @@ export let startErrorEventCompleted = { properties: [{}] }; -export let endEvent = { +export const endEvent = { id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', type: 'EndEvent', width: 28, @@ -207,7 +207,7 @@ export let endEvent = { properties: [{}] }; -export let endEventActive = { +export const endEventActive = { completed: false, current: true, id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', @@ -219,7 +219,7 @@ export let endEventActive = { properties: [{}] }; -export let endEventCompleted = { +export const endEventCompleted = { completed: true, current: false, id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', @@ -231,7 +231,7 @@ export let endEventCompleted = { properties: [{}] }; -export let endErrorEvent = { +export const endErrorEvent = { id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', type: 'EndEvent', width: 28, @@ -242,7 +242,7 @@ export let endErrorEvent = { properties: [{}] }; -export let endErrorEventActive = { +export const endErrorEventActive = { completed: false, current: true, id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', @@ -255,7 +255,7 @@ export let endErrorEventActive = { properties: [{}] }; -export let endErrorEventCompleted = { +export const endErrorEventCompleted = { completed: true, current: false, id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E', diff --git a/lib/insights/src/lib/mock/diagram/diagram-flows.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-flows.mock.ts index b3c4fcead27..2bbdf54a050 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-flows.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-flows.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let flow = { +export const flow = { id: 'sid-5BA99724-A3BD-4F8E-B69F-222F9FF66335', sourceRef: 'startEvent1', targetRef: 'sid-811B9223-E72E-4991-AAA5-4E1A01095D08', diff --git a/lib/insights/src/lib/mock/diagram/diagram-gateways.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-gateways.mock.ts index 84ea982a995..fa566a467e9 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-gateways.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-gateways.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let exclusiveGateway = { +export const exclusiveGateway = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'ExclusiveGateway', width: 40, @@ -25,7 +25,7 @@ export let exclusiveGateway = { properties: [{}] }; -export let exclusiveGatewayActive = { +export const exclusiveGatewayActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -37,7 +37,7 @@ export let exclusiveGatewayActive = { properties: [{}] }; -export let exclusiveGatewayCompleted = { +export const exclusiveGatewayCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -49,7 +49,7 @@ export let exclusiveGatewayCompleted = { properties: [{}] }; -export let inclusiveGateway = { +export const inclusiveGateway = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'InclusiveGateway', width: 40, @@ -59,7 +59,7 @@ export let inclusiveGateway = { properties: [{}] }; -export let inclusiveGatewayActive = { +export const inclusiveGatewayActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -71,7 +71,7 @@ export let inclusiveGatewayActive = { properties: [{}] }; -export let inclusiveGatewayCompleted = { +export const inclusiveGatewayCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -83,7 +83,7 @@ export let inclusiveGatewayCompleted = { properties: [{}] }; -export let parallelGateway = { +export const parallelGateway = { id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', type: 'ParallelGateway', width: 40, @@ -93,7 +93,7 @@ export let parallelGateway = { properties: [{}] }; -export let parallelGatewayActive = { +export const parallelGatewayActive = { completed: false, current: true, id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', @@ -105,7 +105,7 @@ export let parallelGatewayActive = { properties: [{}] }; -export let parallelGatewayCompleted = { +export const parallelGatewayCompleted = { completed: true, current: false, id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', @@ -117,7 +117,7 @@ export let parallelGatewayCompleted = { properties: [{}] }; -export let eventGateway = { +export const eventGateway = { id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', type: 'EventGateway', width: 40, @@ -127,7 +127,7 @@ export let eventGateway = { properties: [{}] }; -export let eventGatewayActive = { +export const eventGatewayActive = { completed: false, current: true, id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', @@ -139,7 +139,7 @@ export let eventGatewayActive = { properties: [{}] }; -export let eventGatewayCompleted = { +export const eventGatewayCompleted = { completed: true, current: false, id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC', diff --git a/lib/insights/src/lib/mock/diagram/diagram-intermediate.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-intermediate.mock.ts index dbbd7f895f7..f6701002874 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-intermediate.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-intermediate.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let intermediateCatchingTimeEvent = { +export const intermediateCatchingTimeEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'IntermediateCatchEvent', width: 31, @@ -26,7 +26,7 @@ export let intermediateCatchingTimeEvent = { eventDefinition: {type: 'timer'} }; -export let intermediateCatchingTimeEventActive = { +export const intermediateCatchingTimeEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -39,7 +39,7 @@ export let intermediateCatchingTimeEventActive = { eventDefinition: {type: 'timer'} }; -export let intermediateCatchingTimeEventCompleted = { +export const intermediateCatchingTimeEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -52,7 +52,7 @@ export let intermediateCatchingTimeEventCompleted = { eventDefinition: {type: 'timer'} }; -export let intermediateCatchingErrorEvent = { +export const intermediateCatchingErrorEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'IntermediateCatchEvent', width: 31, @@ -63,7 +63,7 @@ export let intermediateCatchingErrorEvent = { eventDefinition: {type: 'error'} }; -export let intermediateCatchingErrorEventActive = { +export const intermediateCatchingErrorEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -76,7 +76,7 @@ export let intermediateCatchingErrorEventActive = { eventDefinition: {type: 'error'} }; -export let intermediateCatchingErrorEventCompleted = { +export const intermediateCatchingErrorEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -89,7 +89,7 @@ export let intermediateCatchingErrorEventCompleted = { eventDefinition: {type: 'error'} }; -export let intermediateCatchingSignalEvent = { +export const intermediateCatchingSignalEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'IntermediateCatchEvent', width: 31, @@ -100,7 +100,7 @@ export let intermediateCatchingSignalEvent = { eventDefinition: {type: 'signal'} }; -export let intermediateCatchingSignalEventActive = { +export const intermediateCatchingSignalEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -113,7 +113,7 @@ export let intermediateCatchingSignalEventActive = { eventDefinition: {type: 'signal'} }; -export let intermediateCatchingSignalEventCompleted = { +export const intermediateCatchingSignalEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -126,7 +126,7 @@ export let intermediateCatchingSignalEventCompleted = { eventDefinition: {type: 'signal'} }; -export let intermediateCatchingMessageEvent = { +export const intermediateCatchingMessageEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'IntermediateCatchEvent', width: 31, @@ -137,7 +137,7 @@ export let intermediateCatchingMessageEvent = { eventDefinition: {type: 'message'} }; -export let intermediateCatchingMessageEventActive = { +export const intermediateCatchingMessageEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -150,7 +150,7 @@ export let intermediateCatchingMessageEventActive = { eventDefinition: {type: 'message'} }; -export let intermediateCatchingMessageEventCompleted = { +export const intermediateCatchingMessageEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', diff --git a/lib/insights/src/lib/mock/diagram/diagram-structural.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-structural.mock.ts index 40fcf02ec22..2db2b0302e1 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-structural.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-structural.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let subProcess = { +export const subProcess = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'SubProcess', width: 300, @@ -25,7 +25,7 @@ export let subProcess = { properties: [{}] }; -export let subProcessActive = { +export const subProcessActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -37,7 +37,7 @@ export let subProcessActive = { properties: [{}] }; -export let subProcessCompleted = { +export const subProcessCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -49,7 +49,7 @@ export let subProcessCompleted = { properties: [{}] }; -export let eventSubProcess = { +export const eventSubProcess = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'EventSubProcess', width: 300, @@ -59,7 +59,7 @@ export let eventSubProcess = { properties: [{}] }; -export let eventSubProcessActive = { +export const eventSubProcessActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -71,7 +71,7 @@ export let eventSubProcessActive = { properties: [{}] }; -export let eventSubProcessCompleted = { +export const eventSubProcessCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', diff --git a/lib/insights/src/lib/mock/diagram/diagram-swimlanes.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-swimlanes.mock.ts index a285198478e..b38bed7c31a 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-swimlanes.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-swimlanes.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let pool = { +export const pool = { id: 'sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716', name: 'Activiti', width: 600, @@ -25,7 +25,7 @@ export let pool = { properties: [{}] }; -export let poolLanes = { +export const poolLanes = { id: 'sid-0FF10DA3-E2BD-4E6A-9013-6D66FC8A4716', name: 'Activiti', width: 600, diff --git a/lib/insights/src/lib/mock/diagram/diagram-throw.mock.ts b/lib/insights/src/lib/mock/diagram/diagram-throw.mock.ts index d20df601e43..523686351a7 100644 --- a/lib/insights/src/lib/mock/diagram/diagram-throw.mock.ts +++ b/lib/insights/src/lib/mock/diagram/diagram-throw.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export let throwTimeEvent = { +export const throwTimeEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'ThrowEvent', width: 31, @@ -26,7 +26,7 @@ export let throwTimeEvent = { eventDefinition: {type: 'timer'} }; -export let throwTimeEventActive = { +export const throwTimeEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -39,7 +39,7 @@ export let throwTimeEventActive = { eventDefinition: {type: 'timer'} }; -export let throwTimeEventCompleted = { +export const throwTimeEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -52,7 +52,7 @@ export let throwTimeEventCompleted = { eventDefinition: {type: 'timer'} }; -export let throwErrorEvent = { +export const throwErrorEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'ThrowEvent', width: 31, @@ -63,7 +63,7 @@ export let throwErrorEvent = { eventDefinition: {type: 'error'} }; -export let throwErrorEventActive = { +export const throwErrorEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -76,7 +76,7 @@ export let throwErrorEventActive = { eventDefinition: {type: 'error'} }; -export let throwErrorEventCompleted = { +export const throwErrorEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -89,7 +89,7 @@ export let throwErrorEventCompleted = { eventDefinition: {type: 'error'} }; -export let throwSignalEvent = { +export const throwSignalEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'ThrowEvent', width: 31, @@ -100,7 +100,7 @@ export let throwSignalEvent = { eventDefinition: {type: 'signal'} }; -export let throwSignalEventActive = { +export const throwSignalEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -113,7 +113,7 @@ export let throwSignalEventActive = { eventDefinition: {type: 'signal'} }; -export let throwSignalEventCompleted = { +export const throwSignalEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -126,7 +126,7 @@ export let throwSignalEventCompleted = { eventDefinition: {type: 'signal'} }; -export let throwMessageEvent = { +export const throwMessageEvent = { id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', type: 'ThrowEvent', width: 31, @@ -137,7 +137,7 @@ export let throwMessageEvent = { eventDefinition: {type: 'message'} }; -export let throwMessageEventActive = { +export const throwMessageEventActive = { completed: false, current: true, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7', @@ -150,7 +150,7 @@ export let throwMessageEventActive = { eventDefinition: {type: 'message'} }; -export let throwMessageEventCompleted = { +export const throwMessageEventCompleted = { completed: true, current: false, id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',