From 12eb316fef1d7c18fb9d730b95354925dbeb065a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 17 Oct 2016 16:41:27 +0100 Subject: [PATCH 01/61] Create HeatMap Model --- .../src/models/chart.model.ts | 29 +++++++++++-------- .../src/services/analytics.service.ts | 15 ++++++++-- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/models/chart.model.ts b/ng2-components/ng2-activiti-analytics/src/models/chart.model.ts index 3f61139a4f..bba431596e 100644 --- a/ng2-components/ng2-activiti-analytics/src/models/chart.model.ts +++ b/ng2-components/ng2-activiti-analytics/src/models/chart.model.ts @@ -41,6 +41,9 @@ export class Chart { case 'barChart': chartType = 'bar'; break; + case 'processDefinitionHeatMap': + chartType = 'HeatMap'; + break; default: chartType = 'table'; break; @@ -132,23 +135,25 @@ export class TableChart extends Chart { } export class HeatMapChart extends Chart { - title: string; + avgTimePercentages: string; + avgTimeValues: string; + processDefinitionId: string; titleKey: string; - labels: string[] = []; - datasets: any[] = []; + totalCountValues: string; + totalCountsPercentages: string; + totalTimePercentages: string; + totalTimeValues: string; constructor(obj?: any) { super(obj); - this.title = obj && obj.title || null; + this.avgTimePercentages = obj && obj.avgTimePercentages || null; + this.avgTimeValues = obj && obj.avgTimeValues || null; + this.processDefinitionId = obj && obj.processDefinitionId || null; + this.totalCountValues = obj && obj.totalCountValues || null; this.titleKey = obj && obj.titleKey || null; - this.labels = obj && obj.columnNames; - if (obj.rows) { - this.datasets = obj && obj.rows; - } - } - - hasDatasets() { - return this.datasets && this.datasets.length > 0 ? true : false; + this.totalCountsPercentages = obj && obj.totalCountsPercentages || null; + this.totalTimePercentages = obj && obj.totalTimePercentages || null; + this.totalTimeValues = obj && obj.totalTimeValues || null; } } diff --git a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts index 5025e14d6f..500336acc2 100644 --- a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts @@ -20,7 +20,7 @@ import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfr import { Observable } from 'rxjs/Rx'; import { Response, Http, Headers, RequestOptions, URLSearchParams } from '@angular/http'; import { ReportParametersModel, ParameterValueModel } from '../models/report.model'; -import { Chart, PieChart, TableChart, BarChart } from '../models/chart.model'; +import { Chart, PieChart, TableChart, BarChart, HeatMapChart } from '../models/chart.model'; @Injectable() export class AnalyticsService { @@ -129,6 +129,17 @@ export class AnalyticsService { }).catch(this.handleError); } + getProcessDefinitionModel(processDefinitionId: string): Observable { + let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/process-definitions/${processDefinitionId}/model-json`; + let options = this.getRequestOptions(); + return this.http + .get(url, options) + .map((res: any) => { + let body = res.json(); + return body; + }).catch(this.handleError); + } + getTasksByProcessDefinitionId(reportId: string, processDefinitionId: string): Observable { if (reportId && processDefinitionId) { let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/reporting/report-params/${reportId}/tasks`; @@ -171,7 +182,7 @@ export class AnalyticsService { } else if (chartData.type === 'table') { elements.push(new TableChart(chartData)); } else if (chartData.type === 'processDefinitionHeatMap') { - elements.push(new TableChart(chartData)); + elements.push(new HeatMapChart(chartData)); } else if (chartData.type === 'masterDetailTable') { elements.push(new TableChart(chartData)); } else if (chartData.type === 'barChart') { From a7d839c41dbe1ef34d52f88e140006f9851116c8 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 17 Oct 2016 16:43:17 +0100 Subject: [PATCH 02/61] Create Raphael Component --- .../src/components/raphael/index.ts | 34 ++++++++ .../src/components/raphael/models/point.ts | 26 ++++++ .../src/components/raphael/raphael-base.ts | 70 ++++++++++++++++ .../raphael/raphael-circle.component.ts | 53 ++++++++++++ .../raphael/raphael-flow-arrow.component.ts | 80 +++++++++++++++++++ .../raphael/raphael-rect.component.ts | 55 +++++++++++++ .../raphael/raphael-text.component.ts | 50 ++++++++++++ 7 files changed, 368 insertions(+) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts new file mode 100644 index 0000000000..8735c53d4e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { RaphaelCircleDirective } from './raphael-circle.component'; +import { RaphaelRectDirective } from './raphael-rect.component'; +import { RaphaelTextDirective } from './raphael-text.component'; +import { RaphaelFlowArrowDirective } from './raphael-flow-arrow.component'; + +// primitives +export * from './raphael-circle.component'; +export * from './raphael-rect.component'; +export * from './raphael-text.component'; +export * from './raphael-flow-arrow.component'; + +export const RAPHAEL_DIRECTIVES: any[] = [ + RaphaelCircleDirective, + RaphaelRectDirective, + RaphaelTextDirective, + RaphaelFlowArrowDirective +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts new file mode 100644 index 0000000000..58bc45a87e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts @@ -0,0 +1,26 @@ +/*! + * @license + * Copyright 2016 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 class Point { + x: number; + y: number; + + constructor(obj?: any) { + this.x = obj && obj.x || 0; + this.y = obj && obj.y || 0; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts new file mode 100644 index 0000000000..b7d4ff5432 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts @@ -0,0 +1,70 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { + OnDestroy, + OnInit, + Input, + ElementRef +} from '@angular/core'; + +declare let Raphael: any; + +export class RaphaelBase implements OnDestroy, OnInit { + @Input() + paper: any; + + private ctx: any; + + private initFlag: boolean = false; + + private element: ElementRef; + + public constructor(element: ElementRef) { + this.element = element; + } + + public ngOnInit(): any { + if (!this.paper) { + this.ctx = this.element.nativeElement; + this.initFlag = true; + this.refresh(); + } + } + + public ngOnDestroy(): any { + if (this.paper) { + this.paper.clear(); + this.paper = void 0; + } + } + + public getPaperBuilder(ctx: any): any { + if (typeof Raphael === 'undefined') { + throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); + } + let paper = new Raphael(ctx, 583, 344.08374193550003); + paper.setViewBox(0, 0, 583, 344.08374193550003, false); + paper.renderfix(); + return paper; + } + + private refresh(): any { + this.ngOnDestroy(); + this.paper = this.getPaperBuilder(this.ctx); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts new file mode 100644 index 0000000000..c3fe256688 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts @@ -0,0 +1,53 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; + +@Directive({selector: 'raphael-circle'}) +export class RaphaelCircleDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + center: Point; + + @Input() + radius: number; + + @Input() + strokeWith: number; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) { + super(elementRef); + } + + ngOnInit() { + console.log(this.elementRef); + let opts = {'stroke-width': this.strokeWith}; + this.draw(this.center, this.radius, opts); + } + + public draw(center: Point, radius: number, opts: any) { + let circle = this.paper.circle(center.x, center.y, radius).attr(opts); + return circle; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts new file mode 100644 index 0000000000..c2277ef508 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts @@ -0,0 +1,80 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { RaphaelBase } from './raphael-base'; + +declare let Raphael: any; +declare let Polyline: any; + +@Directive({selector: 'raphael-flow-arrow'}) +export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + flow: any; + + @Output() + onError = new EventEmitter(); + + ARROW_WIDTH = 4; + SEQUENCEFLOW_STROKE = 1.5; + + constructor(public elementRef: ElementRef) { + super(elementRef); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.flow); + } + + public draw(flow: any) { + let line = this.drawLine(flow); + this.drawArrow(line); + } + + public drawLine(flow: any) { + let polyline = new Polyline(flow.id, flow.waypoints, this.SEQUENCEFLOW_STROKE, this.paper); + polyline.element = this.paper.path(polyline.path); + polyline.element.attr({'stroke-width': this.SEQUENCEFLOW_STROKE}); + polyline.element.attr({'stroke': '#585858'}); + + polyline.element.id = this.flow.id; + + let lastLineIndex = polyline.getLinesCount() - 1; + let line = polyline.getLine(lastLineIndex); + return line; + } + + public drawArrow(line: any) { + let doubleArrowWidth = 2 * this.ARROW_WIDTH; + let width = this.ARROW_WIDTH / 2 + .5; + let arrowHead: any = this.paper.path('M0 0L-' + width + '-' + doubleArrowWidth + 'L' + width + ' -' + doubleArrowWidth + 'z'); + + arrowHead.transform('t' + line.x2 + ',' + line.y2); + let angle = Raphael.deg(line.angle - Math.PI / 2); + arrowHead.transform('...r' + angle + ' 0 0'); + + arrowHead.attr('fill', '#585858'); + + arrowHead.attr('stroke-width', this.SEQUENCEFLOW_STROKE); + arrowHead.attr('stroke', '#585858'); + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts new file mode 100644 index 0000000000..eff4571c83 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; + +@Directive({selector: 'raphael-rect'}) +export class RaphaelRectDirective implements OnInit { + @Input() + paper: any; + + @Input() + leftCorner: Point; + + @Input() + width: number; + + @Input() + height: number; + + @Input() + radius: number = 0; + + @Input() + strokeWith: number; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + console.log(this.elementRef); + let opts = {'stroke-width': this.strokeWith}; + this.draw(this.leftCorner, this.width, this.height, this.radius, opts); + } + + public 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/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts new file mode 100644 index 0000000000..66fb7751c1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; + +@Directive({selector: 'raphael-text'}) +export class RaphaelTextDirective implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position, this.text); + } + + public draw(position: Point, text: string) { + return this.paper.text(position.x, position.y, text).attr({ + 'text-anchor' : 'middle', + 'font-family' : 'Arial', + 'font-size' : '11', + 'fill' : '#373e48' + }); + } +} From 93fa17959ac62c61f3320a9ae7301620364e404d Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 17 Oct 2016 16:43:59 +0100 Subject: [PATCH 03/61] Create Diagram Component that use Raphael Component --- .../diagrams/diagram-event.component.html | 1 + .../diagrams/diagram-event.component.ts | 51 ++++++++++ .../diagram-sequence-flow.component.html | 1 + .../diagram-sequence-flow.component.ts | 41 ++++++++ .../diagrams/diagram-task.component.html | 2 + .../diagrams/diagram-task.component.ts | 95 ++++++++++++++++++ .../diagrams/diagram.component.html | 26 +++++ .../components/diagrams/diagram.component.ts | 98 +++++++++++++++++++ .../src/components/diagrams/index.ts | 34 +++++++ 9 files changed, 349 insertions(+) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html new file mode 100644 index 0000000000..896baac631 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts new file mode 100644 index 0000000000..1ff911576a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-event', + templateUrl: './diagram-event.component.html', + styleUrls: ['./diagram-event.component.css'] +}) +export class DiagramEventComponent { + @Input() + paper: any; + + @Input() + data: any; + + @Input() + strokeWidth: number; + + @Input() + radius: number; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + console.log(this.elementRef); + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html new file mode 100644 index 0000000000..a03d77ac7d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts new file mode 100644 index 0000000000..62605adb6a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts @@ -0,0 +1,41 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-sequence-flow', + templateUrl: './diagram-sequence-flow.component.html', + styleUrls: ['./diagram-sequence-flow.component.css'] +}) +export class DiagramSequenceFlowComponent { + @Input() + paper: any; + + @Input() + flow: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + console.log(this.elementRef); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html new file mode 100644 index 0000000000..52ccf789c3 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts new file mode 100644 index 0000000000..cdcc942783 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts @@ -0,0 +1,95 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-task', + templateUrl: './diagram-task.component.html', + styleUrls: ['./diagram-task.component.css'] +}) +export class DiagramTaskComponent { + + static CURRENT_COLOR = '#017501'; + static COMPLETED_COLOR = '#2632aa'; + static ACTIVITY_STROKE_COLOR = '#bbbbbb'; + + static TASK_STROKE = '1'; + static TASK_HIGHLIGHT_STROKE = '2'; + + @Input() + data: any; + + @Input() + type: any; + + @Input() + paper: any; + + options: any = {}; + + @Output() + onError = new EventEmitter(); + + stroke: number; + + rect: any; + radius: number = 4; + + textPosition: any; + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + console.log(this.elementRef); + + this.rect = {x: this.data.x, y: this.data.y}; + + this.textPosition = {x: this.data.x + ( this.data.width / 2 ), y: this.data.y + ( this.data.height / 2 )}; + + this.options['id'] = this.data.id; + this.options['stroke'] = this.bpmnGetColor(this.data, DiagramTaskComponent.ACTIVITY_STROKE_COLOR); + this.options['stroke-width'] = this.bpmnGetStrokeWidth(this.data); + this.options['fill'] = this.determineCustomFillColor(this.data); + // rectAttrs['fill-opacity'] = customActivityBackgroundOpacity; + + } + + private bpmnGetColor(data, defaultColor) { + if (data.current) { + return DiagramTaskComponent.CURRENT_COLOR; + } else if (data.completed) { + return DiagramTaskComponent.COMPLETED_COLOR; + } else { + return defaultColor; + } + } + + private bpmnGetStrokeWidth(data) { + if (data.current || data.completed) { + return DiagramTaskComponent.TASK_STROKE; + } else { + return DiagramTaskComponent.TASK_HIGHLIGHT_STROKE; + } + } + + private determineCustomFillColor(data) { + // TODO + return 'hsb(0.1966666666666667, 1, 1)'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html new file mode 100644 index 0000000000..6d1cdb38c3 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -0,0 +1,26 @@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts new file mode 100644 index 0000000000..f3cdd4dee9 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts @@ -0,0 +1,98 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { AlfrescoTranslationService } from 'ng2-alfresco-core'; +import { AnalyticsService } from '../../services/analytics.service'; + +declare let Raphael: any; + +@Component({ + moduleId: module.id, + selector: 'diagram', + templateUrl: './diagram.component.html', + styleUrls: ['./diagram.component.css'] +}) +export class DiagramComponent { + + @Input() + modelType: string; + + @Input() + processDefinitionId: string; + + @Output() + onError = new EventEmitter(); + + private diagram: any; + private paper: any; + private ctx: any; + + private element: ElementRef; + + constructor(elementRef: ElementRef, + private translate: AlfrescoTranslationService, + private analyticsService: AnalyticsService) { + if (translate) { + translate.addTranslationFolder('node_modules/ng2-activiti-analytics/src'); + } + this.element = elementRef; + } + + ngOnInit() { + this.ctx = this.element.nativeElement; + this.refresh(); + this.getProcessDefinitionModel(this.processDefinitionId); + } + + getProcessDefinitionModel(processDefinitionId: string) { + if (this.modelType === 'process-definition') { + this.analyticsService.getProcessDefinitionModel(processDefinitionId).subscribe( + (res: any) => { + this.diagram = res; + console.log(res); + }, + (err: any) => { + this.onError.emit(err); + console.log(err); + } + ); + } + } + + public getPaperBuilder(ctx: any): any { + if (typeof Raphael === 'undefined') { + throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); + } + let paper = new Raphael(ctx, 583, 344.08374193550003); + paper.setViewBox(0, 0, 583, 344.08374193550003, false); + paper.renderfix(); + return paper; + } + + private refresh(): any { + this.ngOnDestroy(); + this.paper = this.getPaperBuilder(this.ctx); + } + + public ngOnDestroy(): any { + if (this.paper) { + this.paper.clear(); + this.paper = void 0; + } + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts new file mode 100644 index 0000000000..f5688f40fc --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramComponent } from './diagram.component'; +import { DiagramEventComponent } from './diagram-event.component'; +import { DiagramTaskComponent } from './diagram-task.component'; +import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component'; + +// primitives +export * from './diagram.component'; +export * from './diagram-event.component'; +export * from './diagram-task.component'; +export * from './diagram-sequence-flow.component'; + +export const DIAGRAM_DIRECTIVES: any[] = [ + DiagramComponent, + DiagramEventComponent, + DiagramTaskComponent, + DiagramSequenceFlowComponent +]; From fb4140371798f44cb65e0d46735c1ed739f59be8 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 17 Oct 2016 16:44:18 +0100 Subject: [PATCH 04/61] Enable Diagram Component --- demo-shell-ng2/index.html | 2 ++ demo-shell-ng2/package.json | 1 + ng2-components/ng2-activiti-analytics/index.ts | 8 +++++++- ng2-components/ng2-activiti-analytics/karma.conf.js | 1 + ng2-components/ng2-activiti-analytics/package.json | 1 + .../src/components/analytics.component.html | 3 +++ 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index 93ac0bfd52..08205cc45d 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -32,11 +32,13 @@ + + diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index 0c5e143ca0..a79ab27e6b 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -77,6 +77,7 @@ "moment": "2.15.1", "chart.js": "^2.1.4", "ng2-charts": "1.1.0", + "raphael": "^2.2.6", "md-date-time-picker": "^2.2.0", "alfresco-js-api": "^0.3.0", "ng2-alfresco-core": "0.3.2", diff --git a/ng2-components/ng2-activiti-analytics/index.ts b/ng2-components/ng2-activiti-analytics/index.ts index 5fdc8def07..86814b09ee 100644 --- a/ng2-components/ng2-activiti-analytics/index.ts +++ b/ng2-components/ng2-activiti-analytics/index.ts @@ -25,18 +25,24 @@ import { AnalyticsService } from './src/services/analytics.service'; import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { WIDGET_DIRECTIVES } from './src/components/widgets/index'; +import { RAPHAEL_DIRECTIVES } from './src/components/raphael/index'; +import { DIAGRAM_DIRECTIVES } from './src/components/diagrams/index'; export * from './src/components/analytics.component'; export * from './src/components/analytics-report-list.component'; export * from './src/components/analytics-report-parameters.component'; export * from './src/services/analytics.service'; export * from './src/components/widgets/index'; +export * from './src/components/raphael/index'; +export * from './src/components/diagrams/index'; export const ANALYTICS_DIRECTIVES: any[] = [ AnalyticsComponent, AnalyticsReportListComponent, AnalyticsReportParametersComponent, - WIDGET_DIRECTIVES + WIDGET_DIRECTIVES, + RAPHAEL_DIRECTIVES, + DIAGRAM_DIRECTIVES ]; export const ANALYTICS_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/karma.conf.js b/ng2-components/ng2-activiti-analytics/karma.conf.js index db5a72000c..e6e3024303 100644 --- a/ng2-components/ng2-activiti-analytics/karma.conf.js +++ b/ng2-components/ng2-activiti-analytics/karma.conf.js @@ -36,6 +36,7 @@ module.exports = function (config) { 'node_modules/moment/min/moment.min.js', 'node_modules/md-date-time-picker/dist/js/mdDateTimePicker.js', 'node_modules/chart.js/dist/Chart.bundle.min.js', + 'node_modules/raphael/raphael.min.js', {pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false}, 'karma-test-shim.js', diff --git a/ng2-components/ng2-activiti-analytics/package.json b/ng2-components/ng2-activiti-analytics/package.json index 6f6a63b956..96a1becad1 100644 --- a/ng2-components/ng2-activiti-analytics/package.json +++ b/ng2-components/ng2-activiti-analytics/package.json @@ -58,6 +58,7 @@ "ng2-alfresco-core": "0.3.2", "ng2-charts": "1.1.0", "ng2-translate": "2.5.0", + "raphael": "^2.2.6", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html index 403632310c..8b294e19c5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html @@ -51,6 +51,9 @@ [chartType]="report.type"> +
+ +
{{'ANALYTICS.MESSAGES.UNKNOWN-WIDGET-TYPE' | translate}}: {{report.type}}
From 79988f421daaa71ec79c26e0f8285ec43e91d7d1 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 17 Oct 2016 17:39:07 +0100 Subject: [PATCH 05/61] Create a service that return the paper instance Remove paper dependency --- .../ng2-activiti-analytics/index.ts | 4 +- .../diagrams/diagram-event.component.html | 2 +- .../diagrams/diagram-event.component.ts | 3 - .../diagram-sequence-flow.component.html | 2 +- .../diagram-sequence-flow.component.ts | 3 - .../diagrams/diagram-task.component.html | 4 +- .../diagrams/diagram-task.component.ts | 6 -- .../diagrams/diagram.component.html | 8 +-- .../components/diagrams/diagram.component.ts | 29 --------- .../src/components/raphael/raphael-base.ts | 50 ++-------------- .../raphael/raphael-circle.component.ts | 6 +- .../raphael/raphael-flow-arrow.component.ts | 6 +- .../raphael/raphael-rect.component.ts | 9 ++- .../raphael/raphael-text.component.ts | 9 ++- .../src/components/raphael/raphael.service.ts | 60 +++++++++++++++++++ 15 files changed, 99 insertions(+), 102 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts diff --git a/ng2-components/ng2-activiti-analytics/index.ts b/ng2-components/ng2-activiti-analytics/index.ts index 86814b09ee..c7dc7a3ae4 100644 --- a/ng2-components/ng2-activiti-analytics/index.ts +++ b/ng2-components/ng2-activiti-analytics/index.ts @@ -22,6 +22,7 @@ import { AnalyticsReportListComponent } from './src/components/analytics-report- import { AnalyticsReportParametersComponent } from './src/components/analytics-report-parameters.component'; import { AnalyticsComponent } from './src/components/analytics.component'; import { AnalyticsService } from './src/services/analytics.service'; +import { RaphaelService } from './src/components/raphael/raphael.service'; import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { WIDGET_DIRECTIVES } from './src/components/widgets/index'; @@ -58,7 +59,8 @@ export const ANALYTICS_PROVIDERS: any[] = [ ...CHART_DIRECTIVES ], providers: [ - ...ANALYTICS_PROVIDERS + ...ANALYTICS_PROVIDERS, + RaphaelService ], exports: [ ...ANALYTICS_DIRECTIVES diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html index 896baac631..d965900f2d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts index 1ff911576a..db510db849 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts @@ -24,9 +24,6 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor styleUrls: ['./diagram-event.component.css'] }) export class DiagramEventComponent { - @Input() - paper: any; - @Input() data: any; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html index a03d77ac7d..985c72c443 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts index 62605adb6a..ff5238467a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts @@ -24,9 +24,6 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor styleUrls: ['./diagram-sequence-flow.component.css'] }) export class DiagramSequenceFlowComponent { - @Input() - paper: any; - @Input() flow: any; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html index 52ccf789c3..886c378df5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html @@ -1,2 +1,2 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts index cdcc942783..5be4e5fcc7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts @@ -35,12 +35,6 @@ export class DiagramTaskComponent { @Input() data: any; - @Input() - type: any; - - @Input() - paper: any; - options: any = {}; @Output() diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 6d1cdb38c3..8dace98ec9 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -2,24 +2,24 @@
- +
- +
- +
- +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts index f3cdd4dee9..a182f9eaa5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts @@ -19,8 +19,6 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { AnalyticsService } from '../../services/analytics.service'; -declare let Raphael: any; - @Component({ moduleId: module.id, selector: 'diagram', @@ -39,9 +37,6 @@ export class DiagramComponent { onError = new EventEmitter(); private diagram: any; - private paper: any; - private ctx: any; - private element: ElementRef; constructor(elementRef: ElementRef, @@ -54,8 +49,6 @@ export class DiagramComponent { } ngOnInit() { - this.ctx = this.element.nativeElement; - this.refresh(); this.getProcessDefinitionModel(this.processDefinitionId); } @@ -73,26 +66,4 @@ export class DiagramComponent { ); } } - - public getPaperBuilder(ctx: any): any { - if (typeof Raphael === 'undefined') { - throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); - } - let paper = new Raphael(ctx, 583, 344.08374193550003); - paper.setViewBox(0, 0, 583, 344.08374193550003, false); - paper.renderfix(); - return paper; - } - - private refresh(): any { - this.ngOnDestroy(); - this.paper = this.getPaperBuilder(this.ctx); - } - - public ngOnDestroy(): any { - if (this.paper) { - this.paper.clear(); - this.paper = void 0; - } - } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts index b7d4ff5432..6e8292d754 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts @@ -15,56 +15,18 @@ * limitations under the License. */ -import { - OnDestroy, - OnInit, - Input, - ElementRef -} from '@angular/core'; +import { ElementRef } from '@angular/core'; +import { RaphaelService } from './raphael.service'; -declare let Raphael: any; +export class RaphaelBase { -export class RaphaelBase implements OnDestroy, OnInit { - @Input() paper: any; - private ctx: any; - - private initFlag: boolean = false; - private element: ElementRef; - public constructor(element: ElementRef) { + public constructor(element: ElementRef, + private raphaelService: RaphaelService) { this.element = element; - } - - public ngOnInit(): any { - if (!this.paper) { - this.ctx = this.element.nativeElement; - this.initFlag = true; - this.refresh(); - } - } - - public ngOnDestroy(): any { - if (this.paper) { - this.paper.clear(); - this.paper = void 0; - } - } - - public getPaperBuilder(ctx: any): any { - if (typeof Raphael === 'undefined') { - throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); - } - let paper = new Raphael(ctx, 583, 344.08374193550003); - paper.setViewBox(0, 0, 583, 344.08374193550003, false); - paper.renderfix(); - return paper; - } - - private refresh(): any { - this.ngOnDestroy(); - this.paper = this.getPaperBuilder(this.ctx); + this.paper = this.raphaelService.getInstance(element); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts index c3fe256688..a1a81edebc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts @@ -18,6 +18,7 @@ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { Point } from './models/point'; import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; @Directive({selector: 'raphael-circle'}) export class RaphaelCircleDirective extends RaphaelBase implements OnInit { @@ -36,8 +37,9 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { @Output() onError = new EventEmitter(); - constructor(public elementRef: ElementRef) { - super(elementRef); + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); } ngOnInit() { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts index c2277ef508..7e4a66d8ec 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts @@ -17,6 +17,7 @@ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; declare let Raphael: any; declare let Polyline: any; @@ -35,8 +36,9 @@ export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { ARROW_WIDTH = 4; SEQUENCEFLOW_STROKE = 1.5; - constructor(public elementRef: ElementRef) { - super(elementRef); + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); } ngOnInit() { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts index eff4571c83..0fbff9cf53 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts @@ -17,9 +17,11 @@ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; @Directive({selector: 'raphael-rect'}) -export class RaphaelRectDirective implements OnInit { +export class RaphaelRectDirective extends RaphaelBase implements OnInit { @Input() paper: any; @@ -41,7 +43,10 @@ export class RaphaelRectDirective implements OnInit { @Output() onError = new EventEmitter(); - constructor(public elementRef: ElementRef) {} + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } ngOnInit() { console.log(this.elementRef); diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts index 66fb7751c1..45ecdae269 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts @@ -17,9 +17,11 @@ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; @Directive({selector: 'raphael-text'}) -export class RaphaelTextDirective implements OnInit { +export class RaphaelTextDirective extends RaphaelBase implements OnInit { @Input() paper: any; @@ -32,7 +34,10 @@ export class RaphaelTextDirective implements OnInit { @Output() onError = new EventEmitter(); - constructor(public elementRef: ElementRef) {} + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } ngOnInit() { console.log(this.elementRef); diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts new file mode 100644 index 0000000000..85f1e127db --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts @@ -0,0 +1,60 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Injectable } from '@angular/core'; + +declare let Raphael: any; + +@Injectable() +export class RaphaelService { + + paper: any; + private ctx: any; + + constructor() { + } + + public getInstance(element: any): any { + if (!this.paper) { + this.ctx = element.nativeElement; + this.refresh(); + } + return this.paper; + } + + private refresh(): any { + this.ngOnDestroy(); + this.paper = this.getPaperBuilder(this.ctx); + } + + public getPaperBuilder(ctx: any): any { + if (typeof Raphael === 'undefined') { + throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); + } + let paper = new Raphael(ctx, 583, 344.08374193550003); + paper.setViewBox(0, 0, 583, 344.08374193550003, false); + paper.renderfix(); + return paper; + } + + public ngOnDestroy(): any { + if (this.paper) { + this.paper.clear(); + this.paper = void 0; + } + } +} From c2db58babb52e7c2a5c60fe85d6d8e34654e088a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 18 Oct 2016 21:15:02 +0100 Subject: [PATCH 06/61] Remove local declare var and using declaration file --- .../src/components/raphael/raphael-flow-arrow.component.ts | 3 --- .../src/components/raphael/raphael.service.ts | 2 -- .../src/components/widgets/checkbox/checkbox.widget.ts | 2 -- .../src/components/widgets/date-range/date-range.widget.ts | 2 -- .../src/components/widgets/widget.component.ts | 2 -- 5 files changed, 11 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts index 7e4a66d8ec..3cf8ae5cb3 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts @@ -19,9 +19,6 @@ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@ang import { RaphaelBase } from './raphael-base'; import { RaphaelService } from './raphael.service'; -declare let Raphael: any; -declare let Polyline: any; - @Directive({selector: 'raphael-flow-arrow'}) export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { @Input() diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts index 85f1e127db..8908461502 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts @@ -17,8 +17,6 @@ import { Injectable } from '@angular/core'; -declare let Raphael: any; - @Injectable() export class RaphaelService { diff --git a/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.ts b/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.ts index 67a6081e1c..a0f7524065 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.ts @@ -18,8 +18,6 @@ import { Component } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare var componentHandler; - @Component({ moduleId: module.id, selector: 'checkbox-widget', diff --git a/ng2-components/ng2-activiti-analytics/src/components/widgets/date-range/date-range.widget.ts b/ng2-components/ng2-activiti-analytics/src/components/widgets/date-range/date-range.widget.ts index 732c311879..39caaf50cc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/widgets/date-range/date-range.widget.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/widgets/date-range/date-range.widget.ts @@ -20,8 +20,6 @@ import { AbstractControl, FormGroup, FormBuilder, FormControl, Validators } from import { WidgetComponent } from './../widget.component'; import * as moment from 'moment'; -declare let mdDateTimePicker: any; - function dateCheck(c: AbstractControl) { let startDate = moment(c.get('startDate').value); let endDate = moment(c.get('endDate').value); diff --git a/ng2-components/ng2-activiti-analytics/src/components/widgets/widget.component.ts b/ng2-components/ng2-activiti-analytics/src/components/widgets/widget.component.ts index eafd8cdca2..dbab34a340 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/widgets/widget.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/widgets/widget.component.ts @@ -17,8 +17,6 @@ import { Input, AfterViewInit, Output, EventEmitter, SimpleChanges, OnChanges } from '@angular/core'; -declare var componentHandler; - /** * Base widget component. */ From 172b5f8f477b4a89bd9f09883868f002feca31bd Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Wed, 19 Oct 2016 11:10:00 +0100 Subject: [PATCH 07/61] Fix declarations --- .../ng2-activiti-analytics/.gitignore | 2 +- .../src/components/raphael/declarations.d.ts | 19 +++++++++++++++ .../src/declarations.d.ts | 23 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/declarations.d.ts diff --git a/ng2-components/ng2-activiti-analytics/.gitignore b/ng2-components/ng2-activiti-analytics/.gitignore index 13324e66b9..fe20e77f42 100644 --- a/ng2-components/ng2-activiti-analytics/.gitignore +++ b/ng2-components/ng2-activiti-analytics/.gitignore @@ -6,7 +6,7 @@ coverage dist src/**/*.js src/**/*.js.map -src/**/*.d.ts + demo/**/*.js demo/**/*.js.map demo/**/*.d.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts new file mode 100644 index 0000000000..7b345fa61a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright 2016 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. + */ + +declare let Raphael: any; +declare let Polyline: any; diff --git a/ng2-components/ng2-activiti-analytics/src/declarations.d.ts b/ng2-components/ng2-activiti-analytics/src/declarations.d.ts new file mode 100644 index 0000000000..a4cceff023 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/declarations.d.ts @@ -0,0 +1,23 @@ +/*! + * @license + * Copyright 2016 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. + */ + +declare let moment: any; +declare let mdDateTimePicker: any; + +// MDL +declare let componentHandler: any; +declare let dialogPolyfill: any; From 7f3754da4f69a917a7a3113ccf2118220394e4e5 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 20 Oct 2016 11:28:05 +0100 Subject: [PATCH 08/61] Add properties color --- demo-shell-ng2/package.json | 2 +- .../ng2-activiti-analytics/index.ts | 8 ++- .../src/components/analytics.component.html | 2 +- .../diagrams/diagram-task.component.html | 3 +- .../diagrams/diagram-task.component.ts | 49 +++---------- .../components/diagrams/diagram.component.ts | 36 +++++----- .../src/components/diagrams/index.ts | 6 ++ .../services/diagram-color.service.ts | 72 +++++++++++++++++++ .../raphael/raphael-rect.component.ts | 13 +++- 9 files changed, 125 insertions(+), 66 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index a79ab27e6b..cd639013c7 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -107,7 +107,7 @@ "license-check-config": { "src": [ "./app/**/*.js", - "!./app/js/xml2json.js" + "!./app/js/*.js" ], "path": "assets/license_header.txt", "blocking": true, diff --git a/ng2-components/ng2-activiti-analytics/index.ts b/ng2-components/ng2-activiti-analytics/index.ts index c7dc7a3ae4..7a96c28b26 100644 --- a/ng2-components/ng2-activiti-analytics/index.ts +++ b/ng2-components/ng2-activiti-analytics/index.ts @@ -28,6 +28,7 @@ import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { WIDGET_DIRECTIVES } from './src/components/widgets/index'; import { RAPHAEL_DIRECTIVES } from './src/components/raphael/index'; import { DIAGRAM_DIRECTIVES } from './src/components/diagrams/index'; +import { DIAGRAM_PROVIDERS } from './src/components/diagrams/index'; export * from './src/components/analytics.component'; export * from './src/components/analytics-report-list.component'; @@ -47,7 +48,8 @@ export const ANALYTICS_DIRECTIVES: any[] = [ ]; export const ANALYTICS_PROVIDERS: any[] = [ - AnalyticsService + AnalyticsService, + DIAGRAM_PROVIDERS ]; @NgModule({ @@ -60,6 +62,7 @@ export const ANALYTICS_PROVIDERS: any[] = [ ], providers: [ ...ANALYTICS_PROVIDERS, + ...DIAGRAM_PROVIDERS, RaphaelService ], exports: [ @@ -71,7 +74,8 @@ export class AnalyticsModule { return { ngModule: AnalyticsModule, providers: [ - ...ANALYTICS_PROVIDERS + ...ANALYTICS_PROVIDERS, + ...DIAGRAM_PROVIDERS ] }; } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html index 8b294e19c5..8be52c6037 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html @@ -52,7 +52,7 @@
- +
{{'ANALYTICS.MESSAGES.UNKNOWN-WIDGET-TYPE' | translate}}: {{report.type}} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html index 886c378df5..961479892a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html @@ -1,2 +1,3 @@ - + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts index 5be4e5fcc7..eff9f54135 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts @@ -16,6 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './services/diagram-color.service'; @Component({ moduleId: module.id, @@ -24,14 +25,6 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor styleUrls: ['./diagram-task.component.css'] }) export class DiagramTaskComponent { - - static CURRENT_COLOR = '#017501'; - static COMPLETED_COLOR = '#2632aa'; - static ACTIVITY_STROKE_COLOR = '#bbbbbb'; - - static TASK_STROKE = '1'; - static TASK_HIGHLIGHT_STROKE = '2'; - @Input() data: any; @@ -42,48 +35,26 @@ export class DiagramTaskComponent { stroke: number; - rect: any; + rectLeftCorner: any; radius: number = 4; textPosition: any; - constructor(public elementRef: ElementRef) {} + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} ngOnInit() { console.log(this.elementRef); - this.rect = {x: this.data.x, y: this.data.y}; + this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR); + this.data.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data); + this.data.fillOpacity = this.diagramColorService.getFillOpacity(); + + this.rectLeftCorner = {x: this.data.x, y: this.data.y}; this.textPosition = {x: this.data.x + ( this.data.width / 2 ), y: this.data.y + ( this.data.height / 2 )}; this.options['id'] = this.data.id; - this.options['stroke'] = this.bpmnGetColor(this.data, DiagramTaskComponent.ACTIVITY_STROKE_COLOR); - this.options['stroke-width'] = this.bpmnGetStrokeWidth(this.data); - this.options['fill'] = this.determineCustomFillColor(this.data); - // rectAttrs['fill-opacity'] = customActivityBackgroundOpacity; - - } - - private bpmnGetColor(data, defaultColor) { - if (data.current) { - return DiagramTaskComponent.CURRENT_COLOR; - } else if (data.completed) { - return DiagramTaskComponent.COMPLETED_COLOR; - } else { - return defaultColor; - } - } - - private bpmnGetStrokeWidth(data) { - if (data.current || data.completed) { - return DiagramTaskComponent.TASK_STROKE; - } else { - return DiagramTaskComponent.TASK_HIGHLIGHT_STROKE; - } - } - - private determineCustomFillColor(data) { - // TODO - return 'hsb(0.1966666666666667, 1, 1)'; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts index a182f9eaa5..2a4e480f23 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts @@ -18,6 +18,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { AnalyticsService } from '../../services/analytics.service'; +import { DiagramColorService } from './services/diagram-color.service'; @Component({ moduleId: module.id, @@ -26,44 +27,39 @@ import { AnalyticsService } from '../../services/analytics.service'; styleUrls: ['./diagram.component.css'] }) export class DiagramComponent { - @Input() - modelType: string; - - @Input() - processDefinitionId: string; + report: any; @Output() onError = new EventEmitter(); private diagram: any; - private element: ElementRef; + private elementRef: ElementRef; constructor(elementRef: ElementRef, private translate: AlfrescoTranslationService, + private diagramColorService: DiagramColorService, private analyticsService: AnalyticsService) { if (translate) { translate.addTranslationFolder('node_modules/ng2-activiti-analytics/src'); } - this.element = elementRef; + this.elementRef = elementRef; } ngOnInit() { - this.getProcessDefinitionModel(this.processDefinitionId); + this.getProcessDefinitionModel(this.report.processDefinitionId); + this.diagramColorService.setTotalColors(this.report.totalCountsPercentages); } getProcessDefinitionModel(processDefinitionId: string) { - if (this.modelType === 'process-definition') { - this.analyticsService.getProcessDefinitionModel(processDefinitionId).subscribe( - (res: any) => { - this.diagram = res; - console.log(res); - }, - (err: any) => { - this.onError.emit(err); - console.log(err); - } - ); - } + this.analyticsService.getProcessDefinitionModel(processDefinitionId).subscribe( + (res: any) => { + this.diagram = res; + }, + (err: any) => { + this.onError.emit(err); + console.log(err); + } + ); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index f5688f40fc..ead1b6e4ed 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -20,6 +20,8 @@ import { DiagramEventComponent } from './diagram-event.component'; import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component'; +import { DiagramColorService } from './services/diagram-color.service'; + // primitives export * from './diagram.component'; export * from './diagram-event.component'; @@ -32,3 +34,7 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DiagramTaskComponent, DiagramSequenceFlowComponent ]; + +export const DIAGRAM_PROVIDERS: any[] = [ + DiagramColorService +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts new file mode 100644 index 0000000000..3a918d1c54 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Injectable } from '@angular/core'; + +@Injectable() +export class DiagramColorService { + + static CURRENT_COLOR = '#017501'; + static COMPLETED_COLOR = '#2632aa'; + static ACTIVITY_STROKE_COLOR = '#bbbbbb'; + + static TASK_STROKE = '1'; + static TASK_HIGHLIGHT_STROKE = '2'; + + totalColors: any; + + constructor() { + } + + setTotalColors(totalColors) { + this.totalColors = totalColors; + } + + getFillOpacity(): string { + return '0.6'; + } + + getFillColour(key: string) { + if (this.totalColors.hasOwnProperty(key)) { + let colorPercentage = this.totalColors[key]; + return this.convertColorToHsb(colorPercentage); + } + } + + getBpmnColor(data, defaultColor) { + if (data.current) { + return DiagramColorService.CURRENT_COLOR; + } else if (data.completed) { + return DiagramColorService.COMPLETED_COLOR; + } else { + return defaultColor; + } + } + + getBpmnStrokeWidth(data) { + if (data.current || data.completed) { + return DiagramColorService.TASK_HIGHLIGHT_STROKE; + } else { + return DiagramColorService.TASK_STROKE; + } + } + + convertColorToHsb(colorPercentage: number): string { + let hue = (120.0 - (colorPercentage * 1.2)) / 360.0; + return 'hsb(' + hue + ', 1, 1)'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts index 0fbff9cf53..d4b147f914 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts @@ -38,7 +38,16 @@ export class RaphaelRectDirective extends RaphaelBase implements OnInit { radius: number = 0; @Input() - strokeWith: number; + fillColors: any; + + @Input() + stroke: any; + + @Input() + strokeWidth: any; + + @Input() + fillOpacity: any; @Output() onError = new EventEmitter(); @@ -50,7 +59,7 @@ export class RaphaelRectDirective extends RaphaelBase implements OnInit { ngOnInit() { console.log(this.elementRef); - let opts = {'stroke-width': this.strokeWith}; + let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; this.draw(this.leftCorner, this.width, this.height, this.radius, opts); } From 125065ed6f4c3cf41368abe2ee3001c667dc49e2 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 10:06:50 +0100 Subject: [PATCH 09/61] Add DiagramExclusiveGatway --- .../diagram-exclusive-gateway.component.html | 4 ++ .../diagram-exclusive-gateway.component.ts | 48 +++++++++++++ .../diagrams/diagram.component.html | 7 +- .../src/components/diagrams/index.ts | 5 +- .../services/diagram-color.service.ts | 7 +- .../src/components/raphael/index.ts | 8 ++- .../raphael/raphael-cross.component.ts | 71 +++++++++++++++++++ .../raphael/raphael-rhombus.component.ts | 67 +++++++++++++++++ .../src/models/report.model.ts | 2 +- 9 files changed, 211 insertions(+), 8 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html new file mode 100644 index 0000000000..ef7c4a1a07 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts new file mode 100644 index 0000000000..9c28359fb0 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-exclusive-gateway', + templateUrl: './diagram-exclusive-gateway.component.html', + styleUrls: ['./diagram-exclusive-gateway.component.css'] +}) +export class DiagramExclusiveGatwayComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x; + this.center.y = this.data.y; + + this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.data.fillOpacity = this.diagramColorService.getFillOpacity(); + this.data.strokeWidth = 3; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 8dace98ec9..c557f9758d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -4,13 +4,12 @@
-
-
+
+ +
-
-
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index ead1b6e4ed..07aedfa9bb 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -19,6 +19,7 @@ import { DiagramComponent } from './diagram.component'; import { DiagramEventComponent } from './diagram-event.component'; import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component'; +import { DiagramExclusiveGatwayComponent } from './diagram-exclusive-gateway.component'; import { DiagramColorService } from './services/diagram-color.service'; @@ -27,12 +28,14 @@ export * from './diagram.component'; export * from './diagram-event.component'; export * from './diagram-task.component'; export * from './diagram-sequence-flow.component'; +export * from './diagram-exclusive-gateway.component'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, DiagramEventComponent, DiagramTaskComponent, - DiagramSequenceFlowComponent + DiagramSequenceFlowComponent, + DiagramExclusiveGatwayComponent ]; export const DIAGRAM_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts index 3a918d1c54..9df420e968 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts @@ -23,6 +23,9 @@ 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'; @@ -41,9 +44,11 @@ export class DiagramColorService { } getFillColour(key: string) { - if (this.totalColors.hasOwnProperty(key)) { + if (this.totalColors && this.totalColors.hasOwnProperty(key)) { let colorPercentage = this.totalColors[key]; return this.convertColorToHsb(colorPercentage); + } else { + return DiagramColorService.ACTIVITY_FILL_COLOR; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 8735c53d4e..201b7dad26 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -19,16 +19,22 @@ import { RaphaelCircleDirective } from './raphael-circle.component'; import { RaphaelRectDirective } from './raphael-rect.component'; import { RaphaelTextDirective } from './raphael-text.component'; import { RaphaelFlowArrowDirective } from './raphael-flow-arrow.component'; +import { RaphaelCrossDirective } from './raphael-cross.component'; +import { RaphaelRhombusDirective } from './raphael-rhombus.component'; // primitives export * from './raphael-circle.component'; export * from './raphael-rect.component'; export * from './raphael-text.component'; export * from './raphael-flow-arrow.component'; +export * from './raphael-cross.component'; +export * from './raphael-rhombus.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, RaphaelRectDirective, RaphaelTextDirective, - RaphaelFlowArrowDirective + RaphaelFlowArrowDirective, + RaphaelCrossDirective, + RaphaelRhombusDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts new file mode 100644 index 0000000000..e023868792 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts @@ -0,0 +1,71 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-cross'}) +export class RaphaelCrossDirective extends RaphaelBase implements OnInit { + @Input() + center: Point; + + @Input() + width: number; + + @Input() + height: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + strokeWidth: any; + + @Input() + fillOpacity: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + let 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) { + let quarterWidth = width / 4; + let quarterHeight = height / 4; + + return this.paper.path( + 'M' + (center.x + quarterWidth + 3) + ' ' + (center.y + quarterHeight + 3) + + 'L' + (center.x + 3 * quarterWidth - 3) + ' ' + (center.y + 3 * quarterHeight - 3) + + 'M' + (center.x + quarterWidth + 3) + ' ' + (center.y + 3 * quarterHeight - 3) + + 'L' + (center.x + 3 * quarterWidth - 3) + ' ' + (center.y + quarterHeight + 3) + ).attr(opts); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts new file mode 100644 index 0000000000..08e2d7d3fd --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-rhombus'}) +export class RaphaelRhombusDirective extends RaphaelBase implements OnInit { + @Input() + center: Point; + + @Input() + width: number; + + @Input() + height: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + strokeWidth: any; + + @Input() + fillOpacity: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + let 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) { + 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)) + + 'L' + (center.x + (width / 2)) + ' ' + center.y + 'z' + ).attr(opts); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/models/report.model.ts b/ng2-components/ng2-activiti-analytics/src/models/report.model.ts index fa65f9d4b2..549f841add 100644 --- a/ng2-components/ng2-activiti-analytics/src/models/report.model.ts +++ b/ng2-components/ng2-activiti-analytics/src/models/report.model.ts @@ -120,7 +120,7 @@ export class ReportQuery { this.status = obj && obj.status || null; this.taskName = obj && obj.taskName || null; this.dateRangeInterval = obj && obj.dateRangeInterval || null; - this.typeFiltering = obj && obj.typeFiltering || false; + this.typeFiltering = obj && obj.typeFiltering || true; this.slowProcessInstanceInteger = obj && obj.slowProcessInstanceInteger || 0; this.duration = obj && obj.duration || 0; this.dateRange = new ReportDateRange(obj); From 5516c8a28bea617e3123b13fc2aeefdd33e32596 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 10:19:30 +0100 Subject: [PATCH 10/61] Fix diagram event properties color --- .../diagrams/diagram-event.component.html | 3 ++- .../components/diagrams/diagram-event.component.ts | 10 +++++++++- .../components/raphael/raphael-circle.component.ts | 13 +++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html index d965900f2d..83ec775c87 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts index db510db849..178b73e304 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts @@ -16,6 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './services/diagram-color.service'; @Component({ moduleId: module.id, @@ -38,11 +39,18 @@ export class DiagramEventComponent { center: any = {}; - constructor(public elementRef: ElementRef) {} + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} ngOnInit() { console.log(this.elementRef); this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); + + this.data.radius = this.radius; + this.data.strokeWidth = this.strokeWidth; + this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.data.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts index a1a81edebc..566ceb0754 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts @@ -32,7 +32,16 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { radius: number; @Input() - strokeWith: number; + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; @Output() onError = new EventEmitter(); @@ -44,7 +53,7 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { ngOnInit() { console.log(this.elementRef); - let opts = {'stroke-width': this.strokeWith}; + let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; this.draw(this.center, this.radius, opts); } From eb24465e775287fd02c2d7a849b59a88d60f7831 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 10:45:46 +0100 Subject: [PATCH 11/61] Move gateway in a subfolder --- .../diagram-exclusive-gateway.component.html | 0 .../diagram-exclusive-gateway.component.ts | 4 +-- .../src/components/diagrams/gateway/index.ts | 25 +++++++++++++++++++ .../src/components/diagrams/index.ts | 6 ++--- 4 files changed, 30 insertions(+), 5 deletions(-) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => gateway}/diagram-exclusive-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => gateway}/diagram-exclusive-gateway.component.ts (92%) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts similarity index 92% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts index 9c28359fb0..d1617c855d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-exclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './services/diagram-color.service'; +import { DiagramColorService } from './../services/diagram-color.service'; @Component({ moduleId: module.id, @@ -24,7 +24,7 @@ import { DiagramColorService } from './services/diagram-color.service'; templateUrl: './diagram-exclusive-gateway.component.html', styleUrls: ['./diagram-exclusive-gateway.component.css'] }) -export class DiagramExclusiveGatwayComponent { +export class DiagramExclusiveGatewayComponent { @Input() data: any; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts new file mode 100644 index 0000000000..d61a45b52d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component'; + +// primitives +export * from './diagram-exclusive-gateway.component'; + +export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [ + DiagramExclusiveGatewayComponent +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index 07aedfa9bb..9a7f63afba 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -19,7 +19,8 @@ import { DiagramComponent } from './diagram.component'; import { DiagramEventComponent } from './diagram-event.component'; import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component'; -import { DiagramExclusiveGatwayComponent } from './diagram-exclusive-gateway.component'; + +import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateway/index'; import { DiagramColorService } from './services/diagram-color.service'; @@ -28,14 +29,13 @@ export * from './diagram.component'; export * from './diagram-event.component'; export * from './diagram-task.component'; export * from './diagram-sequence-flow.component'; -export * from './diagram-exclusive-gateway.component'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, DiagramEventComponent, DiagramTaskComponent, DiagramSequenceFlowComponent, - DiagramExclusiveGatwayComponent + DIAGRAM_GATEWAY_DIRECTIVES ]; export const DIAGRAM_PROVIDERS: any[] = [ From 6b26a085e50209a2cc8768bf3d43a3b579327aa4 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 10:56:12 +0100 Subject: [PATCH 12/61] create diagram-gateway as base component --- .../diagram-exclusive-gateway.component.html | 3 +- .../gateway/diagram-gateway.component.html | 2 + .../gateway/diagram-gateway.component.ts | 48 +++++++++++++++++++ .../src/components/diagrams/gateway/index.ts | 3 ++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html index ef7c4a1a07..251eaef460 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html @@ -1,4 +1,3 @@ - + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html new file mode 100644 index 0000000000..24f216a19d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts new file mode 100644 index 0000000000..7c056e8a00 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-gateway', + templateUrl: './diagram-gateway.component.html', + styleUrls: ['./diagram-gateway.component.css'] +}) +export class DiagramGatewayComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x; + this.center.y = this.data.y; + + this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.data.fillOpacity = this.diagramColorService.getFillOpacity(); + this.data.strokeWidth = 2; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts index d61a45b52d..86e00a4ca6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts @@ -15,11 +15,14 @@ * limitations under the License. */ +import { DiagramGatewayComponent } from './diagram-gateway.component'; import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component'; // primitives +export * from './diagram-gateway.component'; export * from './diagram-exclusive-gateway.component'; export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [ + DiagramGatewayComponent, DiagramExclusiveGatewayComponent ]; From 4b2d5ecee4b127e52d9b46894a122ef00c2cb38b Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 11:52:33 +0100 Subject: [PATCH 13/61] Add diagram parallel gateway --- .../diagram-parallel-gateway.component.html | 3 + .../diagram-parallel-gateway.component.ts | 52 +++++++++++++++++ .../src/components/diagrams/gateway/index.ts | 5 +- .../src/components/raphael/index.ts | 3 + .../raphael/raphael-plus.component.ts | 58 +++++++++++++++++++ 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html new file mode 100644 index 0000000000..434135a5b7 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts new file mode 100644 index 0000000000..9d344b34d1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-parallel-gateway', + templateUrl: './diagram-parallel-gateway.component.html', + styleUrls: ['./diagram-parallel-gateway.component.css'] +}) +export class DiagramParallelGatewayComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + width: any; + height: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 3}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x; + this.center.y = this.data.y; + this.width = this.data.width; + this.height = this.data.height; + + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts index 86e00a4ca6..771c6af1cb 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts @@ -17,12 +17,15 @@ import { DiagramGatewayComponent } from './diagram-gateway.component'; import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component'; +import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component'; // primitives export * from './diagram-gateway.component'; export * from './diagram-exclusive-gateway.component'; +export * from './diagram-parallel-gateway.component'; export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [ DiagramGatewayComponent, - DiagramExclusiveGatewayComponent + DiagramExclusiveGatewayComponent, + DiagramParallelGatewayComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 201b7dad26..b1bea981bd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -20,6 +20,7 @@ import { RaphaelRectDirective } from './raphael-rect.component'; import { RaphaelTextDirective } from './raphael-text.component'; import { RaphaelFlowArrowDirective } from './raphael-flow-arrow.component'; import { RaphaelCrossDirective } from './raphael-cross.component'; +import { RaphaelPlusDirective } from './raphael-plus.component'; import { RaphaelRhombusDirective } from './raphael-rhombus.component'; // primitives @@ -28,6 +29,7 @@ export * from './raphael-rect.component'; export * from './raphael-text.component'; export * from './raphael-flow-arrow.component'; export * from './raphael-cross.component'; +export * from './raphael-plus.component'; export * from './raphael-rhombus.component'; export const RAPHAEL_DIRECTIVES: any[] = [ @@ -36,5 +38,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelTextDirective, RaphaelFlowArrowDirective, RaphaelCrossDirective, + RaphaelPlusDirective, RaphaelRhombusDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts new file mode 100644 index 0000000000..81db7bd020 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts @@ -0,0 +1,58 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-plus'}) +export class RaphaelPlusDirective extends RaphaelBase implements OnInit { + @Input() + center: Point; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + strokeWidth: any; + + @Input() + fillOpacity: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + let 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) { + let 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)); + } +} From da173d9d1ec942a411d5204e13febe1cfc6a1796 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 11:52:50 +0100 Subject: [PATCH 14/61] Refactoring options --- .../diagrams/diagram-event.component.html | 4 ++-- .../diagrams/diagram-event.component.ts | 11 +++++----- .../diagrams/diagram-task.component.html | 5 +++-- .../diagrams/diagram-task.component.ts | 20 +++++-------------- .../diagrams/diagram.component.html | 3 +++ .../diagram-exclusive-gateway.component.html | 4 ++-- .../diagram-exclusive-gateway.component.ts | 12 +++++++---- .../gateway/diagram-gateway.component.html | 4 ++-- .../gateway/diagram-gateway.component.ts | 12 +++++++---- 9 files changed, 39 insertions(+), 36 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html index 83ec775c87..c4de55c9cc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts index 178b73e304..a13e637db7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts @@ -38,6 +38,7 @@ export class DiagramEventComponent { onError = new EventEmitter(); center: any = {}; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} @@ -47,10 +48,10 @@ export class DiagramEventComponent { this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); - this.data.radius = this.radius; - this.data.strokeWidth = this.strokeWidth; - this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); - this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.data.fillOpacity = this.diagramColorService.getFillOpacity(); + this.options.radius = this.radius; + this.options.strokeWidth = this.strokeWidth; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html index 961479892a..fe7f52ec74 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html @@ -1,3 +1,4 @@ - + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts index eff9f54135..1efa86f934 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts @@ -28,33 +28,23 @@ export class DiagramTaskComponent { @Input() data: any; - options: any = {}; - @Output() onError = new EventEmitter(); - stroke: number; - rectLeftCorner: any; - radius: number = 4; - textPosition: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: 4}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} ngOnInit() { - console.log(this.elementRef); - - this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR); - this.data.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data); - this.data.fillOpacity = this.diagramColorService.getFillOpacity(); - this.rectLeftCorner = {x: this.data.x, y: this.data.y}; - this.textPosition = {x: this.data.x + ( this.data.width / 2 ), y: this.data.y + ( this.data.height / 2 )}; - this.options['id'] = this.data.id; + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.ACTIVITY_STROKE_COLOR); + this.options.strokeWidth = this.diagramColorService.getBpmnStrokeWidth(this.data); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index c557f9758d..787c3e43cc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -7,6 +7,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html index 251eaef460..a00dc1cad3 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html @@ -1,3 +1,3 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts index d1617c855d..d38da7d125 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts @@ -32,6 +32,9 @@ export class DiagramExclusiveGatewayComponent { onError = new EventEmitter(); center: any = {}; + width: any; + height: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 3}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} @@ -39,10 +42,11 @@ export class DiagramExclusiveGatewayComponent { ngOnInit() { this.center.x = this.data.x; this.center.y = this.data.y; + this.width = this.data.width; + this.height = this.data.height; - this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); - this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.data.fillOpacity = this.diagramColorService.getFillOpacity(); - this.data.strokeWidth = 3; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html index 24f216a19d..6550ba6dca 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts index 7c056e8a00..a2c275586a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts @@ -32,6 +32,9 @@ export class DiagramGatewayComponent { onError = new EventEmitter(); center: any = {}; + width: any; + height: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 2}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} @@ -39,10 +42,11 @@ export class DiagramGatewayComponent { ngOnInit() { this.center.x = this.data.x; this.center.y = this.data.y; + this.width = this.data.width; + this.height = this.data.height; - this.data.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); - this.data.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.data.fillOpacity = this.diagramColorService.getFillOpacity(); - this.data.strokeWidth = 2; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } } From 66cbc4f64b7e3fbcad0b92eedf866180dd7862d1 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 12:15:51 +0100 Subject: [PATCH 15/61] Add inclusive gatway component --- .../diagrams/diagram.component.html | 3 ++ .../diagram-inclusive-gateway.component.html | 3 ++ .../diagram-inclusive-gateway.component.ts | 50 +++++++++++++++++++ .../src/components/diagrams/gateway/index.ts | 3 ++ .../src/components/raphael/raphael.service.ts | 6 +-- 5 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 787c3e43cc..17c7db8080 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -7,6 +7,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html new file mode 100644 index 0000000000..f0c51dc5c1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts new file mode 100644 index 0000000000..51a421d2c9 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-inclusive-gateway', + templateUrl: './diagram-inclusive-gateway.component.html', + styleUrls: ['./diagram-inclusive-gateway.component.css'] +}) +export class DiagramInclusiveGatewayComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + width: any; + height: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 2.5, radius: 9.75}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + 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.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts index 771c6af1cb..e226fd0224 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts @@ -17,15 +17,18 @@ import { DiagramGatewayComponent } from './diagram-gateway.component'; import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component'; +import { DiagramInclusiveGatewayComponent } from './diagram-inclusive-gateway.component'; import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component'; // primitives export * from './diagram-gateway.component'; export * from './diagram-exclusive-gateway.component'; +export * from './diagram-inclusive-gateway.component'; export * from './diagram-parallel-gateway.component'; export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [ DiagramGatewayComponent, DiagramExclusiveGatewayComponent, + DiagramInclusiveGatewayComponent, DiagramParallelGatewayComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts index 8908461502..c948d918e8 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts @@ -43,9 +43,9 @@ export class RaphaelService { if (typeof Raphael === 'undefined') { throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); } - let paper = new Raphael(ctx, 583, 344.08374193550003); - paper.setViewBox(0, 0, 583, 344.08374193550003, false); - paper.renderfix(); + let paper = new Raphael(ctx, 1000, 500); + // paper.setViewBox(0, 0, 583, 344.08374193550003, false); + // paper.renderfix(); return paper; } From e673cd0cd98d90c1c757a705f9aa4149d49c1336 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 15:10:14 +0100 Subject: [PATCH 16/61] Add event gateway component --- .../diagrams/diagram.component.html | 3 + .../diagram-event-gateway.component.html | 7 ++ .../diagram-event-gateway.component.ts | 56 +++++++++++++++ .../src/components/diagrams/gateway/index.ts | 5 +- .../services/diagram-color.service.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael/raphael-pentagon.component.ts | 68 +++++++++++++++++++ 7 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 17c7db8080..075f17f953 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -10,6 +10,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html new file mode 100644 index 0000000000..bf3e80e11e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts new file mode 100644 index 0000000000..8d8bb108fb --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-event-gateway', + templateUrl: './diagram-event-gateway.component.html', + styleUrls: ['./diagram-event-gateway.component.css'] +}) +export class DiagramEventGatewayComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + centerPentagon: any = {}; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 0.5}; + + circleRadiusInner = 10.4; + circleRadiusOuter = 11.7; + + pentaStrokeWidth = 1.39999998; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + 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.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts index e226fd0224..cdf7470711 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts @@ -19,16 +19,19 @@ import { DiagramGatewayComponent } from './diagram-gateway.component'; import { DiagramExclusiveGatewayComponent } from './diagram-exclusive-gateway.component'; import { DiagramInclusiveGatewayComponent } from './diagram-inclusive-gateway.component'; import { DiagramParallelGatewayComponent } from './diagram-parallel-gateway.component'; +import { DiagramEventGatewayComponent } from './diagram-event-gateway.component'; // primitives export * from './diagram-gateway.component'; export * from './diagram-exclusive-gateway.component'; export * from './diagram-inclusive-gateway.component'; export * from './diagram-parallel-gateway.component'; +export * from './diagram-event-gateway.component'; export const DIAGRAM_GATEWAY_DIRECTIVES: any[] = [ DiagramGatewayComponent, DiagramExclusiveGatewayComponent, DiagramInclusiveGatewayComponent, - DiagramParallelGatewayComponent + DiagramParallelGatewayComponent, + DiagramEventGatewayComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts index 9df420e968..4e64dccc6f 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts @@ -27,8 +27,9 @@ export class DiagramColorService { static ACTIVITY_FILL_COLOR = '#f9f9f9'; - static TASK_STROKE = '1'; - static TASK_HIGHLIGHT_STROKE = '2'; + static TASK_STROKE = 1; + static TASK_HIGHLIGHT_STROKE = 2; + static CALL_ACTIVITY_STROKE = 2; totalColors: any; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index b1bea981bd..c3f98248da 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -22,6 +22,7 @@ import { RaphaelFlowArrowDirective } from './raphael-flow-arrow.component'; import { RaphaelCrossDirective } from './raphael-cross.component'; import { RaphaelPlusDirective } from './raphael-plus.component'; import { RaphaelRhombusDirective } from './raphael-rhombus.component'; +import { RaphaelPentagonDirective } from './raphael-pentagon.component'; // primitives export * from './raphael-circle.component'; @@ -31,6 +32,7 @@ export * from './raphael-flow-arrow.component'; export * from './raphael-cross.component'; export * from './raphael-plus.component'; export * from './raphael-rhombus.component'; +export * from './raphael-pentagon.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -39,5 +41,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelFlowArrowDirective, RaphaelCrossDirective, RaphaelPlusDirective, - RaphaelRhombusDirective + RaphaelRhombusDirective, + RaphaelPentagonDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts new file mode 100644 index 0000000000..cdc6a26892 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-pentagon'}) +export class RaphaelPentagonDirective extends RaphaelBase implements OnInit { + @Input() + center: Point; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + strokeWidth: any; + + @Input() + fillOpacity: any; + + @Input() + strokeLinejoin: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + let opts = { + 'stroke-width': this.strokeWidth, + 'fill': this.fillColors, + 'stroke': this.stroke, + 'fill-opacity': this.fillOpacity, + 'stroke-linejoin': 'bevel' + }; + this.draw(this.center, opts); + } + + public draw(center: Point, opts?: any) { + let penta = 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); + penta.transform('T' + (center.x + 4) + ',' + (center.y + 4)); + } +} From 0f3c0b425a1c682958d4206422e29184a16b0a61 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 15:25:16 +0100 Subject: [PATCH 17/61] Refactoring of directories --- .../diagram-task.component.html | 0 .../diagram-task.component.ts | 2 +- .../components/diagrams/activities/index.ts | 25 +++++++++++++++++++ .../{ => events}/diagram-event.component.html | 0 .../{ => events}/diagram-event.component.ts | 2 +- .../src/components/diagrams/events/index.ts | 25 +++++++++++++++++++ .../diagram-event-gateway.component.html | 0 .../diagram-event-gateway.component.ts | 0 .../diagram-exclusive-gateway.component.html | 0 .../diagram-exclusive-gateway.component.ts | 0 .../diagram-gateway.component.html | 0 .../diagram-gateway.component.ts | 0 .../diagram-inclusive-gateway.component.html | 0 .../diagram-inclusive-gateway.component.ts | 0 .../diagram-parallel-gateway.component.html | 0 .../diagram-parallel-gateway.component.ts | 0 .../diagrams/{gateway => gateways}/index.ts | 0 .../src/components/diagrams/index.ts | 15 ++++++----- 18 files changed, 59 insertions(+), 10 deletions(-) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => activities}/diagram-task.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => activities}/diagram-task.component.ts (96%) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => events}/diagram-event.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{ => events}/diagram-event.component.ts (96%) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-event-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-event-gateway.component.ts (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-exclusive-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-exclusive-gateway.component.ts (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-gateway.component.ts (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-inclusive-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-inclusive-gateway.component.ts (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-parallel-gateway.component.html (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/diagram-parallel-gateway.component.ts (100%) rename ng2-components/ng2-activiti-analytics/src/components/diagrams/{gateway => gateways}/index.ts (100%) diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts index 1efa86f934..ca76d87bb4 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './services/diagram-color.service'; +import { DiagramColorService } from './../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts new file mode 100644 index 0000000000..f0b19030d8 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramTaskComponent } from './diagram-task.component'; + +// primitives +export * from './diagram-task.component'; + +export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ + DiagramTaskComponent +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts index a13e637db7..f588272b0f 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './services/diagram-color.service'; +import { DiagramColorService } from './../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts new file mode 100644 index 0000000000..b879aad332 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramEventComponent } from './diagram-event.component'; + +// primitives +export * from './diagram-event.component'; + +export const DIAGRAM_EVENTS_DIRECTIVES: any[] = [ + DiagramEventComponent +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-event-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-exclusive-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-inclusive-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.html rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/diagram-parallel-gateway.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateway/index.ts rename to ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index 9a7f63afba..5b4c7716c8 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -16,24 +16,23 @@ */ import { DiagramComponent } from './diagram.component'; -import { DiagramEventComponent } from './diagram-event.component'; -import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component'; - -import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateway/index'; +import { DIAGRAM_ACTIVITIES_DIRECTIVES } from './activities/index'; +import { DIAGRAM_EVENTS_DIRECTIVES } from './events/index'; +import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index'; import { DiagramColorService } from './services/diagram-color.service'; // primitives export * from './diagram.component'; -export * from './diagram-event.component'; -export * from './diagram-task.component'; +export * from './events/index'; +export * from './activities/index'; export * from './diagram-sequence-flow.component'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, - DiagramEventComponent, - DiagramTaskComponent, + DIAGRAM_EVENTS_DIRECTIVES, + DIAGRAM_ACTIVITIES_DIRECTIVES, DiagramSequenceFlowComponent, DIAGRAM_GATEWAY_DIRECTIVES ]; From fb8b640db030ddf7b241049d7148fc10cc71c220 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 17:11:14 +0100 Subject: [PATCH 18/61] Add diagram icon service and diagram icon send components --- ...gram-container-service-task.component.html | 8 +++ ...iagram-container-service-task.component.ts | 38 ++++++++++ .../diagram-send-task.component.html | 2 + .../activities/diagram-send-task.component.ts | 38 ++++++++++ .../diagram-service-task.component.html | 2 + .../diagram-service-task.component.ts | 40 +++++++++++ .../components/diagrams/activities/index.ts | 11 ++- .../diagrams/diagram.component.html | 3 + .../diagram-icon-send-task.component.html | 1 + .../icons/diagram-icon-send-task.component.ts | 42 +++++++++++ .../diagram-icon-service-task.component.html | 1 + .../diagram-icon-service-task.component.ts | 42 +++++++++++ .../src/components/diagrams/icons/index.ts | 28 ++++++++ .../src/components/diagrams/index.ts | 5 +- .../src/components/raphael/index.ts | 11 ++- .../raphael/raphael-icon-send.component.ts | 55 ++++++++++++++ .../raphael/raphael-icon-service.component.ts | 72 +++++++++++++++++++ 17 files changed, 396 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html new file mode 100644 index 0000000000..2e8c599e66 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -0,0 +1,8 @@ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts new file mode 100644 index 0000000000..103a392853 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-container-service-task', + templateUrl: './diagram-container-service-task.component.html', + styleUrls: ['./diagram-container-service-task.component.css'] +}) +export class DiagramContainerServiceTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html new file mode 100644 index 0000000000..1d62444634 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts new file mode 100644 index 0000000000..8231c8cee1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-send-task', + templateUrl: './diagram-send-task.component.html', + styleUrls: ['./diagram-send-task.component.css'] +}) +export class DiagramSendTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html new file mode 100644 index 0000000000..06e28b4019 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts new file mode 100644 index 0000000000..bfc704966d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-service-task', + templateUrl: './diagram-service-task.component.html', + styleUrls: ['./diagram-service-task.component.css'] +}) +export class DiagramServiceTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index f0b19030d8..01e7bb0673 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -15,11 +15,20 @@ * limitations under the License. */ +import { DiagramContainerServiceTaskComponent } from './diagram-container-service-task.component'; import { DiagramTaskComponent } from './diagram-task.component'; +import { DiagramServiceTaskComponent } from './diagram-service-task.component'; +import { DiagramSendTaskComponent } from './diagram-send-task.component'; // primitives +export * from './diagram-container-service-task.component'; export * from './diagram-task.component'; +export * from './diagram-service-task.component'; +export * from './diagram-send-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ - DiagramTaskComponent + DiagramContainerServiceTaskComponent, + DiagramTaskComponent, + DiagramServiceTaskComponent, + DiagramSendTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 075f17f953..a7c2632709 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -22,6 +22,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html new file mode 100644 index 0000000000..b1379fb2e6 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts new file mode 100644 index 0000000000..da3ed8f401 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-send-task', + templateUrl: './diagram-icon-send-task.component.html', + styleUrls: ['./diagram-icon-send-task.component.css'] +}) +export class DiagramIconSendTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html new file mode 100644 index 0000000000..eac52f9799 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts new file mode 100644 index 0000000000..47f03c6a18 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-service-task', + templateUrl: './diagram-icon-service-task.component.html', + styleUrls: ['./diagram-icon-service-task.component.css'] +}) +export class DiagramIconServiceTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts new file mode 100644 index 0000000000..41b0f89621 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -0,0 +1,28 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramIconServiceTaskComponent } from './diagram-icon-service-task.component'; +import { DiagramIconSendTaskComponent } from './diagram-icon-send-task.component'; + +// primitives +export * from './diagram-icon-service-task.component'; +export * from './diagram-icon-send-task.component'; + +export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ + DiagramIconServiceTaskComponent, + DiagramIconSendTaskComponent +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index 5b4c7716c8..983ea885f0 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -20,6 +20,7 @@ import { DiagramSequenceFlowComponent } from './diagram-sequence-flow.component' import { DIAGRAM_ACTIVITIES_DIRECTIVES } from './activities/index'; import { DIAGRAM_EVENTS_DIRECTIVES } from './events/index'; import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index'; +import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index'; import { DiagramColorService } from './services/diagram-color.service'; @@ -27,6 +28,7 @@ import { DiagramColorService } from './services/diagram-color.service'; export * from './diagram.component'; export * from './events/index'; export * from './activities/index'; +export * from './icons/index'; export * from './diagram-sequence-flow.component'; export const DIAGRAM_DIRECTIVES: any[] = [ @@ -34,7 +36,8 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DIAGRAM_EVENTS_DIRECTIVES, DIAGRAM_ACTIVITIES_DIRECTIVES, DiagramSequenceFlowComponent, - DIAGRAM_GATEWAY_DIRECTIVES + DIAGRAM_GATEWAY_DIRECTIVES, + DIAGRAM_ICONS_DIRECTIVES ]; export const DIAGRAM_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index c3f98248da..64de675531 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -24,6 +24,10 @@ import { RaphaelPlusDirective } from './raphael-plus.component'; import { RaphaelRhombusDirective } from './raphael-rhombus.component'; import { RaphaelPentagonDirective } from './raphael-pentagon.component'; +// icons +import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; +import { RaphaelIconSendDirective } from './raphael-icon-send.component'; + // primitives export * from './raphael-circle.component'; export * from './raphael-rect.component'; @@ -34,6 +38,9 @@ export * from './raphael-plus.component'; export * from './raphael-rhombus.component'; export * from './raphael-pentagon.component'; +export * from './raphael-icon-service.component'; +export * from './raphael-icon-send.component'; + export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, RaphaelRectDirective, @@ -42,5 +49,7 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCrossDirective, RaphaelPlusDirective, RaphaelRhombusDirective, - RaphaelPentagonDirective + RaphaelPentagonDirective, + RaphaelIconServiceDirective, + RaphaelIconSendDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts new file mode 100644 index 0000000000..ddcc186a8b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts @@ -0,0 +1,55 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-send'}) +export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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': 'none', + 'fill': '#16964d' + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts new file mode 100644 index 0000000000..4fbb20c99c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-service'}) +export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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' + + ' 0.002,0.00849 -0.00169,0.022138 0,0.03125 C 3.6092802,6.3336971 3.4929791,6.6676654 3.375,7 3.3629836,7.0338489' + + ' 3.3239228,7.0596246 3.3125,7.09375 3.125763,7.4756184 2.875,7.5 2.875,7.5 L 1,8 l 0,2 1.875,0.5 c 0,0 0.250763,0.02438' + + ' 0.4375,0.40625 0.017853,0.03651 0.046318,0.04988 0.0625,0.09375 0.1129372,0.318132 0.2124732,0.646641 0.375,0.9375' + + ' -0.00302,0.215512 -0.09375,0.34375 -0.09375,0.34375 L 2.6875,13.9375 4.09375,15.34375 5.78125,14.375 c 0,0' + + ' 0.1229911,-0.09744 0.34375,-0.09375 0.2720511,0.147787 0.5795915,0.23888 0.875,0.34375 0.033849,0.01202 0.059625,0.05108' + + ' 0.09375,0.0625 C 7.4756199,14.874237 7.5,15.125 7.5,15.125 L 8,17 l 2,0 0.5,-1.875 c 0,0 0.02438,-0.250763 0.40625,-0.4375' + + ' 0.03651,-0.01785 0.04988,-0.04632 0.09375,-0.0625 0.332335,-0.117979 0.666303,-0.23428 0.96875,-0.40625 0.177303,0.0173' + + ' 0.28125,0.09375 0.28125,0.09375 l 1.65625,0.96875 1.40625,-1.40625 -0.96875,-1.65625 c 0,0 -0.07645,-0.103947' + + ' -0.09375,-0.28125 0.162527,-0.290859 0.262063,-0.619368 0.375,-0.9375 0.01618,-0.04387 0.04465,-0.05724 0.0625,-0.09375 C' + + ' 14.874237,10.52438 15.125,10.5 15.125,10.5 L 17,10 17,8 15.125,7.5 c 0,0 -0.250763,-0.024382 -0.4375,-0.40625 C' + + ' 14.669647,7.0572406 14.641181,7.0438697 14.625,7 14.55912,6.8144282 14.520616,6.6141566 14.4375,6.4375 c -0.224363,-0.4866' + + ' 0,-0.71875 0,-0.71875 L 15.40625,4.0625 14,2.625 l -1.65625,1 c 0,0 -0.253337,0.1695664 -0.71875,-0.03125 l -0.03125,0 C' + + ' 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': 'none', + 'fill': '#72a7d0' + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From e14876f8a7aa583cc966e2877de5d4259bcdbbff Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 21 Oct 2016 17:31:20 +0100 Subject: [PATCH 19/61] Add user task icon component --- .../diagram-user-task.component.html | 2 + .../activities/diagram-user-task.component.ts | 40 +++++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagrams/diagram.component.html | 2 +- .../diagram-icon-user-task.component.html | 1 + .../icons/diagram-icon-user-task.component.ts | 42 ++++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael/raphael-icon-user.component.ts | 57 +++++++++++++++++++ 9 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html new file mode 100644 index 0000000000..cb4c4a602a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts new file mode 100644 index 0000000000..52d30f0147 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-user-task', + templateUrl: './diagram-user-task.component.html', + styleUrls: ['./diagram-user-task.component.css'] +}) +export class DiagramUserTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 01e7bb0673..0acee143df 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -19,16 +19,19 @@ import { DiagramContainerServiceTaskComponent } from './diagram-container-servic import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramServiceTaskComponent } from './diagram-service-task.component'; import { DiagramSendTaskComponent } from './diagram-send-task.component'; +import { DiagramUserTaskComponent } from './diagram-user-task.component'; // primitives export * from './diagram-container-service-task.component'; export * from './diagram-task.component'; export * from './diagram-service-task.component'; export * from './diagram-send-task.component'; +export * from './diagram-user-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, DiagramTaskComponent, DiagramServiceTaskComponent, - DiagramSendTaskComponent + DiagramSendTaskComponent, + DiagramUserTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index a7c2632709..d79f693d9c 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -20,7 +20,7 @@
- +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html new file mode 100644 index 0000000000..e75e391254 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts new file mode 100644 index 0000000000..32e1aa27de --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-user-task', + templateUrl: './diagram-icon-user-task.component.html', + styleUrls: ['./diagram-icon-user-task.component.css'] +}) +export class DiagramIconUserTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 41b0f89621..bf0dd278a3 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -17,12 +17,15 @@ import { DiagramIconServiceTaskComponent } from './diagram-icon-service-task.component'; import { DiagramIconSendTaskComponent } from './diagram-icon-send-task.component'; +import { DiagramIconUserTaskComponent } from './diagram-icon-user-task.component'; // primitives export * from './diagram-icon-service-task.component'; export * from './diagram-icon-send-task.component'; +export * from './diagram-icon-user-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, - DiagramIconSendTaskComponent + DiagramIconSendTaskComponent, + DiagramIconUserTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 64de675531..08fd9635e7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -27,6 +27,7 @@ import { RaphaelPentagonDirective } from './raphael-pentagon.component'; // icons import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; import { RaphaelIconSendDirective } from './raphael-icon-send.component'; +import { RaphaelIconUserDirective } from './raphael-icon-user.component'; // primitives export * from './raphael-circle.component'; @@ -40,6 +41,7 @@ export * from './raphael-pentagon.component'; export * from './raphael-icon-service.component'; export * from './raphael-icon-send.component'; +export * from './raphael-icon-user.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -51,5 +53,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelRhombusDirective, RaphaelPentagonDirective, RaphaelIconServiceDirective, - RaphaelIconSendDirective + RaphaelIconSendDirective, + RaphaelIconUserDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts new file mode 100644 index 0000000000..a699e5519d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts @@ -0,0 +1,57 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-user'}) +export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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': 'none', + 'fill': '#d1b575' + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From a93f72cf3785c78046ce30cc59162ed61ec56445 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 10:41:50 +0100 Subject: [PATCH 20/61] Move the icons options as input parameters --- .../icons/diagram-icon-send-task.component.html | 3 ++- .../icons/diagram-icon-send-task.component.ts | 4 ++++ .../diagram-icon-service-task.component.html | 3 ++- .../icons/diagram-icon-service-task.component.ts | 4 ++++ .../icons/diagram-icon-user-task.component.html | 3 ++- .../icons/diagram-icon-user-task.component.ts | 4 ++++ .../raphael/raphael-icon-send.component.ts | 16 ++++++++++++++-- .../raphael/raphael-icon-service.component.ts | 16 ++++++++++++++-- .../raphael/raphael-icon-user.component.ts | 16 ++++++++++++++-- 9 files changed, 60 insertions(+), 9 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html index b1379fb2e6..50185da5f6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts index da3ed8f401..4571b4de60 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts @@ -33,10 +33,14 @@ export class DiagramIconSendTaskComponent { position: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} ngOnInit() { this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#16964d' ; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html index eac52f9799..1b903589eb 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts index 47f03c6a18..3562a03862 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts @@ -33,10 +33,14 @@ export class DiagramIconServiceTaskComponent { position: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} ngOnInit() { this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#72a7d0' ; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html index e75e391254..f7ff508324 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts index 32e1aa27de..7ad6801a30 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts @@ -33,10 +33,14 @@ export class DiagramIconUserTaskComponent { position: any; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} ngOnInit() { this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#d1b575' ; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts index ddcc186a8b..b90240fa48 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts @@ -34,6 +34,18 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { @Output() onError = new EventEmitter(); + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + constructor(public elementRef: ElementRef, raphaelService: RaphaelService) { super(elementRef, raphaelService); @@ -47,8 +59,8 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { public draw(position: Point) { let 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': 'none', - 'fill': '#16964d' + 'stroke': this.stroke, + 'fill': this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts index 4fbb20c99c..8706ffc313 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts @@ -34,6 +34,18 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { @Output() onError = new EventEmitter(); + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + constructor(public elementRef: ElementRef, raphaelService: RaphaelService) { super(elementRef, raphaelService); @@ -64,8 +76,8 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { ' 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': 'none', - 'fill': '#72a7d0' + 'stroke': this.stroke, + 'fill': this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts index a699e5519d..d1b91833f2 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts @@ -34,6 +34,18 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { @Output() onError = new EventEmitter(); + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + constructor(public elementRef: ElementRef, raphaelService: RaphaelService) { super(elementRef, raphaelService); @@ -49,8 +61,8 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { 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': 'none', - 'fill': '#d1b575' + 'stroke': this.stroke, + 'fill': this.fillColors }); return path1.transform('T' + position.x + ',' + position.y); } From 0e217c49db6760e91e53cc09c832ba5a7aa59dc6 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 11:01:03 +0100 Subject: [PATCH 21/61] Add manual task component --- .../diagram-manual-task.component.html | 2 + .../diagram-manual-task.component.ts | 40 ++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagrams/diagram.component.html | 3 + .../diagram-icon-manual-task.component.html | 2 + .../diagram-icon-manual-task.component.ts | 46 +++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael/raphael-icon-manual.component.ts | 76 +++++++++++++++++++ 9 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html new file mode 100644 index 0000000000..35c1d11660 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts new file mode 100644 index 0000000000..5ed71e9ab5 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-manual-task', + templateUrl: './diagram-manual-task.component.html', + styleUrls: ['./diagram-manual-task.component.css'] +}) +export class DiagramManualTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 0acee143df..cdef8928ee 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -20,6 +20,7 @@ import { DiagramTaskComponent } from './diagram-task.component'; import { DiagramServiceTaskComponent } from './diagram-service-task.component'; import { DiagramSendTaskComponent } from './diagram-send-task.component'; import { DiagramUserTaskComponent } from './diagram-user-task.component'; +import { DiagramManualTaskComponent } from './diagram-manual-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -27,11 +28,13 @@ export * from './diagram-task.component'; export * from './diagram-service-task.component'; export * from './diagram-send-task.component'; export * from './diagram-user-task.component'; +export * from './diagram-manual-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, DiagramTaskComponent, DiagramServiceTaskComponent, DiagramSendTaskComponent, - DiagramUserTaskComponent + DiagramUserTaskComponent, + DiagramManualTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index d79f693d9c..a2741bbffb 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -22,6 +22,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html new file mode 100644 index 0000000000..fbd042895e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts new file mode 100644 index 0000000000..39de990bb9 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-manual-task', + templateUrl: './diagram-icon-manual-task.component.html', + styleUrls: ['./diagram-icon-manual-task.component.css'] +}) +export class DiagramIconManualTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#d1b575' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index bf0dd278a3..271485059c 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -18,14 +18,17 @@ import { DiagramIconServiceTaskComponent } from './diagram-icon-service-task.component'; import { DiagramIconSendTaskComponent } from './diagram-icon-send-task.component'; import { DiagramIconUserTaskComponent } from './diagram-icon-user-task.component'; +import { DiagramIconManualTaskComponent } from './diagram-icon-manual-task.component'; // primitives export * from './diagram-icon-service-task.component'; export * from './diagram-icon-send-task.component'; export * from './diagram-icon-user-task.component'; +export * from './diagram-icon-manual-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, DiagramIconSendTaskComponent, - DiagramIconUserTaskComponent + DiagramIconUserTaskComponent, + DiagramIconManualTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 08fd9635e7..8c5c92191a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -28,6 +28,7 @@ import { RaphaelPentagonDirective } from './raphael-pentagon.component'; import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; import { RaphaelIconSendDirective } from './raphael-icon-send.component'; import { RaphaelIconUserDirective } from './raphael-icon-user.component'; +import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; // primitives export * from './raphael-circle.component'; @@ -42,6 +43,7 @@ export * from './raphael-pentagon.component'; export * from './raphael-icon-service.component'; export * from './raphael-icon-send.component'; export * from './raphael-icon-user.component'; +export * from './raphael-icon-manual.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -54,5 +56,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelPentagonDirective, RaphaelIconServiceDirective, RaphaelIconSendDirective, - RaphaelIconUserDirective + RaphaelIconUserDirective, + RaphaelIconManualDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts new file mode 100644 index 0000000000..4e4bc311a2 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts @@ -0,0 +1,76 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-manual'}) +export class RaphaelIconManualDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + c 0.454137,-0.0096 0.872112,0.461754 0.866386,0.977186 C 13.619526,14.554106 13.206293,15.009498 12.75924,15 L 3.7753054,15 + C 3.6045812,15 3.433552,14.94423 3.2916363,14.837136 c -0.00174,0 -0.00436,0 -0.00609,0 C 1.7212035,14.367801 + 0.99998255,11.458641 1,11.458641 L 1,7.4588393 c 0,0 0.6623144,-1.316333 1.8390583,-2.0872584 1.1767614,-0.7711868 + 6.8053358,-2.40497 7.2587847,-2.8052901 0.453484,-0.40032 1.660213,1.4859942 0.04775,2.4010487 C 8.5332315,5.882394 + 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 9b4e4493884722f21ee60345ddcf8c403eead381 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 11:33:20 +0100 Subject: [PATCH 22/61] Add Camel task component --- .../diagram-camel-task.component.html | 2 + .../diagram-camel-task.component.ts | 38 +++++++++ ...gram-container-service-task.component.html | 3 + .../components/diagrams/activities/index.ts | 5 +- .../diagram-icon-camel-task.component.html | 2 + .../diagram-icon-camel-task.component.ts | 46 ++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael/raphael-icon-camel.component.ts | 85 +++++++++++++++++++ 9 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html new file mode 100644 index 0000000000..da76d3bb68 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts new file mode 100644 index 0000000000..55e9aa26f9 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-camel-task', + templateUrl: './diagram-camel-task.component.html', + styleUrls: ['./diagram-camel-task.component.css'] +}) +export class DiagramCamelTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index 2e8c599e66..6298e3fa86 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -2,6 +2,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index cdef8928ee..8191f51a24 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -21,6 +21,7 @@ import { DiagramServiceTaskComponent } from './diagram-service-task.component'; import { DiagramSendTaskComponent } from './diagram-send-task.component'; import { DiagramUserTaskComponent } from './diagram-user-task.component'; import { DiagramManualTaskComponent } from './diagram-manual-task.component'; +import { DiagramCamelTaskComponent } from './diagram-camel-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -29,6 +30,7 @@ export * from './diagram-service-task.component'; export * from './diagram-send-task.component'; export * from './diagram-user-task.component'; export * from './diagram-manual-task.component'; +export * from './diagram-camel-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -36,5 +38,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramServiceTaskComponent, DiagramSendTaskComponent, DiagramUserTaskComponent, - DiagramManualTaskComponent + DiagramManualTaskComponent, + DiagramCamelTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html new file mode 100644 index 0000000000..7404657ae5 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts new file mode 100644 index 0000000000..7a223c7c1a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-camel-task', + templateUrl: './diagram-icon-camel-task.component.html', + styleUrls: ['./diagram-icon-camel-task.component.css'] +}) +export class DiagramIconCamelTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 8, y: this.data.y + 6}; + this.options.stroke = 'none' ; + this.options.fillColors = '#bd4848' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 271485059c..b4668ef195 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -19,16 +19,19 @@ import { DiagramIconServiceTaskComponent } from './diagram-icon-service-task.com import { DiagramIconSendTaskComponent } from './diagram-icon-send-task.component'; import { DiagramIconUserTaskComponent } from './diagram-icon-user-task.component'; import { DiagramIconManualTaskComponent } from './diagram-icon-manual-task.component'; +import { DiagramIconCamelTaskComponent } from './diagram-icon-camel-task.component'; // primitives export * from './diagram-icon-service-task.component'; export * from './diagram-icon-send-task.component'; export * from './diagram-icon-user-task.component'; export * from './diagram-icon-manual-task.component'; +export * from './diagram-icon-camel-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, DiagramIconSendTaskComponent, DiagramIconUserTaskComponent, - DiagramIconManualTaskComponent + DiagramIconManualTaskComponent, + DiagramIconCamelTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 8c5c92191a..b609df7502 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -29,6 +29,7 @@ import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; import { RaphaelIconSendDirective } from './raphael-icon-send.component'; import { RaphaelIconUserDirective } from './raphael-icon-user.component'; import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; +import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; // primitives export * from './raphael-circle.component'; @@ -44,6 +45,7 @@ export * from './raphael-icon-service.component'; export * from './raphael-icon-send.component'; export * from './raphael-icon-user.component'; export * from './raphael-icon-manual.component'; +export * from './raphael-icon-camel.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -57,5 +59,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, RaphaelIconSendDirective, RaphaelIconUserDirective, - RaphaelIconManualDirective + RaphaelIconManualDirective, + RaphaelIconCamelDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts new file mode 100644 index 0000000000..c737c4e092 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts @@ -0,0 +1,85 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-camel'}) +export class RaphaelIconCamelDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + 0.651324,-0.3302 1.13227,-0.9222 1.180246,-1.6705 0.0082,-0.7042 -0.133578,-1.3681 0.302178,-2.0083 0.08617,-0.3202 + 0.356348,-1.0224005 -0.218996,-0.8051 -0.694517,0.2372 -1.651062,0.6128 -2.057645,-0.2959005 -0.696769,0.3057005 -1.102947,-0.611 + -1.393127,-1.0565 -0.231079,-0.6218 -0.437041,-1.3041 -0.202103,-1.9476 -0.185217,-0.7514 -0.39751099,-1.5209 -0.35214999,-2.301 + -0.243425,-0.7796 0.86000899,-1.2456 0.08581,-1.8855 -0.76078999,0.1964 -1.41630099,-0.7569 -0.79351899,-1.2877 0.58743,-0.52829998 + 1.49031699,-0.242 2.09856399,-0.77049998 0.816875,-0.3212 1.256619,0.65019998 1.923119,0.71939998 0.01194,0.7333 -0.0031,1.5042 + -0.18417,2.2232 -0.194069,0.564 -0.811196,1.6968 0.06669,1.9398 0.738382,-0.173 1.095723,-0.9364 1.659041,-1.3729 0.727298,-0.3962 + 1.093982,-1.117 1.344137,-1.8675 0.400558,-0.8287 1.697676,-0.6854 1.955367,0.1758 0.103564,0.5511 0.9073983,1.7538 + 1.2472763,0.6846 0.121868,-0.6687 0.785541,-1.4454 1.518183,-1.0431 0.813587,0.4875 0.658233,1.6033 1.285504,2.2454 + 0.768715,0.8117 1.745394,1.4801 2.196633,2.5469 0.313781,0.8074 0.568552,1.707 0.496624,2.5733 -0.35485,0.8576005 -1.224508,-0.216 + -0.64725,-0.7284 0.01868,-0.3794 -0.01834,-1.3264 -0.370249,-1.3272 -0.123187,0.7586 -0.152778,1.547 -0.10869,2.3154 + 0.270285,0.6662005 1.310741,0.7653005 1.060553,1.6763005 -0.03493,0.9801 0.294343,1.9505 0.148048,2.9272 -0.320479,0.2406 + -0.79575,0.097 -1.185062,0.1512 -0.165725,0.3657 -0.40138,0.921 -1.020848,0.6744 -0.564671,0.1141 -1.246404,-0.266 + -0.578559,-0.7715 0.679736,-0.5602 0.898618,-1.5362 0.687058,-2.3673 -0.529674,-1.108 -1.275984,-2.0954005 -1.839206,-3.1831005 + -0.634619,-0.1004 -1.251945,0.6779 -1.956789,0.7408 -0.6065893,-0.038 -1.0354363,-0.06 -0.8495673,0.6969005 0.01681,0.711 + 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From d047e98e72fdc2054b5ccf0333b5a768ddb63a8a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 11:45:26 +0100 Subject: [PATCH 23/61] Add Mule task component --- ...gram-container-service-task.component.html | 3 + .../diagram-mule-task.component.html | 2 + .../activities/diagram-mule-task.component.ts | 38 ++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagram-icon-mule-task.component.html | 2 + .../icons/diagram-icon-mule-task.component.ts | 46 ++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael/raphael-icon-mule.component.ts | 71 +++++++++++++++++++ 9 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index 6298e3fa86..b6a3404eac 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -5,6 +5,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html new file mode 100644 index 0000000000..882a84ff19 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts new file mode 100644 index 0000000000..b166a91075 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-mule-task', + templateUrl: './diagram-mule-task.component.html', + styleUrls: ['./diagram-mule-task.component.css'] +}) +export class DiagramMuleTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 8191f51a24..bad5086ab6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -22,6 +22,7 @@ import { DiagramSendTaskComponent } from './diagram-send-task.component'; import { DiagramUserTaskComponent } from './diagram-user-task.component'; import { DiagramManualTaskComponent } from './diagram-manual-task.component'; import { DiagramCamelTaskComponent } from './diagram-camel-task.component'; +import { DiagramMuleTaskComponent } from './diagram-mule-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -31,6 +32,7 @@ export * from './diagram-send-task.component'; export * from './diagram-user-task.component'; export * from './diagram-manual-task.component'; export * from './diagram-camel-task.component'; +export * from './diagram-mule-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -39,5 +41,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramSendTaskComponent, DiagramUserTaskComponent, DiagramManualTaskComponent, - DiagramCamelTaskComponent + DiagramCamelTaskComponent, + DiagramMuleTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html new file mode 100644 index 0000000000..0b42e1fd3c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts new file mode 100644 index 0000000000..b3c9ec96a9 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-mule-task', + templateUrl: './diagram-icon-mule-task.component.html', + styleUrls: ['./diagram-icon-mule-task.component.css'] +}) +export class DiagramIconMuleTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 2, y: this.data.y + 2}; + this.options.stroke = 'none' ; + this.options.fillColors = '#bd4848' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index b4668ef195..33f5fad116 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -20,6 +20,7 @@ import { DiagramIconSendTaskComponent } from './diagram-icon-send-task.component import { DiagramIconUserTaskComponent } from './diagram-icon-user-task.component'; import { DiagramIconManualTaskComponent } from './diagram-icon-manual-task.component'; import { DiagramIconCamelTaskComponent } from './diagram-icon-camel-task.component'; +import { DiagramIconMuleTaskComponent } from './diagram-icon-mule-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -27,11 +28,13 @@ export * from './diagram-icon-send-task.component'; export * from './diagram-icon-user-task.component'; export * from './diagram-icon-manual-task.component'; export * from './diagram-icon-camel-task.component'; +export * from './diagram-icon-mule-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, DiagramIconSendTaskComponent, DiagramIconUserTaskComponent, DiagramIconManualTaskComponent, - DiagramIconCamelTaskComponent + DiagramIconCamelTaskComponent, + DiagramIconMuleTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index b609df7502..1c76a761ae 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -30,6 +30,7 @@ import { RaphaelIconSendDirective } from './raphael-icon-send.component'; import { RaphaelIconUserDirective } from './raphael-icon-user.component'; import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; +import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; // primitives export * from './raphael-circle.component'; @@ -46,6 +47,7 @@ export * from './raphael-icon-send.component'; export * from './raphael-icon-user.component'; export * from './raphael-icon-manual.component'; export * from './raphael-icon-camel.component'; +export * from './raphael-icon-mule.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -60,5 +62,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelIconSendDirective, RaphaelIconUserDirective, RaphaelIconManualDirective, - RaphaelIconCamelDirective + RaphaelIconCamelDirective, + RaphaelIconMuleDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts new file mode 100644 index 0000000000..ebdaa63f22 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts @@ -0,0 +1,71 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-mule'}) +export class RaphaelIconMuleDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 84ea69bf6a55108f3b8cf77d0fb829fa06541b29 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 12:43:25 +0100 Subject: [PATCH 24/61] Add alfresco publish task component --- ...agram-alfresco-publish-task.component.html | 2 + ...diagram-alfresco-publish-task.component.ts | 38 ++++ ...gram-container-service-task.component.html | 3 + .../components/diagrams/activities/index.ts | 5 +- ...-icon-alfresco-publish-task.component.html | 2 + ...am-icon-alfresco-publish-task.component.ts | 46 +++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- ...raphael-icon-alfresco-publish.component.ts | 182 ++++++++++++++++++ 9 files changed, 285 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html new file mode 100644 index 0000000000..5a7c236f1f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts new file mode 100644 index 0000000000..83e4246518 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-alfresco-publish-task', + templateUrl: './diagram-alfresco-publish-task.component.html', + styleUrls: ['./diagram-alfresco-publish-task.component.css'] +}) +export class DiagramAlfrescoPublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index b6a3404eac..f3c4b005cd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -8,6 +8,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index bad5086ab6..bf95022371 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -23,6 +23,7 @@ import { DiagramUserTaskComponent } from './diagram-user-task.component'; import { DiagramManualTaskComponent } from './diagram-manual-task.component'; import { DiagramCamelTaskComponent } from './diagram-camel-task.component'; import { DiagramMuleTaskComponent } from './diagram-mule-task.component'; +import { DiagramAlfrescoPublishTaskComponent } from './diagram-alfresco-publish-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -33,6 +34,7 @@ export * from './diagram-user-task.component'; export * from './diagram-manual-task.component'; export * from './diagram-camel-task.component'; export * from './diagram-mule-task.component'; +export * from './diagram-alfresco-publish-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -42,5 +44,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramUserTaskComponent, DiagramManualTaskComponent, DiagramCamelTaskComponent, - DiagramMuleTaskComponent + DiagramMuleTaskComponent, + DiagramAlfrescoPublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html new file mode 100644 index 0000000000..65394e97f8 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts new file mode 100644 index 0000000000..4ea09ba1e1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-alfresco-publish-task', + templateUrl: './diagram-icon-alfresco-publish-task.component.html', + styleUrls: ['./diagram-icon-alfresco-publish-task.component.css'] +}) +export class DiagramIconAlfrescoPublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#87C040' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 33f5fad116..9860f0a81c 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -21,6 +21,7 @@ import { DiagramIconUserTaskComponent } from './diagram-icon-user-task.component import { DiagramIconManualTaskComponent } from './diagram-icon-manual-task.component'; import { DiagramIconCamelTaskComponent } from './diagram-icon-camel-task.component'; import { DiagramIconMuleTaskComponent } from './diagram-icon-mule-task.component'; +import { DiagramIconAlfrescoPublishTaskComponent } from './diagram-icon-alfresco-publish-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -29,6 +30,7 @@ export * from './diagram-icon-user-task.component'; export * from './diagram-icon-manual-task.component'; export * from './diagram-icon-camel-task.component'; export * from './diagram-icon-mule-task.component'; +export * from './diagram-icon-alfresco-publish-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -36,5 +38,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconUserTaskComponent, DiagramIconManualTaskComponent, DiagramIconCamelTaskComponent, - DiagramIconMuleTaskComponent + DiagramIconMuleTaskComponent, + DiagramIconAlfrescoPublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 1c76a761ae..567f1ebad5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -31,6 +31,7 @@ import { RaphaelIconUserDirective } from './raphael-icon-user.component'; import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; +import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; // primitives export * from './raphael-circle.component'; @@ -48,6 +49,7 @@ export * from './raphael-icon-user.component'; export * from './raphael-icon-manual.component'; export * from './raphael-icon-camel.component'; export * from './raphael-icon-mule.component'; +export * from './raphael-icon-alfresco-publish.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -63,5 +65,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelIconUserDirective, RaphaelIconManualDirective, RaphaelIconCamelDirective, - RaphaelIconMuleDirective + RaphaelIconMuleDirective, + RaphaelIconAlfrescoPublishDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts new file mode 100644 index 0000000000..a013b1f9bb --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts @@ -0,0 +1,182 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-alfresco-publish'}) +export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + + let startX = position.x + 2; + let startY = position.y + 2; + + let path1 = this.paper.path(`M4.11870968,2.12890323 L6.12954839,0.117935484 L3.10993548,0.118064516 L3.10270968,0.118064516 + C1.42941935,0.118064516 0.0729032258,1.47458065 0.0729032258,3.14774194 C0.0729032258,4.82116129 1.42929032,6.17754839 + 3.10258065,6.17754839 C3.22967742,6.17754839 3.35470968,6.16877419 3.47767742,6.15354839 C2.8163871,4.85083871 + 3.02954839,3.21793548 4.11870968,2.12890323M6.57032258,3.144 L6.57032258,0.300258065 L4.43522581,2.4356129 L4.43006452,2.44064516 + 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-width': this.strokeWidth + }); + + let startX1 = startX + 1.419355; + let startY1 = startY + 8.387097; + path1.transform('T' + startX1 + ',' + startY1); + + path1 = this.paper.path(`M10.4411613,10.5153548 L8.43032258,8.50451613 L8.43032258,11.5313548 C8.43032258,13.2047742 9.78683871, + 14.5611613 11.460129,14.5611613 C13.1334194,14.5611613 14.4899355,13.2047742 14.4899355,11.5314839 C14.4899355,11.4043871 + 14.4811613,11.2793548 14.4659355,11.1563871 C13.1632258,11.8178065 11.5303226,11.6045161 10.4411613,10.5153548M15.0376774, + 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-width': this.strokeWidth + }); + path1.transform('T' + startX + ',' + startY); + + path1 = this.paper.path(`M5.9083871,1.5636129 C5.78129032,1.5636129 5.65625806,1.57225806 5.53329032,1.58748387 + 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-width': this.strokeWidth + }); + + let startX2 = startX + 5.548387; + path1.transform('T' + startX2 + ',' + startY); + + path1 = this.paper.path(`M4.58090323,1.0156129 C3.39767742,-0.167483871 1.47935484,-0.167483871 0.296129032,1.01574194 + 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-width': this.strokeWidth + }); + path1.transform('T' + startX2 + ',' + startY); + + path1 = this.paper.path(`M5.54051613,5.61432258 L5.62670968,5.70425806 L7.54632258,7.62387097 L7.5483871,7.62387097 + L7.5483871,4.604 L7.5483871,4.59677419 C7.5483871,2.92348387 6.19187097,1.56696774 4.51858065,1.56696774 C2.84529032,1.56696774 + 1.48877419,2.92335484 1.48890323,4.59664516 C1.48890323,4.72348387 1.49754839,4.84812903 1.51264516,4.97083871 + C2.81625806,4.30993548 4.45122581,4.52503226 5.54051613,5.61432258M1.23251613,10.4292903 C1.25625806,10.3588387 + 1.28180645,10.2894194 1.30980645,10.2210323 C1.31329032,10.2123871 1.3163871,10.2036129 1.32,10.1952258 C1.35070968,10.1216774 + 1.38451613,10.0500645 1.42,9.97935484 C1.42774194,9.96374194 1.43574194,9.9483871 1.44387097,9.93277419 C1.4803871,9.86258065 + 1.51883871,9.79354839 1.55987097,9.72632258 C1.56425806,9.71909677 1.56903226,9.71225806 1.57341935,9.70529032 + C1.6123871,9.64245161 1.65354839,9.58141935 1.6963871,9.52141935 C1.70516129,9.50903226 1.71380645,9.49651613 + 1.72283871,9.48425806 C1.76890323,9.42154839 1.81690323,9.36064516 1.86683871,9.30129032 C1.87703226,9.28916129 + 1.88735484,9.27741935 1.89780645,9.26567742 C1.94658065,9.20916129 1.99690323,9.15406452 2.04916129,9.10090323 + C2.05380645,9.09625806 2.05806452,9.09135484 2.06270968,9.08670968 C2.11832258,9.03083871 2.17625806,8.97741935 + 2.23548387,8.92554839 C2.2483871,8.91419355 2.26129032,8.90296774 2.27432258,8.89187097 C2.33393548,8.84103226 + 2.39496774,8.79212903 2.45780645,8.74529032 C2.46606452,8.73922581 2.47470968,8.73354839 2.48296774,8.7276129 + C2.54167742,8.68490323 2.60180645,8.64412903 2.66322581,8.60503226 C2.67535484,8.59729032 2.68735484,8.58929032 + 2.6996129,8.58167742 C2.76593548,8.54064516 2.83380645,8.50206452 2.90296774,8.46541935 C2.91754839,8.45780645 + 2.93225806,8.45045161 2.94696774,8.44296774 C3.016,8.40774194 3.08593548,8.37406452 3.15741935,8.34348387 C3.16090323,8.34206452 + 3.16425806,8.3403871 3.16774194,8.33883871 C3.24167742,8.30748387 3.31729032,8.27948387 3.39380645,8.25316129 + C3.41032258,8.24748387 3.42670968,8.24180645 3.44335484,8.2363871 C3.51909677,8.21174194 3.59587097,8.18903226 + 3.67380645,8.16929032 C3.68567742,8.16645161 3.69793548,8.16387097 3.70980645,8.16116129 C3.78206452,8.14374194 + 3.85509677,8.12877419 3.92890323,8.116 C3.94270968,8.11367742 3.9563871,8.11083871 3.97019355,8.10877419 C4.05032258,8.09587097 + 4.13148387,8.08619355 4.21329032,8.07896774 C4.23096774,8.07741935 4.24877419,8.07625806 4.26645161,8.07483871 + C4.35109677,8.06877419 4.43612903,8.06451613 4.52232258,8.06451613 L7.36606452,8.0643871 L5.22580645,5.92412903 + 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-width': this.strokeWidth + }); + path1.transform('T' + startX + ',' + startY); + + path1 = this.paper.path(`M5.23290323,5.92412903 L6.92748387,7.61870968 L4.64980645,7.61870968 L4.52064516,7.62141935 + C3.13354839,7.62141935 1.96425806,6.68929032 1.60477419,5.41729032 C2.75870968,4.77019355 4.24619355,4.93754839 + 5.22787097,5.91909677 L5.23290323,5.92412903M7.54722581,4.59612903 L7.54722581,6.99264516 L5.93664516,5.38206452 + L5.84348387,5.29264516 C4.86258065,4.31187097 4.69483871,2.82580645 5.34012903,1.67225806 C6.61367742,2.03070968 + 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-width': this.strokeWidth + }); + path1.transform('T' + startX + ',' + startY); + + 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-width': this.strokeWidth + }); + path1.transform('T' + startX + ',' + startY); + + path1 = this.paper.path(`M10.7470968,10.192 L9.05251613,8.49741935 L11.3301935,8.49741935 L11.4593548,8.49470968 + C12.8464516,8.49483871 14.0157419,9.42696774 14.3752258,10.6989677 C13.2211613,11.3459355 11.7338065,11.1787097 + 10.752129,10.1970323 L10.7470968,10.192M8.43729032,11.5174194 L8.43729032,9.12090323 L10.047871,10.7314839 L10.1411613,10.8209032 + C11.1219355,11.8018065 11.2896774,13.2876129 10.6443871,14.4412903 C9.37083871,14.0828387 8.43729032,12.9127742 + 8.43729032,11.5245161 L8.43729032,11.5174194M5.86193548,10.8296774 L7.55651613,9.13496774 L7.55651613,11.4126452 + L7.55922581,11.5418065 C7.55922581,12.9289032 6.62709677,14.0983226 5.35509677,14.4578065 C4.708,13.3036129 4.87535484,11.8162581 + 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-width': this.strokeWidth + }); + path1.transform('T' + startX + ',' + startY); + } +} From 956d6b111c5a11288cf32eeba531ed39dbcce45c Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 14:01:08 +0100 Subject: [PATCH 25/61] Add rest call task component --- ...gram-container-service-task.component.html | 3 + .../diagram-rest-call-task.component.html | 2 + .../diagram-rest-call-task.component.ts | 38 ++++++++++ .../components/diagrams/activities/index.ts | 5 +- ...diagram-icon-rest-call-task.component.html | 2 + .../diagram-icon-rest-call-task.component.ts | 46 ++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- .../raphael-icon-rest-call.component.ts | 75 +++++++++++++++++++ 9 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index f3c4b005cd..567081dc50 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -11,6 +11,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html new file mode 100644 index 0000000000..e7e27ad5bd --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts new file mode 100644 index 0000000000..5cdfdb2826 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-rest-call-task', + templateUrl: './diagram-rest-call-task.component.html', + styleUrls: ['./diagram-rest-call-task.component.css'] +}) +export class DiagramRestCallTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index bf95022371..5cbb435c7b 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -24,6 +24,7 @@ import { DiagramManualTaskComponent } from './diagram-manual-task.component'; import { DiagramCamelTaskComponent } from './diagram-camel-task.component'; import { DiagramMuleTaskComponent } from './diagram-mule-task.component'; import { DiagramAlfrescoPublishTaskComponent } from './diagram-alfresco-publish-task.component'; +import { DiagramRestCallTaskComponent } from './diagram-rest-call-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -35,6 +36,7 @@ export * from './diagram-manual-task.component'; export * from './diagram-camel-task.component'; export * from './diagram-mule-task.component'; export * from './diagram-alfresco-publish-task.component'; +export * from './diagram-rest-call-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -45,5 +47,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramManualTaskComponent, DiagramCamelTaskComponent, DiagramMuleTaskComponent, - DiagramAlfrescoPublishTaskComponent + DiagramAlfrescoPublishTaskComponent, + DiagramRestCallTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html new file mode 100644 index 0000000000..6621df0e84 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts new file mode 100644 index 0000000000..d49b1f8cd8 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-rest-call-task', + templateUrl: './diagram-icon-rest-call-task.component.html', + styleUrls: ['./diagram-icon-rest-call-task.component.css'] +}) +export class DiagramIconRestCallTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 2, y: this.data.y + 2}; + this.options.stroke = 'none' ; + this.options.fillColors = '#bd4848' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 9860f0a81c..d8c5aa6292 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -22,6 +22,7 @@ import { DiagramIconManualTaskComponent } from './diagram-icon-manual-task.compo import { DiagramIconCamelTaskComponent } from './diagram-icon-camel-task.component'; import { DiagramIconMuleTaskComponent } from './diagram-icon-mule-task.component'; import { DiagramIconAlfrescoPublishTaskComponent } from './diagram-icon-alfresco-publish-task.component'; +import { DiagramIconRestCallTaskComponent } from './diagram-icon-rest-call-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -31,6 +32,7 @@ export * from './diagram-icon-manual-task.component'; export * from './diagram-icon-camel-task.component'; export * from './diagram-icon-mule-task.component'; export * from './diagram-icon-alfresco-publish-task.component'; +export * from './diagram-icon-rest-call-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -39,5 +41,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconManualTaskComponent, DiagramIconCamelTaskComponent, DiagramIconMuleTaskComponent, - DiagramIconAlfrescoPublishTaskComponent + DiagramIconAlfrescoPublishTaskComponent, + DiagramIconRestCallTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 567f1ebad5..ba9a5b36f5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -32,6 +32,7 @@ import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; +import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; // primitives export * from './raphael-circle.component'; @@ -50,6 +51,7 @@ export * from './raphael-icon-manual.component'; export * from './raphael-icon-camel.component'; export * from './raphael-icon-mule.component'; export * from './raphael-icon-alfresco-publish.component'; +export * from './raphael-icon-rest-call.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -66,5 +68,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelIconManualDirective, RaphaelIconCamelDirective, RaphaelIconMuleDirective, - RaphaelIconAlfrescoPublishDirective + RaphaelIconAlfrescoPublishDirective, + RaphaelIconRestCallDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts new file mode 100644 index 0000000000..8a53130abd --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts @@ -0,0 +1,75 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-rest-call'}) +export class RaphaelIconRestCallDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let path1 = this.paper.path(`m 16.704699,5.9229055 q 0.358098,0 0.608767,0.2506681 0.250669,0.250668 0.250669,0.6087677 0,0.3580997 + -0.250669,0.6087677 -0.250669,0.2506679 -0.608767,0.2506679 -0.358098,0 -0.608767,-0.2506679 -0.250669,-0.250668 + -0.250669,-0.6087677 0,-0.3580997 0.250669,-0.6087677 0.250669,-0.2506681 0.608767,-0.2506681 z m 2.578308,-2.0053502 q + -2.229162,0 -3.854034,0.6759125 -1.624871,0.6759067 -3.227361,2.2694472 -0.716197,0.725146 -1.575633,1.7457293 L + 7.2329969,8.7876913 Q 7.0897576,8.8055849 7.000233,8.9309334 L 4.9948821,12.368677 q -0.035811,0.06267 -0.035811,0.143242 + 0,0.107426 0.080572,0.205905 l 0.5729577,0.572957 q 0.125334,0.116384 0.2864786,0.07162 l 2.4708789,-0.760963 2.5156417,2.515645 + -0.76096,2.470876 q -0.009,0.02687 -0.009,0.08057 0,0.125338 0.08058,0.205905 l 0.572957,0.572958 q 0.170096,0.152194 + 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 3057047d73ab278a355d8a73e4ce8ab07d01116c Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 16:13:59 +0100 Subject: [PATCH 26/61] Add google drive publish component --- ...gram-container-service-task.component.html | 3 + ...m-google-drive-publish-task.component.html | 2 + ...ram-google-drive-publish-task.component.ts | 38 +++++++++ .../components/diagrams/activities/index.ts | 5 +- ...n-google-drive-publish-task.component.html | 2 + ...con-google-drive-publish-task.component.ts | 44 +++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/index.ts | 5 +- ...ael-icon-google-drive-publish.component.ts | 77 +++++++++++++++++++ 9 files changed, 178 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index 567081dc50..73d36446ab 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -14,6 +14,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html new file mode 100644 index 0000000000..953f75733a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts new file mode 100644 index 0000000000..a0991455a1 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-google-drive-publish-task', + templateUrl: './diagram-google-drive-publish-task.component.html', + styleUrls: ['./diagram-google-drive-publish-task.component.css'] +}) +export class DiagramGoogleDrivePublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 5cbb435c7b..c991d63a94 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -25,6 +25,7 @@ import { DiagramCamelTaskComponent } from './diagram-camel-task.component'; import { DiagramMuleTaskComponent } from './diagram-mule-task.component'; import { DiagramAlfrescoPublishTaskComponent } from './diagram-alfresco-publish-task.component'; import { DiagramRestCallTaskComponent } from './diagram-rest-call-task.component'; +import { DiagramGoogleDrivePublishTaskComponent } from './diagram-google-drive-publish-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -37,6 +38,7 @@ export * from './diagram-camel-task.component'; export * from './diagram-mule-task.component'; export * from './diagram-alfresco-publish-task.component'; export * from './diagram-rest-call-task.component'; +export * from './diagram-google-drive-publish-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -48,5 +50,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramCamelTaskComponent, DiagramMuleTaskComponent, DiagramAlfrescoPublishTaskComponent, - DiagramRestCallTaskComponent + DiagramRestCallTaskComponent, + DiagramGoogleDrivePublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html new file mode 100644 index 0000000000..93776ac4d7 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts new file mode 100644 index 0000000000..3e60d20a07 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts @@ -0,0 +1,44 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-google-drive-publish-task', + templateUrl: './diagram-icon-google-drive-publish-task.component.html', + styleUrls: ['./diagram-icon-google-drive-publish-task.component.css'] +}) +export class DiagramIconGoogleDrivePublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 6, y: this.data.y + 6}; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index d8c5aa6292..343bec6a40 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -23,6 +23,7 @@ import { DiagramIconCamelTaskComponent } from './diagram-icon-camel-task.compone import { DiagramIconMuleTaskComponent } from './diagram-icon-mule-task.component'; import { DiagramIconAlfrescoPublishTaskComponent } from './diagram-icon-alfresco-publish-task.component'; import { DiagramIconRestCallTaskComponent } from './diagram-icon-rest-call-task.component'; +import { DiagramIconGoogleDrivePublishTaskComponent } from './diagram-icon-google-drive-publish-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -33,6 +34,7 @@ export * from './diagram-icon-camel-task.component'; export * from './diagram-icon-mule-task.component'; export * from './diagram-icon-alfresco-publish-task.component'; export * from './diagram-icon-rest-call-task.component'; +export * from './diagram-icon-google-drive-publish-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -42,5 +44,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconCamelTaskComponent, DiagramIconMuleTaskComponent, DiagramIconAlfrescoPublishTaskComponent, - DiagramIconRestCallTaskComponent + DiagramIconRestCallTaskComponent, + DiagramIconGoogleDrivePublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index ba9a5b36f5..f61ba9bcfc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -33,6 +33,7 @@ import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; +import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; // primitives export * from './raphael-circle.component'; @@ -52,6 +53,7 @@ export * from './raphael-icon-camel.component'; export * from './raphael-icon-mule.component'; export * from './raphael-icon-alfresco-publish.component'; export * from './raphael-icon-rest-call.component'; +export * from './raphael-icon-google-drive-publish.component'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -69,5 +71,6 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelIconCamelDirective, RaphaelIconMuleDirective, RaphaelIconAlfrescoPublishDirective, - RaphaelIconRestCallDirective + RaphaelIconRestCallDirective, + RaphaelIconGoogleDrivePublishDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts new file mode 100644 index 0000000000..ae9998e22e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts @@ -0,0 +1,77 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './models/point'; +import { RaphaelBase } from './raphael-base'; +import { RaphaelService } from './raphael.service'; + +@Directive({selector: 'raphael-icon-google-drive-publish'}) +export class RaphaelIconGoogleDrivePublishDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + + let 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 + JqcGAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIHSURBVDiNpVI7a1RREP7mzLl3d+9mScxaiBLFwohxQcXCwjwao/gqFAQhRGOphQgmgs9oGxaV + gFhpYPUPGMFCCzEqCgETg0uK4CuFoLhZyWNf994zFrqy9xJWwQ+mOB8z33wzZ4D/BIWJppG+plstc+mjK9yttbzALHExcoDaRxdqeRUWcFkGBz7G1s152CCQ7dUAqNOLuZf + qOmi439MmhifF86e6uLj4MFXoCuVXWPkp2vZkZlkHYvRNAJYwtz79oXdMLfFMSMD2Dd9YdoSGTO9hQLoBQBESQvLpUNaZD1sGsN8d390dFBjpiwooHVBW6tvXCr2H4EFo6L + wR97pkj9h/BByWfgDrA4lRTWDvHIPOAihVaWO8txCkygu50wBAsbsnWpT2pwHEA/sgXC30Zq4BwJfHHRdY0R4nxp5mbFGEJIB5l2SjVtoMhYsBfC5EikPVh7Z4uFyqnKq43 + hoQFrXCIydCjZbWlyl+79gzCDprq1dPnnyhS8nNZDmvRVmbAIDhKyL5/e2kjKi4pbwxLQZniDAOgAHAybW90aXmncp2xoSsvdVDMWBAAi69sqsvqsLxzARB7vxaMHvJDwcT + ZCVeClnhIwqC5Pb08Kp3CgBUxT4PINc4u+u54uY8FLfXLQa+sx0dRNV2eXSi6OzryK2c7Wkl0msB5OuG0JVsOvnqL03+DT8BxkC5RkIpSlIAAAAASUVORK5CYII=`}); + } +} From 05bd1b2b7b1d6bfb9067039266b60c0c0424f533 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 16:23:06 +0100 Subject: [PATCH 27/61] Create icons folder in Raphael --- .../src/components/raphael/icons/index.ts | 49 +++++++++++++++++++ ...raphael-icon-alfresco-publish.component.ts | 6 +-- .../raphael-icon-camel.component.ts | 6 +-- ...ael-icon-google-drive-publish.component.ts | 6 +-- .../raphael-icon-manual.component.ts | 6 +-- .../raphael-icon-mule.component.ts | 6 +-- .../raphael-icon-rest-call.component.ts | 6 +-- .../raphael-icon-send.component.ts | 6 +-- .../raphael-icon-service.component.ts | 6 +-- .../raphael-icon-user.component.ts | 6 +-- .../src/components/raphael/index.ts | 31 ++---------- 11 files changed, 79 insertions(+), 55 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-alfresco-publish.component.ts (98%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-camel.component.ts (96%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-google-drive-publish.component.ts (94%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-manual.component.ts (95%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-mule.component.ts (94%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-rest-call.component.ts (95%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-send.component.ts (92%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-service.component.ts (96%) rename ng2-components/ng2-activiti-analytics/src/components/raphael/{ => icons}/raphael-icon-user.component.ts (92%) diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts new file mode 100644 index 0000000000..932543567b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -0,0 +1,49 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; +import { RaphaelIconSendDirective } from './raphael-icon-send.component'; +import { RaphaelIconUserDirective } from './raphael-icon-user.component'; +import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; +import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; +import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; +import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; +import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; +import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; + +// primitives +export * from './raphael-icon-service.component'; +export * from './raphael-icon-send.component'; +export * from './raphael-icon-user.component'; +export * from './raphael-icon-manual.component'; +export * from './raphael-icon-camel.component'; +export * from './raphael-icon-mule.component'; +export * from './raphael-icon-alfresco-publish.component'; +export * from './raphael-icon-rest-call.component'; +export * from './raphael-icon-google-drive-publish.component'; + +export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ + RaphaelIconServiceDirective, + RaphaelIconSendDirective, + RaphaelIconUserDirective, + RaphaelIconManualDirective, + RaphaelIconCamelDirective, + RaphaelIconMuleDirective, + RaphaelIconAlfrescoPublishDirective, + RaphaelIconRestCallDirective, + RaphaelIconGoogleDrivePublishDirective +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts similarity index 98% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts index a013b1f9bb..878b094511 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-alfresco-publish.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-alfresco-publish'}) export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-camel.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-camel.component.ts index c737c4e092..81339c4abb 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-camel.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-camel.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-camel'}) export class RaphaelIconCamelDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts index ae9998e22e..065cf35235 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-google-drive-publish.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-google-drive-publish'}) export class RaphaelIconGoogleDrivePublishDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-manual.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-manual.component.ts index 4e4bc311a2..9f073711f6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-manual.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-manual.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-manual'}) export class RaphaelIconManualDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-mule.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-mule.component.ts index ebdaa63f22..3bf4e42147 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-mule.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-mule.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-mule'}) export class RaphaelIconMuleDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-rest-call.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-rest-call.component.ts index 8a53130abd..a46e83d67d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-rest-call.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-rest-call.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-rest-call'}) export class RaphaelIconRestCallDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-send.component.ts similarity index 92% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-send.component.ts index b90240fa48..cd2adc4004 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-send.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-send.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-send'}) export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-service.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-service.component.ts index 8706ffc313..c5db7a5601 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-service.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-service.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-service'}) export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-user.component.ts similarity index 92% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts rename to ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-user.component.ts index d1b91833f2..b0ee5a149e 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-icon-user.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-user.component.ts @@ -16,9 +16,9 @@ */ import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { Point } from './models/point'; -import { RaphaelBase } from './raphael-base'; -import { RaphaelService } from './raphael.service'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; @Directive({selector: 'raphael-icon-user'}) export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index f61ba9bcfc..38d5586956 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -25,15 +25,7 @@ import { RaphaelRhombusDirective } from './raphael-rhombus.component'; import { RaphaelPentagonDirective } from './raphael-pentagon.component'; // icons -import { RaphaelIconServiceDirective } from './raphael-icon-service.component'; -import { RaphaelIconSendDirective } from './raphael-icon-send.component'; -import { RaphaelIconUserDirective } from './raphael-icon-user.component'; -import { RaphaelIconManualDirective } from './raphael-icon-manual.component'; -import { RaphaelIconCamelDirective } from './raphael-icon-camel.component'; -import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; -import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; -import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; -import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; +import { RAPHAEL_ICONS_DIRECTIVES } from './icons/index'; // primitives export * from './raphael-circle.component'; @@ -44,16 +36,7 @@ export * from './raphael-cross.component'; export * from './raphael-plus.component'; export * from './raphael-rhombus.component'; export * from './raphael-pentagon.component'; - -export * from './raphael-icon-service.component'; -export * from './raphael-icon-send.component'; -export * from './raphael-icon-user.component'; -export * from './raphael-icon-manual.component'; -export * from './raphael-icon-camel.component'; -export * from './raphael-icon-mule.component'; -export * from './raphael-icon-alfresco-publish.component'; -export * from './raphael-icon-rest-call.component'; -export * from './raphael-icon-google-drive-publish.component'; +export * from './icons/index'; export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelCircleDirective, @@ -64,13 +47,5 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelPlusDirective, RaphaelRhombusDirective, RaphaelPentagonDirective, - RaphaelIconServiceDirective, - RaphaelIconSendDirective, - RaphaelIconUserDirective, - RaphaelIconManualDirective, - RaphaelIconCamelDirective, - RaphaelIconMuleDirective, - RaphaelIconAlfrescoPublishDirective, - RaphaelIconRestCallDirective, - RaphaelIconGoogleDrivePublishDirective + RAPHAEL_ICONS_DIRECTIVES ]; From 8bcd8b43a272da3f4fdb1ccf47108c7e6987bed6 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 16:33:05 +0100 Subject: [PATCH 28/61] Add box publish task component --- .../diagram-box-publish-task.component.html | 2 + .../diagram-box-publish-task.component.ts | 38 +++++++ ...gram-container-service-task.component.html | 3 + .../components/diagrams/activities/index.ts | 5 +- ...agram-icon-box-publish-task.component.html | 2 + ...diagram-icon-box-publish-task.component.ts | 44 ++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../raphael-icon-box-publish.component.ts | 100 ++++++++++++++++++ 9 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html new file mode 100644 index 0000000000..6b60f0a5a5 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts new file mode 100644 index 0000000000..8202d7f6cf --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-box-publish-task', + templateUrl: './diagram-box-publish-task.component.html', + styleUrls: ['./diagram-box-publish-task.component.css'] +}) +export class DiagramBoxPublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html index 73d36446ab..ffca2963c4 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html @@ -17,6 +17,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index c991d63a94..8914dbb10a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -26,6 +26,7 @@ import { DiagramMuleTaskComponent } from './diagram-mule-task.component'; import { DiagramAlfrescoPublishTaskComponent } from './diagram-alfresco-publish-task.component'; import { DiagramRestCallTaskComponent } from './diagram-rest-call-task.component'; import { DiagramGoogleDrivePublishTaskComponent } from './diagram-google-drive-publish-task.component'; +import { DiagramBoxPublishTaskComponent } from './diagram-box-publish-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -39,6 +40,7 @@ export * from './diagram-mule-task.component'; export * from './diagram-alfresco-publish-task.component'; export * from './diagram-rest-call-task.component'; export * from './diagram-google-drive-publish-task.component'; +export * from './diagram-box-publish-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -51,5 +53,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramMuleTaskComponent, DiagramAlfrescoPublishTaskComponent, DiagramRestCallTaskComponent, - DiagramGoogleDrivePublishTaskComponent + DiagramGoogleDrivePublishTaskComponent, + DiagramBoxPublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html new file mode 100644 index 0000000000..61548c14e2 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts new file mode 100644 index 0000000000..87817a26b0 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts @@ -0,0 +1,44 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-box-publish-task', + templateUrl: './diagram-icon-box-publish-task.component.html', + styleUrls: ['./diagram-icon-box-publish-task.component.css'] +}) +export class DiagramIconBoxPublishTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 6, y: this.data.y + 6}; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 343bec6a40..d23a1b8476 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -24,6 +24,7 @@ import { DiagramIconMuleTaskComponent } from './diagram-icon-mule-task.component import { DiagramIconAlfrescoPublishTaskComponent } from './diagram-icon-alfresco-publish-task.component'; import { DiagramIconRestCallTaskComponent } from './diagram-icon-rest-call-task.component'; import { DiagramIconGoogleDrivePublishTaskComponent } from './diagram-icon-google-drive-publish-task.component'; +import { DiagramIconBoxPublishTaskComponent } from './diagram-icon-box-publish-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -35,6 +36,7 @@ export * from './diagram-icon-mule-task.component'; export * from './diagram-icon-alfresco-publish-task.component'; export * from './diagram-icon-rest-call-task.component'; export * from './diagram-icon-google-drive-publish-task.component'; +export * from './diagram-icon-box-publish-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -45,5 +47,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconMuleTaskComponent, DiagramIconAlfrescoPublishTaskComponent, DiagramIconRestCallTaskComponent, - DiagramIconGoogleDrivePublishTaskComponent + DiagramIconGoogleDrivePublishTaskComponent, + DiagramIconBoxPublishTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 932543567b..830f014404 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -24,6 +24,7 @@ import { RaphaelIconMuleDirective } from './raphael-icon-mule.component'; import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-publish.component'; import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; +import { RaphaelIconBoxPublishDirective } from './raphael-icon-box-publish.component'; // primitives export * from './raphael-icon-service.component'; @@ -35,6 +36,7 @@ export * from './raphael-icon-mule.component'; export * from './raphael-icon-alfresco-publish.component'; export * from './raphael-icon-rest-call.component'; export * from './raphael-icon-google-drive-publish.component'; +export * from './raphael-icon-box-publish.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -45,5 +47,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconMuleDirective, RaphaelIconAlfrescoPublishDirective, RaphaelIconRestCallDirective, - RaphaelIconGoogleDrivePublishDirective + RaphaelIconGoogleDrivePublishDirective, + RaphaelIconBoxPublishDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts new file mode 100644 index 0000000000..545d4b0c63 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts @@ -0,0 +1,100 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-box-publish'}) +export class RaphaelIconBoxPublishDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + + let 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 + wwHHb6hkAAAAB3RJTUUH3wQXDxwCFNe28AAACsdJREFUWMOVmGmMXtV5x3/POfe+ y2yeGc/mwbMZG9tDMGBTKC5GCU4pbYmSRlmowlIFJWnUprSiy4dI/UA/9EsVifZDmy + ZIxEpo1Cql UKICqbABG+x4X4M9iz2bxzOefXnfee+95zz9cN9Z7NqVeqSje3XPec/5n/Ns//8rAAd6xvj0lmYA VJWTI9fN2d5BikslrDEYY0ABIX0aUBUUUJS1TZB0HZS + lUsz8fBHF09neKnFU0t964B5trcoqwA8O fsI3HtmW/u7Hx3p5+oHNqCr7DpzLX3dh1+xC4Z7p2dnGKE7UGmOsNTYFIuXtUlQqsgJkGSdrgBRL 8dLCYlRUUTa1NrYXiqWZ + jqb6q/vPDHz43S/vXHika0Phr984yUufv5/llfnJ0f473z9/7c+P9E8+ 3zdRCAuJR8SU1zUpBhFWL0BATAqhvIqIlCEIqK65JfDOIHgqpUT3HesW9mxreOWejfUvPfPrm6 + de fu8Sgary2sm+5v84NvT9d85P7Z1zhkwmTyZD+dSAKFI2jyAgqQEMkoJFQR1ZC1W5gMowxAgkzlOI HPMlh3ceFUtCjuPXtap3cuSFL9ybdKrq10RkMfi7Nz42g/P+2YP + 9i3sjm6E6a8snS0+ogBcwIki5 g2AkPXGAsqk+z/YNVWxuyLBxXZ66XIbQQimOmSgkDM9G9IwVODda5OpcEc0YYs3xbs/C73z39VMv Ai8FP/rlqG1vafjLGZenusKn121W + 7jr1TxFE0tsQI/iyibbVBTzZvZ6H22vY1lJDQ0WW27Vrs4uc G5vj/d453jw7yWQxomQqwiODs59T1X1yaHh+17dfPXxswuXAWlTBiCcbQmANiVOiRMBabGgJ8YiB xzqre + W5nM/e31pALLKjiEXTVZW5oxnjAML2UcGJoin86PMbxy9Osr8n3/enu9q8HxVLcsCBVhLkM m+vgs1tquW9DDY1VGUJrSBLPeCHh+Ng8H12Z4+oiPHlXNd9+cANNFVkExTm + HUvYVuCmg0+a9AVXW ZSyfvrORtroKXj6YZf/lJekfnzNB7EPfWak8/UgLj29dzzoLYRAgxiCSRoDz8FBHFc/c18CV2ZjN 9TmachY0wavBi8Gs2V3XRMvab6Lg1QHQWV/J + d/ZspCE3zPTEJHJqaPpJE9j/3Lo+g8Ou5AK95QWv 5gu5jS/oTUBuNc+veU4Xo/5LvUPPB1XJXKmtaQOJBy+G5Xwp3L7pmsXkFmM3g+Y2cwxQH0J3SwVB oF5iNXhA8MwWI + 2bmCzTWVJLPhssZ/fZgbtpJ1jirQpqHuPUcRfHe4zwYZy0JDu89onDw3AB/9f23 OdU/jqriVHH+f3fvFbyCu7FrecyV328eT+c4vDq8ehwCJiRQ9ah68EKMUIqU2FuKCTi + nGFG8rta7 /09bk+XT5Kg3FUgRvFdUlQA1OA9oeiPOe6JE8R7EeMQYAgSngHN4XWN5gdAYjKRm8gqJdxgVQptG W+I9qecp1gjGGiLn0nKhgvfg1BMYsXgVVD1GhSRRojiB + QBgan2N4bIal2FNRmWFLWwP1VXmiOCaw lmKUcGHkOlOzi6gIrfXVbG5vpFhIOHplmNb6dWxsqsEliljPxGLCJ5eHufuuNirCEJzHe/B4AqVs V1VUDbFXPCH/fbSPn5c8Y + 9MFlhzks8qm5jy/vauL3Xd3cunqJG8e6uHc0CKzxRIiSktVhvs6a7l3 +0b+4d9PcO+2dp7bu536qiyJwr53z3Csd5pvSciD3R2oJqh6BJMC8d7jUcQrSRnUsb4ZjFvioe2 + t 1FXn6RuZ5YPTE4xMR4xMFjk7MMGBs9fobKzm4a2NJAkcPj/I5fEi50fnaaqv5t2TA7TUZXjqM3fz swOXOHB+nHwIHRvW45wDPIpHRctA1OMUrNG0dMdKpS3ywlceYEdH + E3nxLMbCW0f6eW1/H+NjPRSi iIe33sFzn+2mqTbE43li9xb+9tX36BldYPeWOhpmS7x+qJ/J2QJHL00zO1/gxT94lLqqLN4nqfNq enADoF5RlEQdcaLMLSh7793KrrZGq + oMAE+aorgj4zQc6aGsMGC0uEeQse3dtoLU5AyHYTEBbfZ4v fuY+xq8vMF8SvvToVqbmIn52ZJSe0SmeeqybHe1VpJGaRov3HlQxKCu5QhWcV6J4kfaWPCYTgkaI i1CvZM + XQsq6G+SWhtrKC9ZWWRAOs8+ASrEvYvqGK+WKJycWYXXc1cc+mJuYWCmxsruOJnW3ENkS9 T3ORLqcEg1FNP3hVRIR8JsCZkMtjBeKlmIiQJbEk4lmMPSMTc+Airs8sMDn + nMV6JsSQIkVF6xhZA IGOFU73XOXFpDGOy9A5e54MLw5jYk6zsCd4L6srZ22uaDb1Tupqr6Wqs4Y0PL3Cy9xoLhRgflZiZ KfLeyUGOX54jlw0Znlzg5ycG6RufphTHRMUS + V8aK7Hv7LLlcnqxVXnnnIpE37OluoKaqgu/962nO DU0ABvW+nIU9Xj32j1/4sztNmH0mNY1j/boKioWYD341wcELw0wvRPSPFXj98BV+8ovztDXV8IXf 6MAay9tHB+i7O + svkfMzRnkl++NYZLo4ssq1jHQtFz/GeCb766Cb+5Ev3Uygucax3itN9E+zZ0UJF NkiTo+q0c8mbAWVeqmVfMVb53T2bSIzjv45d46f7L7EQRdRVV7Jz60Z+b3c7TzzYydm + +KSozliMX J/no7AmMtWxsruTzezr5te1NvPTKIR75VCuf29NFzsJTj22l7+oivzh2hV8NTdF4d2vqqGXaKZcu Dz1uK6reiZYLFoKx6ZVdHJpm4FqBQqLUVgTc1VpDZ2sd + LooIg4Dx2QIXBme5PlPEWENLXYYdXQ0k GA6dHqSjtZbu9lqS2GMtXJ4ocubSKA99qp3mKluWSaaf0tLzcrF/4PFMde07S7HDeY9XA+IRlMBa UmmTclH1CbEvs3hVjBGsT + TWPR1Dv8c6hCJkgIFGfyohyBbTWYIwldh4rihXBCv2+VHw+ACFOkrI+ AVUHKB5wSZKWt7U0UFZ5qfdpkVzhHivVVSlG0YosWZayPnGIeIwIxhhCa7CizJWWMKoq10avYa1 + d ob5ry7X+HyzNAQkpZ7m5xC9vrrcYMyiBKNnQEEURx48fwyg6MHBlgFwuR2ADjLHp7SzTK13loemp pdxZUX6p8DJrWOqNXcQgRhBjMNZggpBcGOCimJ6+y766pt7Zjs3d + s9bIsyC1dzTXpYuLsLyskbL2 Lj9FTDpuZGVsZW5ZKouk7+k/CZKaQiAwQmgt+UAIrGFgZJSPD//y9Lee/vL3gj0P7XRDV6/9zcGD B39obEBXexvWeJwX3HJNuNFJVo0js + sJPV+XoKpsTkbJUNRj1ZeAGj/JJ/xAffvD+bPuGxn8TkUUB +MdX9mUix99fm5r7eldXV9jR3ka+IpdGg9eyxExt4ctJR8vMWVbASJmHKcYuy1NTHhdEPOphYXGR viuDjA + 4Nz9XlzasvfucPXwCQH+z7Kd949il6e3qCt97d/xdjUzNfyVTUbAyy2bwxqWwymBuqpV/z XMtlRTXVyUawYjDWrgDxeESdxHFpJi4sjqyvrXntxT/65ssAR06dSw/zzz/6 + F7753O8D8NHHR9rO nL+wZ2pqYl0cxyoIoqsm0LK49ehKKLNGp3gE1JRF+9qoU3JBIDVVuZGvffWLZ2oa7rgCcPLMBe7f 0c3/APbD8KaWhlC3AAAAAElFTkSuQmCC`}); + } +} From 156f227ffb2a579b21839dccf889922f31be3ed3 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 16:52:24 +0100 Subject: [PATCH 29/61] Add receive task component --- .../diagram-receive-task.component.html | 2 + .../diagram-receive-task.component.ts | 40 +++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagrams/diagram.component.html | 3 + .../diagram-icon-receive-task.component.html | 2 + .../diagram-icon-receive-task.component.ts | 46 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-receive.component.ts | 67 +++++++++++++++++++ 9 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html new file mode 100644 index 0000000000..d2718f6daf --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts new file mode 100644 index 0000000000..629b6629de --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-receive-task', + templateUrl: './diagram-receive-task.component.html', + styleUrls: ['./diagram-receive-task.component.css'] +}) +export class DiagramReceiveTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 8914dbb10a..d6d8d400af 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -27,6 +27,7 @@ import { DiagramAlfrescoPublishTaskComponent } from './diagram-alfresco-publish- import { DiagramRestCallTaskComponent } from './diagram-rest-call-task.component'; import { DiagramGoogleDrivePublishTaskComponent } from './diagram-google-drive-publish-task.component'; import { DiagramBoxPublishTaskComponent } from './diagram-box-publish-task.component'; +import { DiagramReceiveTaskComponent } from './diagram-receive-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -41,6 +42,7 @@ export * from './diagram-alfresco-publish-task.component'; export * from './diagram-rest-call-task.component'; export * from './diagram-google-drive-publish-task.component'; export * from './diagram-box-publish-task.component'; +export * from './diagram-receive-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -54,5 +56,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramAlfrescoPublishTaskComponent, DiagramRestCallTaskComponent, DiagramGoogleDrivePublishTaskComponent, - DiagramBoxPublishTaskComponent + DiagramBoxPublishTaskComponent, + DiagramReceiveTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index a2741bbffb..2e13f391b3 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -28,6 +28,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html new file mode 100644 index 0000000000..9ca2752fad --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts new file mode 100644 index 0000000000..b786d89e0e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-receive-task', + templateUrl: './diagram-icon-receive-task.component.html', + styleUrls: ['./diagram-icon-receive-task.component.css'] +}) +export class DiagramIconReceiveTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 2}; + this.options.stroke = 'none' ; + this.options.fillColors = '#16964d' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index d23a1b8476..f4d3f719be 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -25,6 +25,7 @@ import { DiagramIconAlfrescoPublishTaskComponent } from './diagram-icon-alfresco import { DiagramIconRestCallTaskComponent } from './diagram-icon-rest-call-task.component'; import { DiagramIconGoogleDrivePublishTaskComponent } from './diagram-icon-google-drive-publish-task.component'; import { DiagramIconBoxPublishTaskComponent } from './diagram-icon-box-publish-task.component'; +import { DiagramIconReceiveTaskComponent } from './diagram-icon-receive-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -37,6 +38,7 @@ export * from './diagram-icon-alfresco-publish-task.component'; export * from './diagram-icon-rest-call-task.component'; export * from './diagram-icon-google-drive-publish-task.component'; export * from './diagram-icon-box-publish-task.component'; +export * from './diagram-icon-receive-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -48,5 +50,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconAlfrescoPublishTaskComponent, DiagramIconRestCallTaskComponent, DiagramIconGoogleDrivePublishTaskComponent, - DiagramIconBoxPublishTaskComponent + DiagramIconBoxPublishTaskComponent, + DiagramIconReceiveTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 830f014404..fa124e96cd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -25,6 +25,7 @@ import { RaphaelIconAlfrescoPublishDirective } from './raphael-icon-alfresco-pub import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component'; import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; import { RaphaelIconBoxPublishDirective } from './raphael-icon-box-publish.component'; +import { RaphaelIconReceiveDirective } from './raphael-icon-receive.component'; // primitives export * from './raphael-icon-service.component'; @@ -37,6 +38,7 @@ export * from './raphael-icon-alfresco-publish.component'; export * from './raphael-icon-rest-call.component'; export * from './raphael-icon-google-drive-publish.component'; export * from './raphael-icon-box-publish.component'; +export * from './raphael-icon-receive.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -48,5 +50,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconAlfrescoPublishDirective, RaphaelIconRestCallDirective, RaphaelIconGoogleDrivePublishDirective, - RaphaelIconBoxPublishDirective + RaphaelIconBoxPublishDirective, + RaphaelIconReceiveDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts new file mode 100644 index 0000000000..6b1aea8a1b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts @@ -0,0 +1,67 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-receive'}) +export class RaphaelIconReceiveDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From da27437f1342176ddb8d4d26c3a008be54d60c33 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 17:04:29 +0100 Subject: [PATCH 30/61] Add script task component --- .../diagram-script-task.component.html | 2 + .../diagram-script-task.component.ts | 40 +++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagrams/diagram.component.html | 3 + .../diagram-icon-script-task.component.html | 2 + .../diagram-icon-script-task.component.ts | 46 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-script.component.ts | 68 +++++++++++++++++++ 9 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html new file mode 100644 index 0000000000..3636798f8d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts new file mode 100644 index 0000000000..f30752b07f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-script-task', + templateUrl: './diagram-script-task.component.html', + styleUrls: ['./diagram-script-task.component.css'] +}) +export class DiagramScriptTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index d6d8d400af..19e90bb12c 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -28,6 +28,7 @@ import { DiagramRestCallTaskComponent } from './diagram-rest-call-task.component import { DiagramGoogleDrivePublishTaskComponent } from './diagram-google-drive-publish-task.component'; import { DiagramBoxPublishTaskComponent } from './diagram-box-publish-task.component'; import { DiagramReceiveTaskComponent } from './diagram-receive-task.component'; +import { DiagramScriptTaskComponent } from './diagram-script-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -43,6 +44,7 @@ export * from './diagram-rest-call-task.component'; export * from './diagram-google-drive-publish-task.component'; export * from './diagram-box-publish-task.component'; export * from './diagram-receive-task.component'; +export * from './diagram-script-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -57,5 +59,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramRestCallTaskComponent, DiagramGoogleDrivePublishTaskComponent, DiagramBoxPublishTaskComponent, - DiagramReceiveTaskComponent + DiagramReceiveTaskComponent, + DiagramScriptTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 2e13f391b3..bc390d89c4 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -31,6 +31,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html new file mode 100644 index 0000000000..d3a6cacdc3 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts new file mode 100644 index 0000000000..3b034af4ab --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-script-task', + templateUrl: './diagram-icon-script-task.component.html', + styleUrls: ['./diagram-icon-script-task.component.css'] +}) +export class DiagramIconScriptTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#72a7d0' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index f4d3f719be..c6104382b2 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -26,6 +26,7 @@ import { DiagramIconRestCallTaskComponent } from './diagram-icon-rest-call-task. import { DiagramIconGoogleDrivePublishTaskComponent } from './diagram-icon-google-drive-publish-task.component'; import { DiagramIconBoxPublishTaskComponent } from './diagram-icon-box-publish-task.component'; import { DiagramIconReceiveTaskComponent } from './diagram-icon-receive-task.component'; +import { DiagramIconScriptTaskComponent } from './diagram-icon-script-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -39,6 +40,7 @@ export * from './diagram-icon-rest-call-task.component'; export * from './diagram-icon-google-drive-publish-task.component'; export * from './diagram-icon-box-publish-task.component'; export * from './diagram-icon-receive-task.component'; +export * from './diagram-icon-script-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -51,5 +53,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconRestCallTaskComponent, DiagramIconGoogleDrivePublishTaskComponent, DiagramIconBoxPublishTaskComponent, - DiagramIconReceiveTaskComponent + DiagramIconReceiveTaskComponent, + DiagramIconScriptTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index fa124e96cd..61f8ab8b89 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -26,6 +26,7 @@ import { RaphaelIconRestCallDirective } from './raphael-icon-rest-call.component import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-drive-publish.component'; import { RaphaelIconBoxPublishDirective } from './raphael-icon-box-publish.component'; import { RaphaelIconReceiveDirective } from './raphael-icon-receive.component'; +import { RaphaelIconScriptDirective } from './raphael-icon-script.component'; // primitives export * from './raphael-icon-service.component'; @@ -39,6 +40,7 @@ export * from './raphael-icon-rest-call.component'; export * from './raphael-icon-google-drive-publish.component'; export * from './raphael-icon-box-publish.component'; export * from './raphael-icon-receive.component'; +export * from './raphael-icon-script.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -51,5 +53,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconRestCallDirective, RaphaelIconGoogleDrivePublishDirective, RaphaelIconBoxPublishDirective, - RaphaelIconReceiveDirective + RaphaelIconReceiveDirective, + RaphaelIconScriptDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts new file mode 100644 index 0000000000..beee45747b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-script'}) +export class RaphaelIconScriptDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 2e41b9ebd83e46cbb5457fe2e5787d4ffdb476e1 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 24 Oct 2016 17:14:11 +0100 Subject: [PATCH 31/61] Add business task component --- .../diagram-business-rule-task.component.html | 2 + .../diagram-business-rule-task.component.ts | 40 +++++++++++ .../components/diagrams/activities/index.ts | 5 +- .../diagrams/diagram.component.html | 3 + ...ram-icon-business-rule-task.component.html | 2 + ...agram-icon-business-rule-task.component.ts | 46 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../raphael-icon-business-rule.component.ts | 68 +++++++++++++++++++ 9 files changed, 173 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html new file mode 100644 index 0000000000..c336058d68 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts new file mode 100644 index 0000000000..1484e02044 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts @@ -0,0 +1,40 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-business-rule-task', + templateUrl: './diagram-business-rule-task.component.html', + styleUrls: ['./diagram-business-rule-task.component.css'] +}) +export class DiagramBusinessRuleTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts index 19e90bb12c..3bafb65341 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts @@ -29,6 +29,7 @@ import { DiagramGoogleDrivePublishTaskComponent } from './diagram-google-drive-p import { DiagramBoxPublishTaskComponent } from './diagram-box-publish-task.component'; import { DiagramReceiveTaskComponent } from './diagram-receive-task.component'; import { DiagramScriptTaskComponent } from './diagram-script-task.component'; +import { DiagramBusinessRuleTaskComponent } from './diagram-business-rule-task.component'; // primitives export * from './diagram-container-service-task.component'; @@ -45,6 +46,7 @@ export * from './diagram-google-drive-publish-task.component'; export * from './diagram-box-publish-task.component'; export * from './diagram-receive-task.component'; export * from './diagram-script-task.component'; +export * from './diagram-business-rule-task.component'; export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramContainerServiceTaskComponent, @@ -60,5 +62,6 @@ export const DIAGRAM_ACTIVITIES_DIRECTIVES: any[] = [ DiagramGoogleDrivePublishTaskComponent, DiagramBoxPublishTaskComponent, DiagramReceiveTaskComponent, - DiagramScriptTaskComponent + DiagramScriptTaskComponent, + DiagramBusinessRuleTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index bc390d89c4..3d50a010b2 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -34,6 +34,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html new file mode 100644 index 0000000000..fe8358e3e3 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts new file mode 100644 index 0000000000..53b946dfaa --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts @@ -0,0 +1,46 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-business-rule-task', + templateUrl: './diagram-icon-business-rule-task.component.html', + styleUrls: ['./diagram-icon-business-rule-task.component.css'] +}) +export class DiagramIconBusinessRuleTaskComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 4, y: this.data.y + 4}; + this.options.stroke = 'none' ; + this.options.fillColors = '#72a7d0' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index c6104382b2..01585c1b42 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -27,6 +27,7 @@ import { DiagramIconGoogleDrivePublishTaskComponent } from './diagram-icon-googl import { DiagramIconBoxPublishTaskComponent } from './diagram-icon-box-publish-task.component'; import { DiagramIconReceiveTaskComponent } from './diagram-icon-receive-task.component'; import { DiagramIconScriptTaskComponent } from './diagram-icon-script-task.component'; +import { DiagramIconBusinessRuleTaskComponent } from './diagram-icon-business-rule-task.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -41,6 +42,7 @@ export * from './diagram-icon-google-drive-publish-task.component'; export * from './diagram-icon-box-publish-task.component'; export * from './diagram-icon-receive-task.component'; export * from './diagram-icon-script-task.component'; +export * from './diagram-icon-business-rule-task.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -54,5 +56,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconGoogleDrivePublishTaskComponent, DiagramIconBoxPublishTaskComponent, DiagramIconReceiveTaskComponent, - DiagramIconScriptTaskComponent + DiagramIconScriptTaskComponent, + DiagramIconBusinessRuleTaskComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 61f8ab8b89..8edbc173d8 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -27,6 +27,7 @@ import { RaphaelIconGoogleDrivePublishDirective } from './raphael-icon-google-dr import { RaphaelIconBoxPublishDirective } from './raphael-icon-box-publish.component'; import { RaphaelIconReceiveDirective } from './raphael-icon-receive.component'; import { RaphaelIconScriptDirective } from './raphael-icon-script.component'; +import { RaphaelIconBusinessRuleDirective } from './raphael-icon-business-rule.component'; // primitives export * from './raphael-icon-service.component'; @@ -41,6 +42,7 @@ export * from './raphael-icon-google-drive-publish.component'; export * from './raphael-icon-box-publish.component'; export * from './raphael-icon-receive.component'; export * from './raphael-icon-script.component'; +export * from './raphael-icon-business-rule.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -54,5 +56,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconGoogleDrivePublishDirective, RaphaelIconBoxPublishDirective, RaphaelIconReceiveDirective, - RaphaelIconScriptDirective + RaphaelIconScriptDirective, + RaphaelIconBusinessRuleDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts new file mode 100644 index 0000000000..c782593f0c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-business-rule'}) +export class RaphaelIconBusinessRuleDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 2b907348d522aab3c652eb5b4b5d0ef7100ef5f6 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 10:18:03 +0100 Subject: [PATCH 32/61] Add boundary event component --- .../diagram-boundary-event.component.html | 5 ++ .../diagram-boundary-event.component.ts | 54 ++++++++++++++ .../diagrams/boundary-events/index.ts | 25 +++++++ .../diagrams/diagram.component.html | 3 + ...iagram-container-icon-event.component.html | 5 ++ .../diagram-container-icon-event.component.ts | 42 +++++++++++ .../icons/diagram-icon-timer.component.html | 4 ++ .../icons/diagram-icon-timer.component.ts | 56 +++++++++++++++ .../src/components/diagrams/icons/index.ts | 8 ++- .../src/components/diagrams/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-timer.component.ts | 72 +++++++++++++++++++ 12 files changed, 281 insertions(+), 3 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html new file mode 100644 index 0000000000..b5eb151f55 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts new file mode 100644 index 0000000000..c306de4ba8 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-boundary-event', + templateUrl: './diagram-boundary-event.component.html', + styleUrls: ['./diagram-boundary-event.component.css'] +}) +export class DiagramBoundaryEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 1}; + + circleRadiusInner: number; + circleRadiusOuter: number; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + + this.circleRadiusInner = 12; + this.circleRadiusOuter = 15; + + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts new file mode 100644 index 0000000000..e42095b039 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramBoundaryEventComponent } from './diagram-boundary-event.component'; + +// primitives +export * from './diagram-boundary-event.component'; + +export const DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES: any[] = [ + DiagramBoundaryEventComponent +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 3d50a010b2..d10c601cc0 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -37,6 +37,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html new file mode 100644 index 0000000000..25b1262bac --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -0,0 +1,5 @@ +
+
+ +
+
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts new file mode 100644 index 0000000000..6939692c60 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-container-icon-event', + templateUrl: './diagram-container-icon-event.component.html', + styleUrls: ['./diagram-container-icon-event.component.css'] +}) +export class DiagramContainerIconEventTaskComponent { + @Input() + data: any; + + @Input() + type: string; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html new file mode 100644 index 0000000000..1bb93fff2a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts new file mode 100644 index 0000000000..4c3ad4b014 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts @@ -0,0 +1,56 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-timer', + templateUrl: './diagram-icon-timer.component.html', + styleUrls: ['./diagram-icon-timer.component.css'] +}) +export class DiagramIconTimerComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + position: any; + + circleRadius: number; + + circleOptions: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + timerOptions: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + this.circleRadius = 10; + this.position = {x: this.data.x + 5, y: this.data.y + 5}; + + this.circleOptions.stroke = 'black' ; + this.circleOptions.fillColors = 'none' ; + this.timerOptions.stroke = 'none' ; + this.timerOptions.fillColors = '#585858' ; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 01585c1b42..8012f75124 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -28,6 +28,8 @@ import { DiagramIconBoxPublishTaskComponent } from './diagram-icon-box-publish-t import { DiagramIconReceiveTaskComponent } from './diagram-icon-receive-task.component'; import { DiagramIconScriptTaskComponent } from './diagram-icon-script-task.component'; import { DiagramIconBusinessRuleTaskComponent } from './diagram-icon-business-rule-task.component'; +import { DiagramContainerIconEventTaskComponent } from './diagram-container-icon-event.component'; +import { DiagramIconTimerComponent } from './diagram-icon-timer.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -43,6 +45,8 @@ export * from './diagram-icon-box-publish-task.component'; export * from './diagram-icon-receive-task.component'; export * from './diagram-icon-script-task.component'; export * from './diagram-icon-business-rule-task.component'; +export * from './diagram-container-icon-event.component'; +export * from './diagram-icon-timer.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -57,5 +61,7 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconBoxPublishTaskComponent, DiagramIconReceiveTaskComponent, DiagramIconScriptTaskComponent, - DiagramIconBusinessRuleTaskComponent + DiagramIconBusinessRuleTaskComponent, + DiagramContainerIconEventTaskComponent, + DiagramIconTimerComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index 983ea885f0..a8ac0e0a49 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -21,6 +21,7 @@ import { DIAGRAM_ACTIVITIES_DIRECTIVES } from './activities/index'; import { DIAGRAM_EVENTS_DIRECTIVES } from './events/index'; import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index'; import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index'; +import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index'; import { DiagramColorService } from './services/diagram-color.service'; @@ -30,6 +31,7 @@ export * from './events/index'; export * from './activities/index'; export * from './icons/index'; export * from './diagram-sequence-flow.component'; +export * from './boundary-events/index'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, @@ -37,7 +39,8 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DIAGRAM_ACTIVITIES_DIRECTIVES, DiagramSequenceFlowComponent, DIAGRAM_GATEWAY_DIRECTIVES, - DIAGRAM_ICONS_DIRECTIVES + DIAGRAM_ICONS_DIRECTIVES, + DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES ]; export const DIAGRAM_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 8edbc173d8..93d19057b8 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -28,6 +28,7 @@ import { RaphaelIconBoxPublishDirective } from './raphael-icon-box-publish.compo import { RaphaelIconReceiveDirective } from './raphael-icon-receive.component'; import { RaphaelIconScriptDirective } from './raphael-icon-script.component'; import { RaphaelIconBusinessRuleDirective } from './raphael-icon-business-rule.component'; +import { RaphaelIconTimerDirective } from './raphael-icon-timer.component'; // primitives export * from './raphael-icon-service.component'; @@ -43,6 +44,7 @@ export * from './raphael-icon-box-publish.component'; export * from './raphael-icon-receive.component'; export * from './raphael-icon-script.component'; export * from './raphael-icon-business-rule.component'; +export * from './raphael-icon-timer.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -57,5 +59,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconBoxPublishDirective, RaphaelIconReceiveDirective, RaphaelIconScriptDirective, - RaphaelIconBusinessRuleDirective + RaphaelIconBusinessRuleDirective, + RaphaelIconTimerDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts new file mode 100644 index 0000000000..22156b044a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts @@ -0,0 +1,72 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-timer'}) +export class RaphaelIconTimerDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + 15.063526 15.063526 18.713217 10.5 18.96875 L 10.5 16.5 L 9.5 16.5 L 9.5 18.96875 C 4.9364738 18.713217 1.2867831 15.063526 1.03125 + 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From bc1385bfd2a6a1ba9614387c9fc88ea68f8368af Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 10:56:31 +0100 Subject: [PATCH 33/61] add intermediate catching event component --- .../diagrams/diagram.component.html | 3 ++ .../src/components/diagrams/index.ts | 5 +- ...intermediate-catching-event.component.html | 5 ++ ...m-intermediate-catching-event.component.ts | 54 +++++++++++++++++++ .../intermediate-catching-events/index.ts | 25 +++++++++ 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index d10c601cc0..b2e9bb0cbd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -40,6 +40,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index a8ac0e0a49..a5e5dfec49 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -22,6 +22,7 @@ import { DIAGRAM_EVENTS_DIRECTIVES } from './events/index'; import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index'; import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index'; import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index'; +import { DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES } from './intermediate-catching-events/index'; import { DiagramColorService } from './services/diagram-color.service'; @@ -32,6 +33,7 @@ export * from './activities/index'; export * from './icons/index'; export * from './diagram-sequence-flow.component'; export * from './boundary-events/index'; +export * from './intermediate-catching-events/index'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, @@ -40,7 +42,8 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DiagramSequenceFlowComponent, DIAGRAM_GATEWAY_DIRECTIVES, DIAGRAM_ICONS_DIRECTIVES, - DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES + DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES, + DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES ]; export const DIAGRAM_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html new file mode 100644 index 0000000000..b5eb151f55 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts new file mode 100644 index 0000000000..96cb9bfc2d --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-intermediate-catching-event', + templateUrl: './diagram-intermediate-catching-event.component.html', + styleUrls: ['./diagram-intermediate-catching-event.component.css'] +}) +export class DiagramIntermediateCatchingEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 1}; + + circleRadiusInner: number; + circleRadiusOuter: number; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + + this.circleRadiusInner = 12; + this.circleRadiusOuter = 15; + + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts new file mode 100644 index 0000000000..bfebc82955 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramIntermediateCatchingEventComponent } from './diagram-intermediate-catching-event.component'; + +// primitives +export * from './diagram-intermediate-catching-event.component'; + +export const DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES: any[] = [ + DiagramIntermediateCatchingEventComponent +]; From f4e73d7d5a69c55c9d165aff2b6572f5bddeb077 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 11:10:09 +0100 Subject: [PATCH 34/61] Add event timer component --- ...iagram-container-icon-event.component.html | 3 + .../icons/diagram-icon-error.component.html | 2 + .../icons/diagram-icon-error.component.ts | 48 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-error.component.ts | 68 +++++++++++++++++++ 6 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index 25b1262bac..cff53f821a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -2,4 +2,7 @@
+
+ +
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html new file mode 100644 index 0000000000..2355c39b1a --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts new file mode 100644 index 0000000000..20175ae320 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-error', + templateUrl: './diagram-icon-error.component.html', + styleUrls: ['./diagram-icon-error.component.css'] +}) +export class DiagramIconErrorComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x - 1, y: this.data.y - 1}; + + this.options.stroke = 'black'; + this.options.fillColors = 'none'; + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 8012f75124..3083c66ca9 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -30,6 +30,7 @@ import { DiagramIconScriptTaskComponent } from './diagram-icon-script-task.compo import { DiagramIconBusinessRuleTaskComponent } from './diagram-icon-business-rule-task.component'; import { DiagramContainerIconEventTaskComponent } from './diagram-container-icon-event.component'; import { DiagramIconTimerComponent } from './diagram-icon-timer.component'; +import { DiagramIconErrorComponent } from './diagram-icon-error.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -47,6 +48,7 @@ export * from './diagram-icon-script-task.component'; export * from './diagram-icon-business-rule-task.component'; export * from './diagram-container-icon-event.component'; export * from './diagram-icon-timer.component'; +export * from './diagram-icon-error.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -63,5 +65,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconScriptTaskComponent, DiagramIconBusinessRuleTaskComponent, DiagramContainerIconEventTaskComponent, - DiagramIconTimerComponent + DiagramIconTimerComponent, + DiagramIconErrorComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 93d19057b8..d840eafce2 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -29,6 +29,7 @@ import { RaphaelIconReceiveDirective } from './raphael-icon-receive.component'; import { RaphaelIconScriptDirective } from './raphael-icon-script.component'; import { RaphaelIconBusinessRuleDirective } from './raphael-icon-business-rule.component'; import { RaphaelIconTimerDirective } from './raphael-icon-timer.component'; +import { RaphaelIconErrorDirective } from './raphael-icon-error.component'; // primitives export * from './raphael-icon-service.component'; @@ -45,6 +46,7 @@ export * from './raphael-icon-receive.component'; export * from './raphael-icon-script.component'; export * from './raphael-icon-business-rule.component'; export * from './raphael-icon-timer.component'; +export * from './raphael-icon-error.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -60,5 +62,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconReceiveDirective, RaphaelIconScriptDirective, RaphaelIconBusinessRuleDirective, - RaphaelIconTimerDirective + RaphaelIconTimerDirective, + RaphaelIconErrorDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts new file mode 100644 index 0000000000..c77ab84943 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-error'}) +export class RaphaelIconErrorDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 3c036d97b7963b77cbee3e5298a27bbe984bb864 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 11:29:19 +0100 Subject: [PATCH 35/61] Add signal event component --- ...iagram-container-icon-event.component.html | 3 + .../icons/diagram-icon-signal.component.html | 2 + .../icons/diagram-icon-signal.component.ts | 48 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-signal.component.ts | 68 +++++++++++++++++++ 6 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index cff53f821a..8633fab8aa 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -5,4 +5,7 @@
+
+ +
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html new file mode 100644 index 0000000000..3f926dce44 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts new file mode 100644 index 0000000000..c8231e0757 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-signal', + templateUrl: './diagram-icon-signal.component.html', + styleUrls: ['./diagram-icon-signal.component.css'] +}) +export class DiagramIconSignalComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x - 1, y: this.data.y - 1}; + + this.options.stroke = 'black'; + this.options.fillColors = 'none'; + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index 3083c66ca9..e79dd73841 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -31,6 +31,7 @@ import { DiagramIconBusinessRuleTaskComponent } from './diagram-icon-business-ru import { DiagramContainerIconEventTaskComponent } from './diagram-container-icon-event.component'; import { DiagramIconTimerComponent } from './diagram-icon-timer.component'; import { DiagramIconErrorComponent } from './diagram-icon-error.component'; +import { DiagramIconSignalComponent } from './diagram-icon-signal.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -49,6 +50,7 @@ export * from './diagram-icon-business-rule-task.component'; export * from './diagram-container-icon-event.component'; export * from './diagram-icon-timer.component'; export * from './diagram-icon-error.component'; +export * from './diagram-icon-signal.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -66,5 +68,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconBusinessRuleTaskComponent, DiagramContainerIconEventTaskComponent, DiagramIconTimerComponent, - DiagramIconErrorComponent + DiagramIconErrorComponent, + DiagramIconSignalComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index d840eafce2..3502590e01 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -30,6 +30,7 @@ import { RaphaelIconScriptDirective } from './raphael-icon-script.component'; import { RaphaelIconBusinessRuleDirective } from './raphael-icon-business-rule.component'; import { RaphaelIconTimerDirective } from './raphael-icon-timer.component'; import { RaphaelIconErrorDirective } from './raphael-icon-error.component'; +import { RaphaelIconSignalDirective } from './raphael-icon-signal.component'; // primitives export * from './raphael-icon-service.component'; @@ -47,6 +48,7 @@ export * from './raphael-icon-script.component'; export * from './raphael-icon-business-rule.component'; export * from './raphael-icon-timer.component'; export * from './raphael-icon-error.component'; +export * from './raphael-icon-signal.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -63,5 +65,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconScriptDirective, RaphaelIconBusinessRuleDirective, RaphaelIconTimerDirective, - RaphaelIconErrorDirective + RaphaelIconErrorDirective, + RaphaelIconSignalDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts new file mode 100644 index 0000000000..7a0b6f5657 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts @@ -0,0 +1,68 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-signal'}) +export class RaphaelIconSignalDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 5d95c1203f12da0847aa10c74fa92928cd15e94c Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 11:35:40 +0100 Subject: [PATCH 36/61] Add event message component --- ...iagram-container-icon-event.component.html | 3 + .../icons/diagram-icon-message.component.html | 2 + .../icons/diagram-icon-message.component.ts | 48 +++++++++++++ .../src/components/diagrams/icons/index.ts | 5 +- .../src/components/raphael/icons/index.ts | 5 +- .../icons/raphael-icon-message.component.ts | 69 +++++++++++++++++++ 6 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index 8633fab8aa..f1f54c927b 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -8,4 +8,7 @@
+
+ +
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html new file mode 100644 index 0000000000..6f4870c1fb --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts new file mode 100644 index 0000000000..14e4a3506c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts @@ -0,0 +1,48 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-icon-message', + templateUrl: './diagram-icon-message.component.html', + styleUrls: ['./diagram-icon-message.component.css'] +}) +export class DiagramIconMessageComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + position: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.position = {x: this.data.x + 6, y: this.data.y + 6}; + + this.options.stroke = 'none'; + this.options.fillColors = '#585858'; + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts index e79dd73841..70777e92bc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts @@ -32,6 +32,7 @@ import { DiagramContainerIconEventTaskComponent } from './diagram-container-icon import { DiagramIconTimerComponent } from './diagram-icon-timer.component'; import { DiagramIconErrorComponent } from './diagram-icon-error.component'; import { DiagramIconSignalComponent } from './diagram-icon-signal.component'; +import { DiagramIconMessageComponent } from './diagram-icon-message.component'; // primitives export * from './diagram-icon-service-task.component'; @@ -51,6 +52,7 @@ export * from './diagram-container-icon-event.component'; export * from './diagram-icon-timer.component'; export * from './diagram-icon-error.component'; export * from './diagram-icon-signal.component'; +export * from './diagram-icon-message.component'; export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramIconServiceTaskComponent, @@ -69,5 +71,6 @@ export const DIAGRAM_ICONS_DIRECTIVES: any[] = [ DiagramContainerIconEventTaskComponent, DiagramIconTimerComponent, DiagramIconErrorComponent, - DiagramIconSignalComponent + DiagramIconSignalComponent, + DiagramIconMessageComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts index 3502590e01..7605b66ab6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts @@ -31,6 +31,7 @@ import { RaphaelIconBusinessRuleDirective } from './raphael-icon-business-rule.c import { RaphaelIconTimerDirective } from './raphael-icon-timer.component'; import { RaphaelIconErrorDirective } from './raphael-icon-error.component'; import { RaphaelIconSignalDirective } from './raphael-icon-signal.component'; +import { RaphaelIconMessageDirective } from './raphael-icon-message.component'; // primitives export * from './raphael-icon-service.component'; @@ -49,6 +50,7 @@ export * from './raphael-icon-business-rule.component'; export * from './raphael-icon-timer.component'; export * from './raphael-icon-error.component'; export * from './raphael-icon-signal.component'; +export * from './raphael-icon-message.component'; export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconServiceDirective, @@ -66,5 +68,6 @@ export const RAPHAEL_ICONS_DIRECTIVES: any[] = [ RaphaelIconBusinessRuleDirective, RaphaelIconTimerDirective, RaphaelIconErrorDirective, - RaphaelIconSignalDirective + RaphaelIconSignalDirective, + RaphaelIconMessageDirective ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts new file mode 100644 index 0000000000..85ea452f61 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts @@ -0,0 +1,69 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Directive, OnInit, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Point } from './../models/point'; +import { RaphaelBase } from './../raphael-base'; +import { RaphaelService } from './../raphael.service'; + +@Directive({selector: 'raphael-icon-message'}) +export class RaphaelIconMessageDirective extends RaphaelBase implements OnInit { + @Input() + paper: any; + + @Input() + position: Point; + + @Input() + text: string; + + @Output() + onError = new EventEmitter(); + + @Input() + strokeWidth: number; + + @Input() + fillColors: any; + + @Input() + stroke: any; + + @Input() + fillOpacity: any; + + constructor(public elementRef: ElementRef, + raphaelService: RaphaelService) { + super(elementRef, raphaelService); + } + + ngOnInit() { + console.log(this.elementRef); + this.draw(this.position); + } + + public draw(position: Point) { + let 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 + }); + return path1.transform('T' + position.x + ',' + position.y); + } +} From 042a6f6765064358af4baa6eb0a1899fd5cdd2c4 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 12:18:50 +0100 Subject: [PATCH 37/61] Add Throw Event Component --- .../diagram-boundary-event.component.html | 2 +- .../diagram-boundary-event.component.ts | 4 ++ .../diagram-throw-event.component.html | 6 ++ .../diagram-throw-event.component.ts | 58 +++++++++++++++++++ .../diagrams/boundary-events/index.ts | 5 +- .../diagrams/diagram.component.html | 3 + ...iagram-container-icon-event.component.html | 2 +- .../diagram-container-icon-event.component.ts | 3 + .../icons/diagram-icon-signal.component.ts | 5 +- 9 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html index b5eb151f55..9607de4538 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html @@ -2,4 +2,4 @@ [fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"> - \ No newline at end of file + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts index c306de4ba8..cb8bb1b687 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts @@ -34,6 +34,8 @@ export class DiagramBoundaryEventComponent { center: any = {}; options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 1}; + signalFillColor: string; + circleRadiusInner: number; circleRadiusOuter: number; @@ -50,5 +52,7 @@ export class DiagramBoundaryEventComponent { this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + + this.signalFillColor = 'none'; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html new file mode 100644 index 0000000000..b4dddf5c31 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts new file mode 100644 index 0000000000..3d95ea9e94 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts @@ -0,0 +1,58 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-throw-event', + templateUrl: './diagram-throw-event.component.html', + styleUrls: ['./diagram-throw-event.component.css'] +}) +export class DiagramThrowEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + center: any = {}; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: 1}; + + signalFillColor: string; + + circleRadiusInner: number; + circleRadiusOuter: number; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.center.x = this.data.x + (this.data.width / 2); + this.center.y = this.data.y + (this.data.height / 2); + + this.circleRadiusInner = 12; + this.circleRadiusOuter = 15; + + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + + this.signalFillColor = 'black'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts index e42095b039..248bf142cc 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts @@ -16,10 +16,13 @@ */ import { DiagramBoundaryEventComponent } from './diagram-boundary-event.component'; +import { DiagramThrowEventComponent } from './diagram-throw-event.component'; // primitives export * from './diagram-boundary-event.component'; +export * from './diagram-throw-event.component'; export const DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES: any[] = [ - DiagramBoundaryEventComponent + DiagramBoundaryEventComponent, + DiagramThrowEventComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index b2e9bb0cbd..fc7e2dedcf 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -40,6 +40,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index f1f54c927b..391f67b07e 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -6,7 +6,7 @@
- +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts index 6939692c60..b77cb4af71 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts @@ -31,6 +31,9 @@ export class DiagramContainerIconEventTaskComponent { @Input() type: string; + @Input() + fillColor: string; + @Output() onError = new EventEmitter(); diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts index c8231e0757..154b0b7c98 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts @@ -28,6 +28,9 @@ export class DiagramIconSignalComponent { @Input() data: any; + @Input() + fillColor: string; + @Output() onError = new EventEmitter(); @@ -42,7 +45,7 @@ export class DiagramIconSignalComponent { this.position = {x: this.data.x - 1, y: this.data.y - 1}; this.options.stroke = 'black'; - this.options.fillColors = 'none'; + this.options.fillColors = this.fillColor; this.options.strokeWidth = 1; } } From 602d44f2fa1d74476df555502c383e73fb859e7c Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 13:47:39 +0100 Subject: [PATCH 38/61] Add subprocess component --- .../diagrams/diagram.component.html | 3 ++ .../src/components/diagrams/index.ts | 5 +- .../diagram-subprocess.component.html | 3 ++ .../diagram-subprocess.component.ts | 52 +++++++++++++++++++ .../components/diagrams/structural/index.ts | 25 +++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index fc7e2dedcf..9c7845ad53 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -46,6 +46,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts index a5e5dfec49..59656b5e75 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts @@ -23,6 +23,7 @@ import { DIAGRAM_GATEWAY_DIRECTIVES } from './gateways/index'; import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index'; import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index'; import { DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES } from './intermediate-catching-events/index'; +import { DIAGRAM_STRUCTURAL_DIRECTIVES } from './structural/index'; import { DiagramColorService } from './services/diagram-color.service'; @@ -34,6 +35,7 @@ export * from './icons/index'; export * from './diagram-sequence-flow.component'; export * from './boundary-events/index'; export * from './intermediate-catching-events/index'; +export * from './structural/index'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, @@ -43,7 +45,8 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DIAGRAM_GATEWAY_DIRECTIVES, DIAGRAM_ICONS_DIRECTIVES, DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES, - DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES + DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES, + DIAGRAM_STRUCTURAL_DIRECTIVES ]; export const DIAGRAM_PROVIDERS: any[] = [ diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html new file mode 100644 index 0000000000..a3b195375b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts new file mode 100644 index 0000000000..50bf2e8ab7 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-subprocess', + templateUrl: './diagram-subprocess.component.html', + styleUrls: ['./diagram-subprocess.component.css'] +}) +export class DiagramSubprocessComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + rectLeftCorner: any; + width: any; + height: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: 4}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.rectLeftCorner = {x: this.data.x, y: this.data.y}; + this.width = this.data.width; + this.height = this.data.height; + + this.options.fillColors = 'none'; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts new file mode 100644 index 0000000000..1f283e491e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts @@ -0,0 +1,25 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramSubprocessComponent } from './diagram-subprocess.component'; + +// primitives +export * from './diagram-subprocess.component'; + +export const DIAGRAM_STRUCTURAL_DIRECTIVES: any[] = [ + DiagramSubprocessComponent +]; From 7b44819326325f8c496e8352ac3c25f7c99c145d Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 15:08:38 +0100 Subject: [PATCH 39/61] Add subprocess component and fix start/end event icon --- .../diagrams/diagram.component.html | 7 ++- .../events/diagram-end-event.component.html | 1 + .../events/diagram-end-event.component.ts | 51 ++++++++++++++++++ .../events/diagram-event.component.html | 4 +- .../events/diagram-event.component.ts | 11 +--- .../events/diagram-start-event.component.html | 1 + .../events/diagram-start-event.component.ts | 51 ++++++++++++++++++ .../src/components/diagrams/events/index.ts | 8 ++- ...iagram-container-icon-event.component.html | 2 +- .../icons/diagram-icon-error.component.ts | 5 +- .../diagram-event-subprocess.component.html | 3 ++ .../diagram-event-subprocess.component.ts | 52 +++++++++++++++++++ .../components/diagrams/structural/index.ts | 5 +- 13 files changed, 185 insertions(+), 16 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html index 9c7845ad53..3f2240fcdd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html @@ -2,7 +2,7 @@
- +
@@ -17,7 +17,7 @@
- +
@@ -49,6 +49,9 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html new file mode 100644 index 0000000000..ae975d5b9f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts new file mode 100644 index 0000000000..cbd7d2213c --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-end-event', + templateUrl: './diagram-end-event.component.html', + styleUrls: ['./diagram-end-event.component.css'] +}) +export class DiagramEndEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; + iconFillColor: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + console.log(this.elementRef); + + this.options.radius = 14; + this.options.strokeWidth = 4; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + + this.iconFillColor = 'black'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html index c4de55c9cc..e85a6aee8d 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html @@ -1,2 +1,4 @@ \ No newline at end of file + [fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"> + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts index f588272b0f..63682a4366 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts @@ -29,16 +29,15 @@ export class DiagramEventComponent { data: any; @Input() - strokeWidth: number; + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; @Input() - radius: number; + iconFillColor: any; @Output() onError = new EventEmitter(); center: any = {}; - options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; constructor(public elementRef: ElementRef, private diagramColorService: DiagramColorService) {} @@ -47,11 +46,5 @@ export class DiagramEventComponent { console.log(this.elementRef); this.center.x = this.data.x + (this.data.width / 2); this.center.y = this.data.y + (this.data.height / 2); - - this.options.radius = this.radius; - this.options.strokeWidth = this.strokeWidth; - this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); - this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); - this.options.fillOpacity = this.diagramColorService.getFillOpacity(); } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html new file mode 100644 index 0000000000..ae975d5b9f --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts new file mode 100644 index 0000000000..09dcaaa231 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts @@ -0,0 +1,51 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-start-event', + templateUrl: './diagram-start-event.component.html', + styleUrls: ['./diagram-start-event.component.css'] +}) +export class DiagramStartEventComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: ''}; + iconFillColor: any; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + console.log(this.elementRef); + + this.options.radius = 15; + this.options.strokeWidth = 1; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.fillColors = this.diagramColorService.getFillColour(this.data.id); + this.options.fillOpacity = this.diagramColorService.getFillOpacity(); + + this.iconFillColor = 'none'; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts index b879aad332..fe24b0eb39 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts @@ -16,10 +16,16 @@ */ import { DiagramEventComponent } from './diagram-event.component'; +import { DiagramStartEventComponent } from './diagram-start-event.component'; +import { DiagramEndEventComponent } from './diagram-end-event.component'; // primitives export * from './diagram-event.component'; +export * from './diagram-start-event.component'; +export * from './diagram-end-event.component'; export const DIAGRAM_EVENTS_DIRECTIVES: any[] = [ - DiagramEventComponent + DiagramEventComponent, + DiagramStartEventComponent, + DiagramEndEventComponent ]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html index 391f67b07e..00ffb44abd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html @@ -3,7 +3,7 @@
- +
diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts index 20175ae320..c735603187 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts @@ -28,6 +28,9 @@ export class DiagramIconErrorComponent { @Input() data: any; + @Input() + fillColor: string; + @Output() onError = new EventEmitter(); @@ -42,7 +45,7 @@ export class DiagramIconErrorComponent { this.position = {x: this.data.x - 1, y: this.data.y - 1}; this.options.stroke = 'black'; - this.options.fillColors = 'none'; + this.options.fillColors = this.fillColor; this.options.strokeWidth = 1; } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html new file mode 100644 index 0000000000..a3b195375b --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts new file mode 100644 index 0000000000..7d7b451e20 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts @@ -0,0 +1,52 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from './../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-event-subprocess', + templateUrl: './diagram-event-subprocess.component.html', + styleUrls: ['./diagram-event-subprocess.component.css'] +}) +export class DiagramEventSubprocessComponent { + @Input() + data: any; + + @Output() + onError = new EventEmitter(); + + rectLeftCorner: any; + width: any; + height: any; + + options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: '', radius: 4}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.rectLeftCorner = {x: this.data.x, y: this.data.y}; + this.width = this.data.width; + this.height = this.data.height; + + this.options.fillColors = 'none'; + this.options.stroke = this.diagramColorService.getBpmnColor(this.data, DiagramColorService.MAIN_STROKE_COLOR); + this.options.strokeWidth = 1; + } +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts index 1f283e491e..a13ebbc842 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts @@ -16,10 +16,13 @@ */ import { DiagramSubprocessComponent } from './diagram-subprocess.component'; +import { DiagramEventSubprocessComponent } from './diagram-event-subprocess.component'; // primitives export * from './diagram-subprocess.component'; +export * from './diagram-event-subprocess.component'; export const DIAGRAM_STRUCTURAL_DIRECTIVES: any[] = [ - DiagramSubprocessComponent + DiagramSubprocessComponent, + DiagramEventSubprocessComponent ]; From 75915dc623777152b15a1af7cd6120f923ce18f6 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 17:27:04 +0100 Subject: [PATCH 40/61] Improve Heat map integration --- .../ng2-activiti-analytics/index.ts | 12 +-- .../analytics-report-heat-map.component.html | 7 ++ .../analytics-report-heat-map.component.ts | 83 +++++++++++++++++++ .../src/components/analytics.component.html | 2 +- .../components/diagrams/diagram.component.ts | 28 ++++++- .../src/components/raphael/index.ts | 7 ++ .../src/components/raphael/raphael.service.ts | 15 +++- .../src/services/analytics.service.ts | 13 +++ 8 files changed, 155 insertions(+), 12 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.html create mode 100644 ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts diff --git a/ng2-components/ng2-activiti-analytics/index.ts b/ng2-components/ng2-activiti-analytics/index.ts index 7a96c28b26..dd371a3c3d 100644 --- a/ng2-components/ng2-activiti-analytics/index.ts +++ b/ng2-components/ng2-activiti-analytics/index.ts @@ -21,14 +21,15 @@ import { CoreModule } from 'ng2-alfresco-core'; import { AnalyticsReportListComponent } from './src/components/analytics-report-list.component'; import { AnalyticsReportParametersComponent } from './src/components/analytics-report-parameters.component'; import { AnalyticsComponent } from './src/components/analytics.component'; +import { AnalyticsReportHeatMapComponent } from './src/components/analytics-report-heat-map.component'; import { AnalyticsService } from './src/services/analytics.service'; -import { RaphaelService } from './src/components/raphael/raphael.service'; import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { WIDGET_DIRECTIVES } from './src/components/widgets/index'; import { RAPHAEL_DIRECTIVES } from './src/components/raphael/index'; import { DIAGRAM_DIRECTIVES } from './src/components/diagrams/index'; import { DIAGRAM_PROVIDERS } from './src/components/diagrams/index'; +import { RAPHAEL_PROVIDERS } from './src/components/raphael/index'; export * from './src/components/analytics.component'; export * from './src/components/analytics-report-list.component'; @@ -42,14 +43,14 @@ export const ANALYTICS_DIRECTIVES: any[] = [ AnalyticsComponent, AnalyticsReportListComponent, AnalyticsReportParametersComponent, + AnalyticsReportHeatMapComponent, WIDGET_DIRECTIVES, RAPHAEL_DIRECTIVES, DIAGRAM_DIRECTIVES ]; export const ANALYTICS_PROVIDERS: any[] = [ - AnalyticsService, - DIAGRAM_PROVIDERS + AnalyticsService ]; @NgModule({ @@ -63,7 +64,7 @@ export const ANALYTICS_PROVIDERS: any[] = [ providers: [ ...ANALYTICS_PROVIDERS, ...DIAGRAM_PROVIDERS, - RaphaelService + ...RAPHAEL_PROVIDERS ], exports: [ ...ANALYTICS_DIRECTIVES @@ -75,7 +76,8 @@ export class AnalyticsModule { ngModule: AnalyticsModule, providers: [ ...ANALYTICS_PROVIDERS, - ...DIAGRAM_PROVIDERS + ...DIAGRAM_PROVIDERS, + ...RAPHAEL_PROVIDERS ] }; } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.html b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.html new file mode 100644 index 0000000000..c79fe3a458 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.html @@ -0,0 +1,7 @@ +

Process Heat map

+
+ +
+ + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts new file mode 100644 index 0000000000..7533d6ce6e --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts @@ -0,0 +1,83 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { AlfrescoTranslationService } from 'ng2-alfresco-core'; +import { AnalyticsService } from '../services/analytics.service'; +import { FormGroup, FormBuilder, FormControl } from '@angular/forms'; + +@Component({ + moduleId: module.id, + selector: 'analytics-report-heat-map', + templateUrl: './analytics-report-heat-map.component.html', + styleUrls: ['./analytics-report-heat-map.component.css'] +}) +export class AnalyticsReportHeatMapComponent implements OnInit { + + @Input() + report: any; + + @Output() + onError = new EventEmitter(); + + field: any = {}; + + metricForm: FormGroup; + currentMetric: any; + + constructor(private translate: AlfrescoTranslationService, + private analyticsService: AnalyticsService, + private formBuilder: FormBuilder) { + if (translate) { + translate.addTranslationFolder('node_modules/ng2-activiti-analytics/src'); + } + } + + ngOnInit() { + this.initForm(); + this.field.id = 'metrics'; + + this.analyticsService.getMetricValues().subscribe( + (opts: any[]) => { + this.field.options = opts; + }, + (err: any) => { + console.log(err); + this.onError.emit(err); + } + ); + } + + onMetricChanges(field: any) { + if (field.value === 'totalCount') { + this.currentMetric = this.report.totalCountsPercentages; + } else if (field.value === 'totalTime') { + this.currentMetric = this.report.totalTimePercentages; + } else if (field.value === 'avgTime') { + this.currentMetric = this.report.avgTimePercentages; + } + } + + initForm() { + this.metricForm = this.formBuilder.group({ + metricGroup: new FormGroup({ + metric: new FormControl() + }) + }); + } + +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html index 8be52c6037..e12995435e 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.html @@ -52,7 +52,7 @@
- +
{{'ANALYTICS.MESSAGES.UNKNOWN-WIDGET-TYPE' | translate}}: {{report.type}} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts index 2a4e480f23..3c5964bfa7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts @@ -15,10 +15,11 @@ * limitations under the License. */ -import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { Component, ElementRef, Input, Output, EventEmitter, SimpleChanges } from '@angular/core'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { AnalyticsService } from '../../services/analytics.service'; import { DiagramColorService } from './services/diagram-color.service'; +import { RaphaelService } from './../raphael/raphael.service'; @Component({ moduleId: module.id, @@ -28,7 +29,16 @@ import { DiagramColorService } from './services/diagram-color.service'; }) export class DiagramComponent { @Input() - report: any; + processDefinitionId: any; + + @Input() + metricPercentages: any; + + @Input() + width: number = 1000; + + @Input() + height: number = 500; @Output() onError = new EventEmitter(); @@ -39,6 +49,7 @@ export class DiagramComponent { constructor(elementRef: ElementRef, private translate: AlfrescoTranslationService, private diagramColorService: DiagramColorService, + private raphaelService: RaphaelService, private analyticsService: AnalyticsService) { if (translate) { translate.addTranslationFolder('node_modules/ng2-activiti-analytics/src'); @@ -47,8 +58,13 @@ export class DiagramComponent { } ngOnInit() { - this.getProcessDefinitionModel(this.report.processDefinitionId); - this.diagramColorService.setTotalColors(this.report.totalCountsPercentages); + this.raphaelService.setting(this.width, this.height); + } + + ngOnChanges(changes: SimpleChanges) { + this.reset(); + this.diagramColorService.setTotalColors(this.metricPercentages); + this.getProcessDefinitionModel(this.processDefinitionId); } getProcessDefinitionModel(processDefinitionId: string) { @@ -62,4 +78,8 @@ export class DiagramComponent { } ); } + + reset() { + this.raphaelService.reset(); + } } diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts index 38d5586956..fff8b99a57 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts @@ -24,6 +24,9 @@ import { RaphaelPlusDirective } from './raphael-plus.component'; import { RaphaelRhombusDirective } from './raphael-rhombus.component'; import { RaphaelPentagonDirective } from './raphael-pentagon.component'; +// services +import { RaphaelService } from './raphael.service'; + // icons import { RAPHAEL_ICONS_DIRECTIVES } from './icons/index'; @@ -49,3 +52,7 @@ export const RAPHAEL_DIRECTIVES: any[] = [ RaphaelPentagonDirective, RAPHAEL_ICONS_DIRECTIVES ]; + +export const RAPHAEL_PROVIDERS: any[] = [ + RaphaelService +]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts index c948d918e8..44da5c3324 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts @@ -21,6 +21,8 @@ import { Injectable } from '@angular/core'; export class RaphaelService { paper: any; + width: number = 300; + height: number = 400 ; private ctx: any; constructor() { @@ -43,16 +45,25 @@ export class RaphaelService { if (typeof Raphael === 'undefined') { throw new Error('ng2-charts configuration issue: Embedding Chart.js lib is mandatory'); } - let paper = new Raphael(ctx, 1000, 500); + let paper = new Raphael(ctx, this.width, this.height); // paper.setViewBox(0, 0, 583, 344.08374193550003, false); // paper.renderfix(); return paper; } - public ngOnDestroy(): any { + private ngOnDestroy(): any { if (this.paper) { this.paper.clear(); this.paper = void 0; } } + + public setting(width: number, height: number): void { + this.width = width; + this.height = height; + } + + public reset(): any { + this.ngOnDestroy(); + } } diff --git a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts index 500336acc2..fc056d8e07 100644 --- a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts @@ -109,6 +109,19 @@ export class AnalyticsService { }); } + getMetricValues(): Observable { + let paramOptions: ParameterValueModel[] = []; + + paramOptions.push(new ParameterValueModel({id: 'totalCount', name: 'Number of times a step is executed'})); + paramOptions.push(new ParameterValueModel({id: 'totalTime', name: 'Total time spent in a process step'})); + paramOptions.push(new ParameterValueModel({id: 'avgTime', name: 'Average time spent in a process step'})); + + return Observable.create(observer => { + observer.next(paramOptions); + observer.complete(); + }); + } + getProcessDefinitionsValues(appId: string): Observable { let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/process-definitions`; let params: URLSearchParams; From 5059436551ab995eac23f75786cc255d9058b539 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 17:37:55 +0100 Subject: [PATCH 41/61] Fix empty text --- .../src/components/raphael/raphael-text.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts index 45ecdae269..b116d5df89 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts @@ -41,6 +41,9 @@ export class RaphaelTextDirective extends RaphaelBase implements OnInit { ngOnInit() { console.log(this.elementRef); + if (this.text === null || this.text === undefined) { + this.text = ''; + } this.draw(this.position, this.text); } From d58b2f48376700fdd2e47572bc84e4f9ee4f4c7d Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Tue, 25 Oct 2016 18:03:28 +0100 Subject: [PATCH 42/61] Fix typeFiltering parameter --- .../analytics-report-parameters.component.html | 3 ++- .../analytics-report-parameters.component.ts | 4 ++++ .../widgets/checkbox/checkbox.widget.html | 4 ++-- .../widgets/checkbox/checkbox.widget.ts | 15 ++++++++++++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.html b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.html index bc98145dee..3fe322d9f7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.html +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.html @@ -16,7 +16,8 @@

- +

diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts index 993d2121cf..f31fcb0f18 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.ts @@ -115,6 +115,9 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges { taskGroup: new FormGroup({ taskName: new FormControl() }), + typeFilteringGroup: new FormGroup({ + typeFiltering: new FormControl() + }), dateIntervalGroup: new FormGroup({ dateRangeInterval: new FormControl() }), @@ -192,6 +195,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges { reportParamQuery.duration = values.durationGroup.duration; reportParamQuery.dateRangeInterval = values.dateIntervalGroup.dateRangeInterval; reportParamQuery.slowProcessInstanceInteger = this.convertNumber(values.processInstanceGroup.slowProcessInstanceInteger); + reportParamQuery.typeFiltering = values.typeFilteringGroup.typeFiltering; return reportParamQuery; } diff --git a/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.html b/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.html index b9841dae1b..4d02c9a7da 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.html +++ b/ng2-components/ng2-activiti-analytics/src/components/widgets/checkbox/checkbox.widget.html @@ -1,5 +1,5 @@ -
No metric found
\ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/.editorconfig b/ng2-components/ng2-activiti-diagrams/.editorconfig new file mode 100644 index 0000000000..75a2477db7 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/.editorconfig @@ -0,0 +1,23 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[package.json] +indent_style = space +indent_size = 2 + +[karma.conf.js] +indent_style = space +indent_size = 2 + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/ng2-components/ng2-activiti-diagrams/.gitignore b/ng2-components/ng2-activiti-diagrams/.gitignore new file mode 100644 index 0000000000..fe20e77f42 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/.gitignore @@ -0,0 +1,15 @@ +npm-debug.log +node_modules +.idea +typings +coverage +dist +src/**/*.js +src/**/*.js.map + +demo/**/*.js +demo/**/*.js.map +demo/**/*.d.ts +index.js +index.js.map +!systemjs.config.js diff --git a/ng2-components/ng2-activiti-diagrams/.npmignore b/ng2-components/ng2-activiti-diagrams/.npmignore new file mode 100644 index 0000000000..16ba3e61e5 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/.npmignore @@ -0,0 +1,16 @@ +npm-debug.log +.idea + +assets/ +coverage/ +node_modules +typings/ +fonts/ + +/.editorconfig +/.travis.yml +/*.js +/*.json +/*.ts +/*.js.map +/.npmignore diff --git a/ng2-components/ng2-activiti-diagrams/LICENSE b/ng2-components/ng2-activiti-diagrams/LICENSE new file mode 100644 index 0000000000..430d42bbea --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/ng2-components/ng2-activiti-diagrams/README.md b/ng2-components/ng2-activiti-diagrams/README.md new file mode 100644 index 0000000000..ac208e5422 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/README.md @@ -0,0 +1,90 @@ +# Activiti Analytics Component for Angular 2 + +## Prerequisites + +Before you start using this development framework, make sure you have installed all required software and done all the +necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md). + +## Install + +```sh +npm install --save ng2-activiti-analytics +``` + +#### Ng2-Charts + +```sh +npm install ng2-charts chart.js --save +``` + +Also make sure you include these dependencies in your `index.html` file: + +```html + +``` + +#### Material Design Lite + +The style of this component is based on [material design](https://getmdl.io/), so if you want to visualize it correctly you have to add the material +design dependency to your project: + +```sh +npm install --save material-design-icons material-design-lite +``` + +Also make sure you include these dependencies in your `index.html` file: + +```html + + + + +``` + +## Basic usage example Activiti Analytics + +```html + +``` + +#### Events + + +#### Options + + +## Build from sources + +Alternatively you can build component from sources with the following commands: + +```sh +npm install +npm run build +``` + +### Build the files and keep watching for changes + +```sh +$ npm run build:w +``` + +### Running unit tests + +```sh +npm test +``` + +### Running unit tests in browser + +```sh +npm test-browser +``` + +This task rebuilds all the code, runs tslint, license checks and other quality check tools +before performing unit testing. + +### Code coverage + +```sh +npm run coverage +``` diff --git a/ng2-components/ng2-activiti-diagrams/assets/license_header.txt b/ng2-components/ng2-activiti-diagrams/assets/license_header.txt new file mode 100644 index 0000000000..83fd1531a3 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/assets/license_header.txt @@ -0,0 +1,16 @@ +/*! + * @license + * Copyright 2016 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. + */ \ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/demo/.gitignore b/ng2-components/ng2-activiti-diagrams/demo/.gitignore new file mode 100644 index 0000000000..25beca4c27 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/.gitignore @@ -0,0 +1,6 @@ +node_modules +.idea +coverage +dist +typings +!systemjs.config.js diff --git a/ng2-components/ng2-activiti-diagrams/demo/.npmignore b/ng2-components/ng2-activiti-diagrams/demo/.npmignore new file mode 100644 index 0000000000..c51c008259 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/.npmignore @@ -0,0 +1,3 @@ +node_modules +dist +typings \ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/demo/README.md b/ng2-components/ng2-activiti-diagrams/demo/README.md new file mode 100644 index 0000000000..6c99417ed4 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/README.md @@ -0,0 +1,13 @@ +# Activiti Diagrams demo + +Install: + +``` +npm install +``` + +Run the project: + +``` +npm start +``` \ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/demo/index.html b/ng2-components/ng2-activiti-diagrams/demo/index.html new file mode 100644 index 0000000000..0eaffcea6b --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/index.html @@ -0,0 +1,38 @@ + + + + + Angular 2 Activiti Analitics - Demo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-activiti-diagrams/demo/package.json b/ng2-components/ng2-activiti-diagrams/demo/package.json new file mode 100644 index 0000000000..6687b8e7c9 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/package.json @@ -0,0 +1,81 @@ +{ + "name": "ng2-activiti-diagrams-demo", + "description": "Alfresco Angular2 Diagrams Component - Demo", + "version": "0.1.0", + "author": "Alfresco Software, Ltd.", + "main": "index.js", + "scripts": { + "clean": "npm install rimraf && rimraf dist node_modules typings dist", + "postinstall": "npm run build", + "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ", + "server": "wsrv -o -s -l", + "build": "npm run tslint && rimraf dist && npm run tsc", + "tsc": "tsc", + "tsc:w": "tsc -w", + "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts" + }, + "license": "Apache-2.0", + "dependencies": { + "@angular/common": "2.0.0-rc.3", + "@angular/compiler": "2.0.0-rc.3", + "@angular/core": "2.0.0-rc.3", + "@angular/forms": "0.1.1", + "@angular/http": "2.0.0-rc.3", + "@angular/platform-browser": "2.0.0-rc.3", + "@angular/platform-browser-dynamic": "2.0.0-rc.3", + "@angular/router": "3.0.0-alpha.7", + "@angular/router-deprecated": "2.0.0-rc.2", + "@angular/upgrade": "2.0.0-rc.3", + "systemjs": "0.19.27", + "core-js": "2.4.0", + "reflect-metadata": "0.1.3", + "rxjs": "5.0.0-beta.6", + "zone.js": "0.6.12", + "license-check": "1.1.5", + "material-design-icons": "2.2.3", + "material-design-lite": "1.1.3", + "ng2-translate": "2.2.2", + "alfresco-js-api": "^0.3.0", + "ng2-alfresco-core": "^0.3.0", + "ng2-activiti-diagrams": "^0.3.0", + "raphael": "^2.2.6" + }, + "devDependencies": { + "@types/core-js": "^0.9.32", + "@types/jasmine": "^2.2.33", + "concurrently": "^2.2.0", + "rimraf": "2.5.2", + "tslint": "3.15.1", + "typescript": "^2.0.2", + "wsrv": "^0.1.5" + }, + "keywords": [ + "angular2", + "typescript" + ], + "license-check-config": { + "src": [ + "**/*.js", + "**/*.ts", + "!/**/coverage/**/*", + "!/**/demo/**/*", + "!/**/node_modules/**/*", + "!/**/typings/**/*", + "!*.js" + ], + "contributors": [ + { + "name": "Maurizio Vitale", + "email": "maurizio.vitale84@gmail.com" + }, + { + "name": "Eugenio Romano", + "email": "eugenio.romano@alfresco.com" + } + ], + "path": "assets/license_header.txt", + "blocking": true, + "logInfo": false, + "logError": true + } +} diff --git a/ng2-components/ng2-activiti-diagrams/demo/src/main.ts b/ng2-components/ng2-activiti-diagrams/demo/src/main.ts new file mode 100644 index 0000000000..42fbc88a47 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/src/main.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { bootstrap } from '@angular/platform-browser-dynamic'; +import { Component } from '@angular/core'; +import { ALFRESCO_CORE_PROVIDERS } from 'ng2-alfresco-core'; +import { } from 'ng2-activiti-diagrams'; + +@Component({ + selector: 'activiti-diagrams-demo', + template: ``, + directives: [DiagramsComponent] +}) +class ActivitiDiagramsDemo { +} + +bootstrap(ActivitiDiagramsDemo, [ + ALFRESCO_CORE_PROVIDERS] +); diff --git a/ng2-components/ng2-activiti-diagrams/demo/systemjs.config.js b/ng2-components/ng2-activiti-diagrams/demo/systemjs.config.js new file mode 100644 index 0000000000..5e6a23744f --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/systemjs.config.js @@ -0,0 +1,55 @@ +/** + * System configuration for Angular 2 samples + * Adjust as necessary for your application needs. + */ +(function(global) { + // map tells the System loader where to look for things + var map = { + 'app': 'dist', // 'dist', + '@angular': 'node_modules/@angular', + 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', + 'rxjs': 'node_modules/rxjs', + 'raphael': 'node_modules/raphael', + 'ng2-translate': 'node_modules/ng2-translate', + 'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist', + 'ng2-activiti-diagrams': 'node_modules/ng2-activiti-diagrams/dist' + }; + // packages tells the System loader how to load when no filename and/or no extension + var packages = { + 'app': { main: 'main.js', defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' }, + 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, + 'ng2-translate': { defaultExtension: 'js' }, + 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' }, + 'ng2-activiti-diagrams': { main: 'index.js', defaultExtension: 'js' }, + 'raphael': { main: 'raphael.js', defaultExtension: 'js'} + }; + var ngPackageNames = [ + 'common', + 'compiler', + 'core', + 'http', + 'platform-browser', + 'platform-browser-dynamic', + 'router', + 'router-deprecated', + 'upgrade' + ]; + // Individual files (~300 requests): + function packIndex(pkgName) { + packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; + } + // Bundled (~40 requests): + function packUmd(pkgName) { + packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; + } + // Most environments should use UMD; some (Karma) need the individual index files + var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; + // Add package entries for angular packages + ngPackageNames.forEach(setPackageConfig); + var config = { + map: map, + packages: packages + }; + System.config(config); +})(this); diff --git a/ng2-components/ng2-activiti-diagrams/demo/tsconfig.json b/ng2-components/ng2-activiti-diagrams/demo/tsconfig.json new file mode 100644 index 0000000000..7be35bfec8 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist", + "types": ["core-js", "jasmine", "node"] + }, + "exclude": [ + "demo", + "node_modules", + "dist" + ] +} diff --git a/ng2-components/ng2-activiti-diagrams/demo/tslint.json b/ng2-components/ng2-activiti-diagrams/demo/tslint.json new file mode 100644 index 0000000000..55c0f8a666 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/demo/tslint.json @@ -0,0 +1,124 @@ +{ + "rules": { + "align": [ + true, + "parameters", + "arguments", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space", + "check-lowercase" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 140 + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-constructor-vars": false, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unreachable": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": true, + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": false, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "use-strict": false, + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-operator", + "check-separator", + "check-type", + "check-module", + "check-decl" + ] + } +} diff --git a/ng2-components/ng2-activiti-diagrams/index.ts b/ng2-components/ng2-activiti-diagrams/index.ts new file mode 100644 index 0000000000..75c5358549 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/index.ts @@ -0,0 +1,63 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { CoreModule } from 'ng2-alfresco-core'; + +import { DIAGRAM_DIRECTIVES } from './src/components/index'; +import { DiagramColorService } from './src/services/diagram-color.service'; +import { DiagramsService } from './src/services/diagrams.service'; + +import { RAPHAEL_DIRECTIVES } from './src/components/raphael/index'; +import { RAPHAEL_PROVIDERS } from './src/components/raphael/index'; + +// primitives +export * from './src/components/index'; +export * from './src/components/raphael/index'; + +export const DIAGRAM_PROVIDERS: any[] = [ + DiagramsService, + DiagramColorService +]; + +@NgModule({ + imports: [ + CoreModule + ], + declarations: [ + ...DIAGRAM_DIRECTIVES, + ...RAPHAEL_DIRECTIVES + ], + providers: [ + ...DIAGRAM_PROVIDERS, + ...RAPHAEL_PROVIDERS + ], + exports: [ + ...DIAGRAM_DIRECTIVES + ] +}) +export class DiagramsModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: DiagramsModule, + providers: [ + ...DIAGRAM_PROVIDERS, + ...RAPHAEL_PROVIDERS + ] + }; + } +} diff --git a/ng2-components/ng2-activiti-diagrams/karma-test-shim.js b/ng2-components/ng2-activiti-diagrams/karma-test-shim.js new file mode 100644 index 0000000000..47e3d71f55 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/karma-test-shim.js @@ -0,0 +1,104 @@ +// Tun on full stack traces in errors to help debugging +Error.stackTraceLimit = Infinity; + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; + +__karma__.loaded = function() {}; + +var builtPath = '/base/dist/'; + +function isJsFile(path) { + return path.slice(-3) == '.js'; +} + +function isSpecFile(path) { + return /\.spec\.(.*\.)?js$/.test(path); +} + +function isBuiltFile(path) { + return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); +} + +var allSpecFiles = Object.keys(window.__karma__.files) + .filter(isSpecFile) + .filter(isBuiltFile); + +var paths = { + // paths serve as alias + 'npm:': 'base/node_modules/' +}; + +var map = { + 'app': 'base/dist', + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + // testing + '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', + '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', + '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', + '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', + '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', + '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', + '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', + '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', + + // other libraries + 'rxjs': 'npm:rxjs', + 'ng2-translate': 'npm:ng2-translate', + 'alfresco-js-api': 'npm:alfresco-js-api/dist', + 'ng2-activiti-diagrams': 'npm:ng2-activiti-diagrams/dist', + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' +}; + +var packages = { + 'app': { main: 'main.js', defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' }, + 'ng2-translate': { defaultExtension: 'js' }, + 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, + 'ng2-activiti-diagrams': { main: './index.js', defaultExtension: 'js'}, + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} +}; + +var config = { + paths: paths, + map: map, + packages: packages +}; + +System.config(config); + +System.import('@angular/core/testing') + .then(initTestBed) + .then(initTesting); + +function initTestBed(){ + return Promise.all([ + System.import('@angular/core/testing'), + System.import('@angular/platform-browser-dynamic/testing') + ]) + .then(function (providers) { + var coreTesting = providers[0]; + var browserTesting = providers[1]; + + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); + }) +} + +// Import all spec files and start karma +function initTesting () { + return Promise.all( + allSpecFiles.map(function (moduleName) { + return System.import(moduleName); + }) + ) + .then(__karma__.start, __karma__.error); +} diff --git a/ng2-components/ng2-activiti-diagrams/karma.conf.js b/ng2-components/ng2-activiti-diagrams/karma.conf.js new file mode 100644 index 0000000000..5b088f0af2 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/karma.conf.js @@ -0,0 +1,120 @@ +'use strict'; + +module.exports = function (config) { + var configuration = { + basePath: '.', + + frameworks: ['jasmine-ajax', 'jasmine'], + + files: [ + // System.js for module loading + 'node_modules/systemjs/dist/system.src.js', + + // Polyfills + 'node_modules/core-js/client/shim.js', + 'node_modules/reflect-metadata/Reflect.js', + + // zone.js + 'node_modules/zone.js/dist/zone.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + 'node_modules/zone.js/dist/proxy.js', + 'node_modules/zone.js/dist/sync-test.js', + 'node_modules/zone.js/dist/jasmine-patch.js', + 'node_modules/zone.js/dist/async-test.js', + 'node_modules/zone.js/dist/fake-async-test.js', + + // RxJs + {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false}, + + // Paths loaded via module imports: + // Angular itself + {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false}, + + 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', + 'node_modules/raphael/raphael.min.js', + {pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false}, + + 'karma-test-shim.js', + + // paths loaded via module imports + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, + + // ng2-components + { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false }, + + // paths to support debugging with source maps in dev tools + {pattern: 'src/**/*.ts', included: false, watched: false}, + {pattern: 'dist/**/*.js.map', included: false, watched: false} + ], + + exclude: [ + 'node_modules/**/*spec.js' + ], + + // proxied base paths + proxies: { + // required for component assets fetched by Angular's compiler + '/src/': '/base/src/' + }, + + port: 9876, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + colors: true, + + autoWatch: true, + + browsers: ['Chrome'], + + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + + // Karma plugins loaded + plugins: [ + 'karma-jasmine', + 'karma-coverage', + 'karma-jasmine-ajax', + 'karma-chrome-launcher', + 'karma-mocha-reporter', + 'karma-jasmine-html-reporter' + ], + + // Coverage reporter generates the coverage + reporters: ['mocha', 'coverage', 'kjhtml'], + + // Source files that you wanna generate coverage for. + // Do not include tests or libraries (these files will be instrumented by Istanbul) + preprocessors: { + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' + }, + + coverageReporter: { + includeAllSources: true, + dir: 'coverage/', + subdir: 'report', + reporters: [ + {type: 'text'}, + {type: 'json', file: 'coverage-final.json'}, + {type: 'html'}, + {type: 'lcov'} + ] + } + }; + + if (process.env.TRAVIS) { + configuration.browsers = ['Chrome_travis_ci']; + } + + config.set(configuration) +}; diff --git a/ng2-components/ng2-activiti-diagrams/package.json b/ng2-components/ng2-activiti-diagrams/package.json new file mode 100644 index 0000000000..857e879bcb --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/package.json @@ -0,0 +1,97 @@ +{ + "name": "ng2-activiti-diagrams", + "description": "Activiti Angular2 Diagrams Component", + "version": "0.3.3", + "author": "Alfresco Software, Ltd.", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "clean": "npm install rimraf && rimraf dist node_modules typings", + "build": "npm run tslint && rimraf dist && tsc && npm run copy-dist && license-check", + "build:w": "npm run tslint && rimraf dist && npm run watch-task", + "watch-task": "concurrently \"npm run tsc:w\" \"npm run copy-dist:w\" \"license-check\"", + "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'src/{,**/}**.ts'", + "copy-dist": "cpx \"./src/**/*.{html,css,json,png,jpg,gif,svg}\" ./dist/src", + "copy-dist:w": "cpx \"./src/**/*.{html,css,json,png,jpg,gif,svg}\" ./dist/src -w", + "tsc": "tsc", + "tsc:w": "tsc -w", + "pretest": "npm run build", + "test": "karma start karma.conf.js --reporters mocha,coverage --single-run", + "test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"", + "posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", + "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", + "prepublish": "npm run build", + "travis": "echo 'placeholder'" + }, + "contributors": [ + { + "name": "Maurizio Vitale", + "email": "maurizio.vitale84@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/Alfresco/alfresco-ng2-components.git" + }, + "bugs": { + "url": "https://github.com/Alfresco/alfresco-ng2-components/issues" + }, + "dependencies": { + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", + "alfresco-js-api": "^0.3.0", + "core-js": "^2.4.1", + "ng2-alfresco-core": "0.3.2", + "ng2-translate": "2.5.0", + "raphael": "^2.2.6", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", + "systemjs": "0.19.27", + "zone.js": "^0.6.23" + }, + "devDependencies": { + "@types/core-js": "^0.9.32", + "@types/jasmine": "^2.2.33", + "concurrently": "^2.2.0", + "cpx": "^1.3.1", + "jasmine-ajax": "^3.2.0", + "jasmine-core": "2.4.1", + "karma": "~0.13.22", + "karma-chrome-launcher": "~1.0.1", + "karma-coverage": "^1.0.0", + "karma-jasmine": "~1.0.2", + "karma-jasmine-ajax": "^0.1.13", + "karma-jasmine-html-reporter": "^0.2.0", + "karma-mocha-reporter": "^2.0.3", + "license-check": "^1.0.4", + "remap-istanbul": "^0.6.3", + "rimraf": "2.5.2", + "traceur": "^0.0.91", + "tslint": "^3.8.1", + "typescript": "^2.0.3", + "wsrv": "^0.1.5" + }, + "keywords": [ + "tag", + "alfresco-analytics", + "alfresco-diagrams" + ], + "license-check-config": { + "src": [ + "./dist/**/*.js" + ], + "path": "assets/license_header.txt", + "blocking": true, + "logInfo": false, + "logError": true + }, + "license": "Apache-2.0" +} diff --git a/ng2-components/ng2-activiti-diagrams/src/assets/analyticsComponent.mock.ts b/ng2-components/ng2-activiti-diagrams/src/assets/analyticsComponent.mock.ts new file mode 100644 index 0000000000..79b185cf0f --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/assets/analyticsComponent.mock.ts @@ -0,0 +1,97 @@ +/*! + * @license + * Copyright 2016 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 var 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'] + }, { + 'key': 'Simple process', + 'y': 30, + 'keyAndValue': ['Simple process', '30'] + }, { + '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', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-TOTAL', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-ACTIVE', + 'REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.DETAIL-TABLE-COMPLETED'], + 'columnsCentered': [false, false, false, false], + 'rows': [ + ['Second Process', '4', '0', '4'], + ['Simple process', '30', '3', '27'], + ['Third Process', '7', '0', '7'] + ] + }] +}; + +export var 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' + }, { + 'id': 'id792349721129', + 'type': 'masterDetailTable', + 'title': 'Detailed task statistics', + 'titleKey': 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.DETAILED-TASK-STATS-TITLE', + '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', + 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MIN-DURATION', + 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.MAX-DURATION', + 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.AVERAGE', + 'REPORTING.DEFAULT-REPORTS.TASK-OVERVIEW.STDDE'], + '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'] + ] + }] +}; diff --git a/ng2-components/ng2-activiti-diagrams/src/assets/analyticsParamsReportComponent.mock.ts b/ng2-components/ng2-activiti-diagrams/src/assets/analyticsParamsReportComponent.mock.ts new file mode 100644 index 0000000000..626996af3b --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/assets/analyticsParamsReportComponent.mock.ts @@ -0,0 +1,127 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { ReportParameterDetailsModel } from '../models/report.model'; + +export var 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 var 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 var 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 var 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 var 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 var 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 var 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 var reportDefParamProcessDefOptions = { + 'size': 4, 'total': 4, 'start': 0, 'data': [ + { + '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 2:1:1', + 'name': 'Fake Process Test 2 Name ', + 'version': 1 + }, + { + 'id': 'FakeProcessTest 3:1:1', + 'name': 'Fake Process Test 3 Name ', + 'version': 1 + } + ] +}; + +export var reportDefParamProcessDefOptionsApp = { + 'size': 2, 'total': 2, 'start': 2, 'data': [ + { + '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 + } + ] +}; + +export var 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 var reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2']; + +export var fieldProcessDef = new ReportParameterDetailsModel( + { + id: 'processDefinitionId', + type: 'processDefinition', + value: 'fake-process-name:1:15027' + } +); diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-alfresco-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-box-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts index 1484e02044..020bcc934e 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-business-rule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-camel-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-container-service-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-google-drive-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts index 5ed71e9ab5..63a2b62ba5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-manual-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-mule-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts index 629b6629de..444d0ef067 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-receive-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-rest-call-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts index f30752b07f..a1b0132a42 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-script-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-send-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts index bfc704966d..030a2d213f 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-service-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts index ca76d87bb4..003f881761 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts index 52d30f0147..c6337d2865 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/diagram-user-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/activities/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/activities/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts index cb8bb1b687..f1800fc668 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-boundary-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts index 3d95ea9e94..1157746144 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/diagram-throw-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/boundary-events/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/boundary-events/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html b/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram-sequence-flow.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts similarity index 85% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts index 3c5964bfa7..3bd43b5170 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/diagram.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts @@ -17,13 +17,13 @@ import { Component, ElementRef, Input, Output, EventEmitter, SimpleChanges } from '@angular/core'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; -import { AnalyticsService } from '../../services/analytics.service'; -import { DiagramColorService } from './services/diagram-color.service'; -import { RaphaelService } from './../raphael/raphael.service'; +import { DiagramsService } from '../services/diagrams.service'; +import { DiagramColorService } from '../services/diagram-color.service'; +import { RaphaelService } from './raphael/raphael.service'; @Component({ moduleId: module.id, - selector: 'diagram', + selector: 'activiti-diagram', templateUrl: './diagram.component.html', styleUrls: ['./diagram.component.css'] }) @@ -50,7 +50,7 @@ export class DiagramComponent { private translate: AlfrescoTranslationService, private diagramColorService: DiagramColorService, private raphaelService: RaphaelService, - private analyticsService: AnalyticsService) { + private diagramsService: DiagramsService) { if (translate) { translate.addTranslationFolder('node_modules/ng2-activiti-analytics/src'); } @@ -68,7 +68,7 @@ export class DiagramComponent { } getProcessDefinitionModel(processDefinitionId: string) { - this.analyticsService.getProcessDefinitionModel(processDefinitionId).subscribe( + this.diagramsService.getProcessDefinitionModel(processDefinitionId).subscribe( (res: any) => { this.diagram = res; }, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts index cbd7d2213c..c5ffc26099 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-end-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts index 63682a4366..160e5692cf 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts index 09dcaaa231..ad81d2c7a4 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/diagram-start-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/events/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/events/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.html b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts index 8d8bb108fb..b5e3ce6072 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-event-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.html b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts index d38da7d125..20910cf3f1 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-exclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.html b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts index a2c275586a..aefc89828e 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.html b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts index 51a421d2c9..6efdd85207 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-inclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.html b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts index 9d344b34d1..f6ae87a1cd 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/diagram-parallel-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/gateways/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/gateways/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts index b77cb4af71..6a422c13fa 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-container-icon-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts index 4ea09ba1e1..a330335575 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-alfresco-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts index 87817a26b0..e890703d06 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-box-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts index 53b946dfaa..c7372aa3f0 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-business-rule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts index 7a223c7c1a..9a08758fc5 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-camel-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts index c735603187..77a4a8bd9a 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-error.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts index 3e60d20a07..5cbd889b87 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-google-drive-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts index 39de990bb9..dde03313a8 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-manual-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts index 14e4a3506c..e5f2cf7ec6 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-message.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts index b3c9ec96a9..c920d4a3b7 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-mule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts index b786d89e0e..e50230ff18 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-receive-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts index d49b1f8cd8..b2da83242c 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-rest-call-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts index 3b034af4ab..f088711a0b 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-script-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts index 4571b4de60..94f64bf471 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-send-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts index 3562a03862..fe93df6745 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-service-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts index 154b0b7c98..099307a229 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-signal.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts index 4c3ad4b014..015a2b1216 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-timer.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts similarity index 94% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts index 7ad6801a30..ac11a61f95 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/diagram-icon-user-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/icons/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/icons/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/index.ts similarity index 93% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/index.ts index 59656b5e75..244c024e94 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/index.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/index.ts @@ -25,8 +25,6 @@ import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index'; import { DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES } from './intermediate-catching-events/index'; import { DIAGRAM_STRUCTURAL_DIRECTIVES } from './structural/index'; -import { DiagramColorService } from './services/diagram-color.service'; - // primitives export * from './diagram.component'; export * from './events/index'; @@ -48,7 +46,3 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES, DIAGRAM_STRUCTURAL_DIRECTIVES ]; - -export const DIAGRAM_PROVIDERS: any[] = [ - DiagramColorService -]; diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts similarity index 96% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts index 96cb9bfc2d..f86b983a07 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/diagram-intermediate-catching-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/intermediate-catching-events/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/declarations.d.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/declarations.d.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/declarations.d.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-alfresco-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-box-publish.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-box-publish.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-box-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-business-rule.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-business-rule.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-business-rule.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-camel.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-camel.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-camel.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-camel.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-error.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-error.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-error.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-google-drive-publish.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-manual.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-manual.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-manual.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-manual.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-message.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-message.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-message.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-mule.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-mule.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-mule.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-mule.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-receive.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-receive.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-receive.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-rest-call.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-rest-call.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-rest-call.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-rest-call.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-script.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-script.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-script.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-send.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-send.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-send.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-send.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-service.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-service.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-service.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-service.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-signal.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-signal.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-signal.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-timer.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-timer.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-timer.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-user.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-user.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/icons/raphael-icon-user.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/icons/raphael-icon-user.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/index.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/models/point.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/models/point.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/models/point.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-base.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-base.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-base.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-circle.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-circle.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-circle.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-cross.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-cross.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-cross.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-flow-arrow.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-flow-arrow.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-flow-arrow.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-pentagon.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-pentagon.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-pentagon.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-plus.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-plus.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-plus.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-rect.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rect.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-rect.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-rhombus.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-rhombus.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-rhombus.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael-text.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael.service.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/raphael/raphael.service.ts rename to ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael.service.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts index 7d7b451e20..296040651f 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-event-subprocess.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.html similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.html rename to ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.html diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts similarity index 95% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts rename to ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts index 50bf2e8ab7..c73fa22058 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/diagram-subprocess.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts @@ -16,7 +16,7 @@ */ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; -import { DiagramColorService } from './../services/diagram-color.service'; +import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/structural/index.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/structural/index.ts rename to ng2-components/ng2-activiti-diagrams/src/components/structural/index.ts diff --git a/ng2-components/ng2-activiti-diagrams/src/declarations.d.ts b/ng2-components/ng2-activiti-diagrams/src/declarations.d.ts new file mode 100644 index 0000000000..e1b5a9e9fc --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/declarations.d.ts @@ -0,0 +1,19 @@ +/*! + * @license + * Copyright 2016 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. + */ + +// MDL +declare let componentHandler: any; diff --git a/ng2-components/ng2-activiti-diagrams/src/i18n/en.json b/ng2-components/ng2-activiti-diagrams/src/i18n/en.json new file mode 100644 index 0000000000..1dce1a9c60 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/i18n/en.json @@ -0,0 +1,45 @@ +{ + "ANALYTICS": { + "TTILE": "ANALYTICS", + "MESSAGES": { + "UNKNOWN-WIDGET-TYPE": "UNKNOWN WIDGET TYPE", + "FILL-PARAMETER": "Fill in the parameters to generate your report", + "NO-DATA-FOUND": "No data found" + } + }, + "__KEY_REPORTING": { + "DEFAULT-REPORTS": { + "PROCESS-DEFINITION-OVERVIEW": { + "GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS": "Total number of process definitions", + "GENERAL-TABLE-TOTAL-PROCESS-INSTANCES": "Total number of process instances", + "GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES": "Total number of active process instances", + "GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES": "Total number of completed process instances" + } + } + }, + "REPORTING": { + "DEFAULT-REPORTS": { + "PROCESS-HEAT-MAP": { + "TYPE-FILTERING": "Include all process steps (Unchecking this, will remove pass through steps like start events, gateways, etc.)?" + }, + "PROCESS-INSTANCES-OVERVIEW": { + "PROCESS-DEFINITION": "Process definition", + "DATE-RANGE": "Date range", + "SLOW-PROC-INST-NUMBER": "How many of the slowest process instances should be displayed?" + }, + "TASK-OVERVIEW": { + "PROCESS-DEFINITION": "Process definition", + "DATE-RANGE": "Date range", + "DATE-RANGE-INTERVAL": "Aggregate dates by" + }, + "TASK-SLA": { + "TASK": "Task", + "PROCESS-DEFINITION": "Process definition", + "DATE-RANGE": "Date range", + "SLA-DURATION": "What is the time this task needs to be completed in to be within the SLA?" + } + }, + "PROCESS-STATUS": "Process status", + "TASK-STATUS": "Task status" + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/i18n/it.json b/ng2-components/ng2-activiti-diagrams/src/i18n/it.json new file mode 100644 index 0000000000..15c05b6832 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/i18n/it.json @@ -0,0 +1,5 @@ +{ + "ANALYTICS": { + "TTILE": "ANALYTICS" + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/models/chart.model.ts b/ng2-components/ng2-activiti-diagrams/src/models/chart.model.ts new file mode 100644 index 0000000000..bba431596e --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/models/chart.model.ts @@ -0,0 +1,185 @@ +/*! + * @license + * Copyright 2016 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 class Chart { + id: string; + type: string; + + constructor(obj?: any) { + this.id = obj && obj.id || null; + if (obj && obj.type) { + this.type = this.convertType(obj.type); + } + } + + private convertType(type: string) { + let chartType = ''; + switch (type) { + case 'pieChart': + chartType = 'pie'; + break; + case 'table': + chartType = 'table'; + break; + case 'line': + chartType = 'line'; + break; + case 'barChart': + chartType = 'bar'; + break; + case 'processDefinitionHeatMap': + chartType = 'HeatMap'; + break; + default: + chartType = 'table'; + break; + } + return chartType; + } +} + +export class LineChart extends Chart { + title: string; + titleKey: string; + labels: string[] = []; + datasets: any[] = []; + + constructor(obj?: any) { + super(obj); + this.title = obj && obj.title || null; + this.titleKey = obj && obj.titleKey || null; + this.labels = obj && obj.columnNames.slice(1, obj.columnNames.length); + + obj.rows.forEach((value: any) => { + this.datasets.push({data: value.slice(1, value.length), label: value[0]}); + }); + } +} + +export class BarChart extends Chart { + title: string; + titleKey: string; + labels: string[] = []; + datasets: any[] = []; + data: any[] = []; + options: any = { + scales: { + yAxes: [{ + ticks: { + beginAtZero: true, + stepSize: 1 + } + }] + } + }; + + constructor(obj?: any) { + super(obj); + this.title = obj && obj.title || null; + this.titleKey = obj && obj.titleKey || null; + obj.values.forEach((params: any) => { + let dataValue = []; + params.values.forEach((info: any) => { + info.forEach((value: any, index: any) => { + if (index % 2 === 0) { + this.labels.push(value); + } else { + dataValue.push(value); + } + }); + }); + if (dataValue && dataValue.length > 0) { + this.datasets.push({data: dataValue, label: params.key}); + } + }); + } + + hasDatasets() { + return this.datasets && this.datasets.length > 0 ? true : false; + } +} + +export class TableChart extends Chart { + title: string; + titleKey: string; + labels: string[] = []; + datasets: any[] = []; + + constructor(obj?: any) { + super(obj); + this.title = obj && obj.title || null; + this.titleKey = obj && obj.titleKey || null; + this.labels = obj && obj.columnNames; + if (obj.rows) { + this.datasets = obj && obj.rows; + } + } + + hasDatasets() { + return this.datasets && this.datasets.length > 0 ? true : false; + } +} + +export class HeatMapChart extends Chart { + avgTimePercentages: string; + avgTimeValues: string; + processDefinitionId: string; + titleKey: string; + totalCountValues: string; + totalCountsPercentages: string; + totalTimePercentages: string; + totalTimeValues: string; + + constructor(obj?: any) { + super(obj); + this.avgTimePercentages = obj && obj.avgTimePercentages || null; + this.avgTimeValues = obj && obj.avgTimeValues || null; + this.processDefinitionId = obj && obj.processDefinitionId || null; + this.totalCountValues = obj && obj.totalCountValues || null; + this.titleKey = obj && obj.titleKey || null; + this.totalCountsPercentages = obj && obj.totalCountsPercentages || null; + this.totalTimePercentages = obj && obj.totalTimePercentages || null; + this.totalTimeValues = obj && obj.totalTimeValues || null; + } +} + +export class PieChart extends Chart { + title: string; + titleKey: string; + labels: string[] = []; + data: string[] = []; + + constructor(obj?: any) { + super(obj); + this.title = obj && obj.title || null; + this.titleKey = obj && obj.titleKey || null; + if (obj.values) { + obj.values.forEach((value: any) => { + this.add(value.key, value.y); + }); + } + } + + add(label: string, data: string) { + this.labels.push(label); + this.data.push(data); + } + + hasData() { + return this.data && this.data.length > 0 ? true : false; + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/models/report.model.ts b/ng2-components/ng2-activiti-diagrams/src/models/report.model.ts new file mode 100644 index 0000000000..549f841add --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/models/report.model.ts @@ -0,0 +1,139 @@ +/*! + * @license + * Copyright 2016 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. + */ + +/** + * + * This object represent the report definition. + * + * + * @returns {ReportParametersModel} . + */ +export class ReportParametersModel { + id: number; + name: string; + definition: ReportDefinitionModel; + created: string; + + constructor(obj?: any) { + this.id = obj && obj.id; + this.name = obj && obj.name || null; + if (obj && obj.definition) { + this.definition = new ReportDefinitionModel(JSON.parse(obj.definition)); + } + this.created = obj && obj.created || null; + } + + hasParameters() { + return (this.definition && this.definition.parameters) ? true : false; + } +} + +export class ReportDefinitionModel { + parameters: ReportParameterDetailsModel[] = []; + + constructor(obj?: any) { + obj.parameters.forEach((params: any) => { + let reportParamsModel = new ReportParameterDetailsModel(params); + this.parameters.push(reportParamsModel); + }); + } + + findParam(name: string): ReportParameterDetailsModel { + this.parameters.forEach((param) => { + return param.type === name ? param : null; + }); + return null; + } +} + +/** + * + * This object represent the report parameter definition. + * + * + * @returns {ReportParameterDetailsModel} . + */ +export class ReportParameterDetailsModel { + id: string; + name: string; + nameKey: string; + type: string; + value: string; + options: ParameterValueModel[]; + dependsOn: string; + + constructor(obj?: any) { + this.id = obj && obj.id; + this.name = obj && obj.name || null; + this.nameKey = obj && obj.nameKey || null; + this.type = obj && obj.type || null; + this.value = obj && obj.value || null; + this.options = obj && obj.options || null; + this.dependsOn = obj && obj.dependsOn || null; + } +} + +export class ParameterValueModel { + id: string; + name: string; + version: string; + value: string; + + constructor(obj?: any) { + this.id = obj && obj.id; + this.name = obj && obj.name || null; + this.value = obj && obj.value || null; + this.version = obj && obj.version || null; + } + + get label () { + return this.version ? `${this.name} (v ${this.version}) ` : this.name; + } +} + +export class ReportQuery { + processDefinitionId: string; + status: string; + taskName: string; + typeFiltering: boolean; + dateRange: ReportDateRange; + dateRangeInterval: string; + slowProcessInstanceInteger: number; + duration: number; + + constructor(obj?: any) { + this.processDefinitionId = obj && obj.processDefinitionId || null; + this.status = obj && obj.status || null; + this.taskName = obj && obj.taskName || null; + this.dateRangeInterval = obj && obj.dateRangeInterval || null; + this.typeFiltering = obj && obj.typeFiltering || true; + this.slowProcessInstanceInteger = obj && obj.slowProcessInstanceInteger || 0; + this.duration = obj && obj.duration || 0; + this.dateRange = new ReportDateRange(obj); + } +} + +export class ReportDateRange { + startDate: string; + endDate: string; + + constructor(obj?: any) { + this.startDate = obj && obj.startDate || null; + this.endDate = obj && obj.endDate || null; + } + +} diff --git a/ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts b/ng2-components/ng2-activiti-diagrams/src/services/diagram-color.service.ts similarity index 100% rename from ng2-components/ng2-activiti-analytics/src/components/diagrams/services/diagram-color.service.ts rename to ng2-components/ng2-activiti-diagrams/src/services/diagram-color.service.ts diff --git a/ng2-components/ng2-activiti-diagrams/src/services/diagrams.service.ts b/ng2-components/ng2-activiti-diagrams/src/services/diagrams.service.ts new file mode 100644 index 0000000000..d2d9201b4d --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/services/diagrams.service.ts @@ -0,0 +1,59 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Injectable } from '@angular/core'; +import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core'; +import { Observable } from 'rxjs/Rx'; +import { Response, Http, Headers, RequestOptions } from '@angular/http'; + +@Injectable() +export class DiagramsService { + + constructor(private authService: AlfrescoAuthenticationService, + private http: Http, + private alfrescoSettingsService: AlfrescoSettingsService) { + } + + getProcessDefinitionModel(processDefinitionId: string): Observable { + let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/process-definitions/${processDefinitionId}/model-json`; + let options = this.getRequestOptions(); + return this.http + .get(url, options) + .map((res: any) => { + let body = res.json(); + return body; + }).catch(this.handleError); + } + + public getHeaders(): Headers { + return new Headers({ + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': this.authService.getTicketBpm() + }); + } + + public getRequestOptions(param?: any): RequestOptions { + let headers = this.getHeaders(); + return new RequestOptions({headers: headers, withCredentials: true, search: param}); + } + + private handleError(error: Response) { + console.error(error); + return Observable.throw(error.json().error || 'Server error'); + } +} diff --git a/ng2-components/ng2-activiti-diagrams/tsconfig.json b/ng2-components/ng2-activiti-diagrams/tsconfig.json new file mode 100644 index 0000000000..7be35bfec8 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist", + "types": ["core-js", "jasmine", "node"] + }, + "exclude": [ + "demo", + "node_modules", + "dist" + ] +} diff --git a/ng2-components/ng2-activiti-diagrams/tslint.json b/ng2-components/ng2-activiti-diagrams/tslint.json new file mode 100644 index 0000000000..27e0dd81da --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/tslint.json @@ -0,0 +1,121 @@ +{ + "rules": { + "align": [ + true, + "parameters", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 180 + ], + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": false, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-constructor-vars": false, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unreachable": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": true, + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": false, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "use-strict": false, + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-operator", + "check-separator", + "check-type", + "check-module", + "check-decl" + ] + } +} From 95025b4baf68d407e256cfe0d7c64fd5bc9a1e21 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Wed, 26 Oct 2016 17:23:58 +0100 Subject: [PATCH 46/61] remove unused css import --- .../activities/diagram-alfresco-publish-task.component.ts | 3 +-- .../activities/diagram-box-publish-task.component.ts | 3 +-- .../activities/diagram-business-rule-task.component.ts | 3 +-- .../src/components/activities/diagram-camel-task.component.ts | 3 +-- .../activities/diagram-container-service-task.component.ts | 3 +-- .../activities/diagram-google-drive-publish-task.component.ts | 3 +-- .../src/components/activities/diagram-manual-task.component.ts | 3 +-- .../src/components/activities/diagram-mule-task.component.ts | 3 +-- .../components/activities/diagram-receive-task.component.ts | 3 +-- .../components/activities/diagram-rest-call-task.component.ts | 3 +-- .../src/components/activities/diagram-script-task.component.ts | 3 +-- .../src/components/activities/diagram-send-task.component.ts | 3 +-- .../components/activities/diagram-service-task.component.ts | 3 +-- .../src/components/activities/diagram-task.component.ts | 3 +-- .../src/components/activities/diagram-user-task.component.ts | 3 +-- .../boundary-events/diagram-boundary-event.component.ts | 3 +-- .../boundary-events/diagram-throw-event.component.ts | 3 +-- .../src/components/diagram-sequence-flow.component.ts | 3 +-- .../ng2-activiti-diagrams/src/components/diagram.component.ts | 3 +-- .../src/components/events/diagram-end-event.component.ts | 3 +-- .../src/components/events/diagram-event.component.ts | 3 +-- .../src/components/events/diagram-start-event.component.ts | 3 +-- .../src/components/gateways/diagram-event-gateway.component.ts | 3 +-- .../components/gateways/diagram-exclusive-gateway.component.ts | 3 +-- .../src/components/gateways/diagram-gateway.component.ts | 3 +-- .../components/gateways/diagram-inclusive-gateway.component.ts | 3 +-- .../components/gateways/diagram-parallel-gateway.component.ts | 3 +-- .../components/icons/diagram-container-icon-event.component.ts | 3 +-- .../icons/diagram-icon-alfresco-publish-task.component.ts | 3 +-- .../icons/diagram-icon-box-publish-task.component.ts | 3 +-- .../icons/diagram-icon-business-rule-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-camel-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-error.component.ts | 3 +-- .../icons/diagram-icon-google-drive-publish-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-manual-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-message.component.ts | 3 +-- .../src/components/icons/diagram-icon-mule-task.component.ts | 3 +-- .../components/icons/diagram-icon-receive-task.component.ts | 3 +-- .../components/icons/diagram-icon-rest-call-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-script-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-send-task.component.ts | 3 +-- .../components/icons/diagram-icon-service-task.component.ts | 3 +-- .../src/components/icons/diagram-icon-signal.component.ts | 3 +-- .../src/components/icons/diagram-icon-timer.component.ts | 3 +-- .../src/components/icons/diagram-icon-user-task.component.ts | 3 +-- .../diagram-intermediate-catching-event.component.ts | 3 +-- .../structural/diagram-event-subprocess.component.ts | 3 +-- .../src/components/structural/diagram-subprocess.component.ts | 3 +-- 48 files changed, 48 insertions(+), 96 deletions(-) diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts index 83e4246518..3b890b22b0 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-alfresco-publish-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-alfresco-publish-task', - templateUrl: './diagram-alfresco-publish-task.component.html', - styleUrls: ['./diagram-alfresco-publish-task.component.css'] + templateUrl: './diagram-alfresco-publish-task.component.html' }) export class DiagramAlfrescoPublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts index 8202d7f6cf..869169446e 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-box-publish-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-box-publish-task', - templateUrl: './diagram-box-publish-task.component.html', - styleUrls: ['./diagram-box-publish-task.component.css'] + templateUrl: './diagram-box-publish-task.component.html' }) export class DiagramBoxPublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts index 020bcc934e..b88f7e79b4 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-business-rule-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-business-rule-task', - templateUrl: './diagram-business-rule-task.component.html', - styleUrls: ['./diagram-business-rule-task.component.css'] + templateUrl: './diagram-business-rule-task.component.html' }) export class DiagramBusinessRuleTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts index 55e9aa26f9..98e0e38885 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-camel-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-camel-task', - templateUrl: './diagram-camel-task.component.html', - styleUrls: ['./diagram-camel-task.component.css'] + templateUrl: './diagram-camel-task.component.html' }) export class DiagramCamelTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts index 103a392853..d838f55ca6 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-container-service-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-container-service-task', - templateUrl: './diagram-container-service-task.component.html', - styleUrls: ['./diagram-container-service-task.component.css'] + templateUrl: './diagram-container-service-task.component.html' }) export class DiagramContainerServiceTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts index a0991455a1..1cb11f9e62 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-google-drive-publish-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-google-drive-publish-task', - templateUrl: './diagram-google-drive-publish-task.component.html', - styleUrls: ['./diagram-google-drive-publish-task.component.css'] + templateUrl: './diagram-google-drive-publish-task.component.html' }) export class DiagramGoogleDrivePublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts index 63a2b62ba5..b4bd42f15f 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-manual-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-manual-task', - templateUrl: './diagram-manual-task.component.html', - styleUrls: ['./diagram-manual-task.component.css'] + templateUrl: './diagram-manual-task.component.html' }) export class DiagramManualTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts index b166a91075..73b015cbda 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-mule-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-mule-task', - templateUrl: './diagram-mule-task.component.html', - styleUrls: ['./diagram-mule-task.component.css'] + templateUrl: './diagram-mule-task.component.html' }) export class DiagramMuleTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts index 444d0ef067..625ddd7c49 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-receive-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-receive-task', - templateUrl: './diagram-receive-task.component.html', - styleUrls: ['./diagram-receive-task.component.css'] + templateUrl: './diagram-receive-task.component.html' }) export class DiagramReceiveTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts index 5cdfdb2826..6e41f58d75 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-rest-call-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-rest-call-task', - templateUrl: './diagram-rest-call-task.component.html', - styleUrls: ['./diagram-rest-call-task.component.css'] + templateUrl: './diagram-rest-call-task.component.html' }) export class DiagramRestCallTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts index a1b0132a42..65469f9d7c 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-script-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-script-task', - templateUrl: './diagram-script-task.component.html', - styleUrls: ['./diagram-script-task.component.css'] + templateUrl: './diagram-script-task.component.html' }) export class DiagramScriptTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts index 8231c8cee1..90f106dd80 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-send-task.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-send-task', - templateUrl: './diagram-send-task.component.html', - styleUrls: ['./diagram-send-task.component.css'] + templateUrl: './diagram-send-task.component.html' }) export class DiagramSendTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts index 030a2d213f..8498b342a7 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-service-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-service-task', - templateUrl: './diagram-service-task.component.html', - styleUrls: ['./diagram-service-task.component.css'] + templateUrl: './diagram-service-task.component.html' }) export class DiagramServiceTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts index 003f881761..11adfe077f 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-task', - templateUrl: './diagram-task.component.html', - styleUrls: ['./diagram-task.component.css'] + templateUrl: './diagram-task.component.html' }) export class DiagramTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts index c6337d2865..9507bc0b4b 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/activities/diagram-user-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-user-task', - templateUrl: './diagram-user-task.component.html', - styleUrls: ['./diagram-user-task.component.css'] + templateUrl: './diagram-user-task.component.html' }) export class DiagramUserTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts index f1800fc668..b89736cdc0 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-boundary-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-boundary-event', - templateUrl: './diagram-boundary-event.component.html', - styleUrls: ['./diagram-boundary-event.component.css'] + templateUrl: './diagram-boundary-event.component.html' }) export class DiagramBoundaryEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts index 1157746144..d87691f67c 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/boundary-events/diagram-throw-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-throw-event', - templateUrl: './diagram-throw-event.component.html', - styleUrls: ['./diagram-throw-event.component.css'] + templateUrl: './diagram-throw-event.component.html' }) export class DiagramThrowEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts index ff5238467a..aa89eecbf6 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram-sequence-flow.component.ts @@ -20,8 +20,7 @@ import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/cor @Component({ moduleId: module.id, selector: 'diagram-sequence-flow', - templateUrl: './diagram-sequence-flow.component.html', - styleUrls: ['./diagram-sequence-flow.component.css'] + templateUrl: './diagram-sequence-flow.component.html' }) export class DiagramSequenceFlowComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts index 3bd43b5170..f7af6eb5d5 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts @@ -24,8 +24,7 @@ import { RaphaelService } from './raphael/raphael.service'; @Component({ moduleId: module.id, selector: 'activiti-diagram', - templateUrl: './diagram.component.html', - styleUrls: ['./diagram.component.css'] + templateUrl: './diagram.component.html' }) export class DiagramComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts index c5ffc26099..c7b8a9287d 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-end-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-end-event', - templateUrl: './diagram-end-event.component.html', - styleUrls: ['./diagram-end-event.component.css'] + templateUrl: './diagram-end-event.component.html' }) export class DiagramEndEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts index 160e5692cf..8bf1ebd557 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-event', - templateUrl: './diagram-event.component.html', - styleUrls: ['./diagram-event.component.css'] + templateUrl: './diagram-event.component.html' }) export class DiagramEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts index ad81d2c7a4..83d0369894 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/events/diagram-start-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-start-event', - templateUrl: './diagram-start-event.component.html', - styleUrls: ['./diagram-start-event.component.css'] + templateUrl: './diagram-start-event.component.html' }) export class DiagramStartEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts index b5e3ce6072..5cdba6f3bb 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-event-gateway.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-event-gateway', - templateUrl: './diagram-event-gateway.component.html', - styleUrls: ['./diagram-event-gateway.component.css'] + templateUrl: './diagram-event-gateway.component.html' }) export class DiagramEventGatewayComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts index 20910cf3f1..be066cf842 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-exclusive-gateway.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-exclusive-gateway', - templateUrl: './diagram-exclusive-gateway.component.html', - styleUrls: ['./diagram-exclusive-gateway.component.css'] + templateUrl: './diagram-exclusive-gateway.component.html' }) export class DiagramExclusiveGatewayComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts index aefc89828e..a0aadd43e2 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-gateway.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-gateway', - templateUrl: './diagram-gateway.component.html', - styleUrls: ['./diagram-gateway.component.css'] + templateUrl: './diagram-gateway.component.html' }) export class DiagramGatewayComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts index 6efdd85207..410c83d179 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-inclusive-gateway.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-inclusive-gateway', - templateUrl: './diagram-inclusive-gateway.component.html', - styleUrls: ['./diagram-inclusive-gateway.component.css'] + templateUrl: './diagram-inclusive-gateway.component.html' }) export class DiagramInclusiveGatewayComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts index f6ae87a1cd..20c2d84642 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/gateways/diagram-parallel-gateway.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-parallel-gateway', - templateUrl: './diagram-parallel-gateway.component.html', - styleUrls: ['./diagram-parallel-gateway.component.css'] + templateUrl: './diagram-parallel-gateway.component.html' }) export class DiagramParallelGatewayComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts index 6a422c13fa..fdfc433659 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-container-icon-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-container-icon-event', - templateUrl: './diagram-container-icon-event.component.html', - styleUrls: ['./diagram-container-icon-event.component.css'] + templateUrl: './diagram-container-icon-event.component.html' }) export class DiagramContainerIconEventTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts index a330335575..ecf69baf43 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-alfresco-publish-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-alfresco-publish-task', - templateUrl: './diagram-icon-alfresco-publish-task.component.html', - styleUrls: ['./diagram-icon-alfresco-publish-task.component.css'] + templateUrl: './diagram-icon-alfresco-publish-task.component.html' }) export class DiagramIconAlfrescoPublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts index e890703d06..ec58fbf9d6 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-box-publish-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-box-publish-task', - templateUrl: './diagram-icon-box-publish-task.component.html', - styleUrls: ['./diagram-icon-box-publish-task.component.css'] + templateUrl: './diagram-icon-box-publish-task.component.html' }) export class DiagramIconBoxPublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts index c7372aa3f0..8e7064fa62 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-business-rule-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-business-rule-task', - templateUrl: './diagram-icon-business-rule-task.component.html', - styleUrls: ['./diagram-icon-business-rule-task.component.css'] + templateUrl: './diagram-icon-business-rule-task.component.html' }) export class DiagramIconBusinessRuleTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts index 9a08758fc5..12f8ed8219 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-camel-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-camel-task', - templateUrl: './diagram-icon-camel-task.component.html', - styleUrls: ['./diagram-icon-camel-task.component.css'] + templateUrl: './diagram-icon-camel-task.component.html' }) export class DiagramIconCamelTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts index 77a4a8bd9a..d757913222 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-error.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-error', - templateUrl: './diagram-icon-error.component.html', - styleUrls: ['./diagram-icon-error.component.css'] + templateUrl: './diagram-icon-error.component.html' }) export class DiagramIconErrorComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts index 5cbd889b87..3eebba0225 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-google-drive-publish-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-google-drive-publish-task', - templateUrl: './diagram-icon-google-drive-publish-task.component.html', - styleUrls: ['./diagram-icon-google-drive-publish-task.component.css'] + templateUrl: './diagram-icon-google-drive-publish-task.component.html' }) export class DiagramIconGoogleDrivePublishTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts index dde03313a8..d0f2af97eb 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-manual-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-manual-task', - templateUrl: './diagram-icon-manual-task.component.html', - styleUrls: ['./diagram-icon-manual-task.component.css'] + templateUrl: './diagram-icon-manual-task.component.html' }) export class DiagramIconManualTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts index e5f2cf7ec6..7564a23485 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-message.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-message', - templateUrl: './diagram-icon-message.component.html', - styleUrls: ['./diagram-icon-message.component.css'] + templateUrl: './diagram-icon-message.component.html' }) export class DiagramIconMessageComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts index c920d4a3b7..fce69f4697 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-mule-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-mule-task', - templateUrl: './diagram-icon-mule-task.component.html', - styleUrls: ['./diagram-icon-mule-task.component.css'] + templateUrl: './diagram-icon-mule-task.component.html' }) export class DiagramIconMuleTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts index e50230ff18..ca67abe1f4 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-receive-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-receive-task', - templateUrl: './diagram-icon-receive-task.component.html', - styleUrls: ['./diagram-icon-receive-task.component.css'] + templateUrl: './diagram-icon-receive-task.component.html' }) export class DiagramIconReceiveTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts index b2da83242c..87c45074f3 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-rest-call-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-rest-call-task', - templateUrl: './diagram-icon-rest-call-task.component.html', - styleUrls: ['./diagram-icon-rest-call-task.component.css'] + templateUrl: './diagram-icon-rest-call-task.component.html' }) export class DiagramIconRestCallTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts index f088711a0b..498ec86b44 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-script-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-script-task', - templateUrl: './diagram-icon-script-task.component.html', - styleUrls: ['./diagram-icon-script-task.component.css'] + templateUrl: './diagram-icon-script-task.component.html' }) export class DiagramIconScriptTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts index 94f64bf471..9e9f6cc8b7 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-send-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-send-task', - templateUrl: './diagram-icon-send-task.component.html', - styleUrls: ['./diagram-icon-send-task.component.css'] + templateUrl: './diagram-icon-send-task.component.html' }) export class DiagramIconSendTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts index fe93df6745..d1973a62b2 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-service-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-service-task', - templateUrl: './diagram-icon-service-task.component.html', - styleUrls: ['./diagram-icon-service-task.component.css'] + templateUrl: './diagram-icon-service-task.component.html' }) export class DiagramIconServiceTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts index 099307a229..aed37eab01 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-signal.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-signal', - templateUrl: './diagram-icon-signal.component.html', - styleUrls: ['./diagram-icon-signal.component.css'] + templateUrl: './diagram-icon-signal.component.html' }) export class DiagramIconSignalComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts index 015a2b1216..29657ce05a 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-timer.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-timer', - templateUrl: './diagram-icon-timer.component.html', - styleUrls: ['./diagram-icon-timer.component.css'] + templateUrl: './diagram-icon-timer.component.html' }) export class DiagramIconTimerComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts index ac11a61f95..902b0baf6d 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/icons/diagram-icon-user-task.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-icon-user-task', - templateUrl: './diagram-icon-user-task.component.html', - styleUrls: ['./diagram-icon-user-task.component.css'] + templateUrl: './diagram-icon-user-task.component.html' }) export class DiagramIconUserTaskComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts index f86b983a07..c03b144865 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/intermediate-catching-events/diagram-intermediate-catching-event.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-intermediate-catching-event', - templateUrl: './diagram-intermediate-catching-event.component.html', - styleUrls: ['./diagram-intermediate-catching-event.component.css'] + templateUrl: './diagram-intermediate-catching-event.component.html' }) export class DiagramIntermediateCatchingEventComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts index 296040651f..7cf1666c67 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-event-subprocess.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-event-subprocess', - templateUrl: './diagram-event-subprocess.component.html', - styleUrls: ['./diagram-event-subprocess.component.css'] + templateUrl: './diagram-event-subprocess.component.html' }) export class DiagramEventSubprocessComponent { @Input() diff --git a/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts index c73fa22058..dae3ddfb11 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/structural/diagram-subprocess.component.ts @@ -21,8 +21,7 @@ import { DiagramColorService } from '../../services/diagram-color.service'; @Component({ moduleId: module.id, selector: 'diagram-subprocess', - templateUrl: './diagram-subprocess.component.html', - styleUrls: ['./diagram-subprocess.component.css'] + templateUrl: './diagram-subprocess.component.html' }) export class DiagramSubprocessComponent { @Input() From ecfe3a8617694cc267b2de47d22b5911e28d898b Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Wed, 26 Oct 2016 17:25:13 +0100 Subject: [PATCH 47/61] Fix unit test --- ...nalytics-report-heat-map.component.spec.ts | 128 ++++++++++++++++++ .../analytics-report-heat-map.component.ts | 11 +- ...lytics-report-parameters.component.spec.ts | 23 +--- .../components/analytics.component.spec.ts | 6 +- .../src/services/analytics.service.ts | 11 -- 5 files changed, 145 insertions(+), 34 deletions(-) create mode 100644 ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.spec.ts diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.spec.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.spec.ts new file mode 100644 index 0000000000..3be8225c59 --- /dev/null +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.spec.ts @@ -0,0 +1,128 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { CoreModule } from 'ng2-alfresco-core'; +import { DiagramsModule } from 'ng2-activiti-diagrams'; +import { AnalyticsReportHeatMapComponent } from '../components/analytics-report-heat-map.component'; +import { WIDGET_DIRECTIVES } from '../components/widgets/index'; +import { AnalyticsService } from '../services/analytics.service'; +import { DebugElement } from '@angular/core'; + +declare let jasmine: any; + +describe('Test ng2-activiti-analytics-report-heat-map', () => { + + let componentHandler: any; + let component: any; + let fixture: ComponentFixture; + let debug: DebugElement; + let element: HTMLElement; + + let totalCountPerc = {'sid-fake-id': 0, 'fake-start-event': 100}; + let totalTimePerc = {'sid-fake-id': 10, 'fake-start-event': 30}; + let avgTimePercentages = {'sid-fake-id': 5, 'fake-start-event': 50}; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + CoreModule, + DiagramsModule + ], + declarations: [ + AnalyticsReportHeatMapComponent, + ...WIDGET_DIRECTIVES + ], + providers: [ + AnalyticsService + ] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AnalyticsReportHeatMapComponent); + component = fixture.componentInstance; + debug = fixture.debugElement; + element = fixture.nativeElement; + componentHandler = jasmine.createSpyObj('componentHandler', [ + 'upgradeAllRegistered' + ]); + window['componentHandler'] = componentHandler; + + component.report = { + totalCountsPercentages: totalCountPerc, + totalTimePercentages: totalTimePerc, + avgTimePercentages: avgTimePercentages + }; + }); + + describe('Rendering tests: Heat Map', () => { + + beforeEach(() => { + jasmine.Ajax.install(); + }); + + afterEach(() => { + jasmine.Ajax.uninstall(); + }); + + it('should render the dropdown with the metric options', async(() => { + component.report = {totalCountsPercentages: {'sid-fake-id': 10, 'fake-start-event': 30}}; + + component.onSuccess.subscribe(() => { + fixture.whenStable().then(() => { + let dropDown: any = element.querySelector('#select-metrics'); + expect(dropDown).toBeDefined(); + expect(dropDown.length).toEqual(3); + expect(dropDown[0].innerHTML).toEqual('Number of times a step is executed'); + expect(dropDown[1].innerHTML).toEqual('Total time spent in a process step'); + expect(dropDown[2].innerHTML).toEqual('Average time spent in a process step'); + }); + }); + fixture.detectChanges(); + })); + + it('should return false when no metrics are defined in the report', async(() => { + component.report = {}; + expect(component.hasMetric()).toBeFalsy(); + })); + + it('should return true when the metrics are defined in the report', async(() => { + expect(component.hasMetric()).toBeTruthy(); + })); + + it('should change the currentmetric width totalCount', async(() => { + let field = {value: 'totalCount'}; + component.onMetricChanges(field); + expect(component.currentMetric).toEqual(totalCountPerc); + })); + + it('should change the currentmetric width totalTime', async(() => { + let field = {value: 'totalTime'}; + component.onMetricChanges(field); + expect(component.currentMetric).toEqual(totalTimePerc); + })); + + it('should change the currentmetric width avgTime', async(() => { + let field = {value: 'avgTime'}; + component.onMetricChanges(field); + expect(component.currentMetric).toEqual(avgTimePercentages); + })); + + }); + +}); diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts index 718fccb8ea..1087157e24 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-heat-map.component.ts @@ -23,14 +23,16 @@ import { FormGroup, FormBuilder, FormControl } from '@angular/forms'; @Component({ moduleId: module.id, selector: 'analytics-report-heat-map', - templateUrl: './analytics-report-heat-map.component.html', - styleUrls: ['./analytics-report-heat-map.component.css'] + templateUrl: './analytics-report-heat-map.component.html' }) export class AnalyticsReportHeatMapComponent implements OnInit { @Input() report: any; + @Output() + onSuccess = new EventEmitter(); + @Output() onError = new EventEmitter(); @@ -55,10 +57,7 @@ export class AnalyticsReportHeatMapComponent implements OnInit { this.analyticsService.getMetricValues().subscribe( (opts: any[]) => { this.field.options = opts; - }, - (err: any) => { - console.log(err); - this.onError.emit(err); + this.onSuccess.emit(opts); } ); } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.spec.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.spec.ts index afd6c03fee..9302b32f01 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.spec.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics-report-parameters.component.spec.ts @@ -20,11 +20,8 @@ import { CoreModule } from 'ng2-alfresco-core'; -import { AnalyticsReportListComponent } from '../components/analytics-report-list.component'; -import { AnalyticsComponent } from '../components/analytics.component'; import { AnalyticsReportParametersComponent } from '../components/analytics-report-parameters.component'; import { WIDGET_DIRECTIVES } from '../components/widgets/index'; -import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { AnalyticsService } from '../services/analytics.service'; import { ReportParametersModel } from '../models/report.model'; @@ -32,16 +29,6 @@ import * as moment from 'moment'; import { DebugElement, SimpleChange } from '@angular/core'; import * as analyticParamsMock from '../assets/analyticsParamsReportComponent.mock'; -export const ANALYTICS_DIRECTIVES: any[] = [ - AnalyticsComponent, - AnalyticsReportParametersComponent, - AnalyticsReportListComponent, - WIDGET_DIRECTIVES -]; -export const ANALYTICS_PROVIDERS: any[] = [ - AnalyticsService -]; - declare let jasmine: any; declare let mdDateTimePicker: any; @@ -60,11 +47,11 @@ describe('Test ng2-analytics-report-parameters Report Parameters ', () => { CoreModule ], declarations: [ - ...ANALYTICS_DIRECTIVES, - ...CHART_DIRECTIVES + AnalyticsReportParametersComponent, + ...WIDGET_DIRECTIVES ], providers: [ - ...ANALYTICS_PROVIDERS + AnalyticsService ] }).compileComponents(); })); @@ -178,6 +165,7 @@ describe('Test ng2-analytics-report-parameters Report Parameters ', () => { expect(res.duration).toEqual(22); expect(res.dateRangeInterval).toEqual(120); expect(res.slowProcessInstanceInteger).toEqual(2); + expect(res.typeFiltering).toEqual(true); }); let values: any = { @@ -201,6 +189,9 @@ describe('Test ng2-analytics-report-parameters Report Parameters ', () => { }, processInstanceGroup: { slowProcessInstanceInteger: 2 + }, + typeFilteringGroup: { + typeFiltering: true } }; component.submit(values); diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts index 16d1fbd100..d5fb553eec 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts @@ -19,10 +19,12 @@ import { ComponentFixture, TestBed, async } from '@angular/core/testing'; import { CoreModule } from 'ng2-alfresco-core'; +import { DiagramsModule } from 'ng2-activiti-diagrams'; import { AnalyticsReportListComponent } from '../components/analytics-report-list.component'; import { AnalyticsComponent } from '../components/analytics.component'; import { AnalyticsReportParametersComponent } from '../components/analytics-report-parameters.component'; +import { AnalyticsReportHeatMapComponent } from '../components/analytics-report-heat-map.component'; import { WIDGET_DIRECTIVES } from '../components/widgets/index'; import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; import { Chart } from '../models/chart.model'; @@ -35,6 +37,7 @@ export const ANALYTICS_DIRECTIVES: any[] = [ AnalyticsComponent, AnalyticsReportParametersComponent, AnalyticsReportListComponent, + AnalyticsReportHeatMapComponent, WIDGET_DIRECTIVES ]; export const ANALYTICS_PROVIDERS: any[] = [ @@ -56,7 +59,8 @@ describe('Test ng2-activiti-analytics Report ', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ - CoreModule + CoreModule, + DiagramsModule ], declarations: [ ...ANALYTICS_DIRECTIVES, diff --git a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts index fc056d8e07..867fe2c47d 100644 --- a/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts +++ b/ng2-components/ng2-activiti-analytics/src/services/analytics.service.ts @@ -142,17 +142,6 @@ export class AnalyticsService { }).catch(this.handleError); } - getProcessDefinitionModel(processDefinitionId: string): Observable { - let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/process-definitions/${processDefinitionId}/model-json`; - let options = this.getRequestOptions(); - return this.http - .get(url, options) - .map((res: any) => { - let body = res.json(); - return body; - }).catch(this.handleError); - } - getTasksByProcessDefinitionId(reportId: string, processDefinitionId: string): Observable { if (reportId && processDefinitionId) { let url = `${this.alfrescoSettingsService.getBPMApiBaseUrl()}/app/rest/reporting/report-params/${reportId}/tasks`; From 304d4fb570fb669c2c6c8cfbc3d8d55e2a5cfc63 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 10:43:55 +0100 Subject: [PATCH 48/61] Fix Travis and AppVeyor setting --- .travis.yml | 21 +++++++++++++-------- appveyor.yml | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a5d6d84f9..08c3c00b76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,26 +31,27 @@ env: - MODULE=ng2-activiti-form - MODULE=ng2-activiti-tasklist - MODULE=ng2-activiti-processlist + - MODULE=ng2-activiti-diagrams - MODULE=ng2-activiti-analytics - MODULE=ng2-alfresco-userinfo before_script: - if ([ "$MODULE" != "ng2-alfresco-core" ]); then - (cd ng2-components/ng2-alfresco-core; npm install; npm link); + (cd ng2-components/ng2-alfresco-core; npm install; npm link; cd ng2-components/$MODULE; npm link ng2-alfresco-core;); fi - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then - (cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; npm install; npm link); + (cd ng2-components/ng2-alfresco-datatable; npm install; npm link); fi - if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; npm install; npm link); + (cd ng2-components/ng2-activiti-form; npm install; npm link); fi - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); + (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then + (cd ng2-components/ng2-activiti-diagrams; npm install; npm link); fi - cd ng2-components/$MODULE; - - if ([ "$MODULE" != "ng2-alfresco-core" ]); then - npm link ng2-alfresco-core; - fi - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then npm link ng2-alfresco-datatable; fi @@ -60,6 +61,9 @@ before_script: - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then npm link ng2-activiti-tasklist; fi + - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then + npm link ng2-activiti-diagrams; + fi - npm install; - npm run travis - ls -ltrh ./node_modules/ @@ -83,5 +87,6 @@ cache: - ng2-components/ng2-alfresco-viewer/node_modules - ng2-components/ng2-alfresco-webscript/node_modules - ng2-components/ng2-alfresco-tag/node_modules - - ng2-components/ng2-alfresco-analytics/node_modules + - ng2-components/ng2-activiti-analytics/node_modules - ng2-components/ng2-alfresco-userinfo/node_modules + - ng2-components/ng2-activiti-diagrams/node_modules diff --git a/appveyor.yml b/appveyor.yml index 7f8f94b30f..7e892d3323 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,6 +19,7 @@ environment: - COMPONENT_NAME: ng2-activiti-form - COMPONENT_NAME: ng2-activiti-tasklist - COMPONENT_NAME: ng2-activiti-processlist + - COMPONENT_NAME: ng2-activiti-diagrams - COMPONENT_NAME: ng2-activiti-analytics - COMPONENT_NAME: ng2-alfresco-userinfo @@ -41,6 +42,7 @@ install: - IF %COMPONENT_NAME% EQU ng2-activiti-processlist (npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm link ng2-activiti-tasklist) - IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (npm link ng2-alfresco-datatable && npm link ng2-activiti-form) - IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (npm link ng2-alfresco-datatable) + - IF %COMPONENT_NAME% EQU ng2-activiti-analytics (npm link ng2-alfresco-diagrams) - npm install # Post-install test scripts. From 3e98ad4cd955bb3f7a754f5ac2c537451fdc9c8a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 10:44:41 +0100 Subject: [PATCH 49/61] Fix script demo shell with analytics and diagrams components --- scripts/npm-build-all.sh | 1 + scripts/npm-check.sh | 1 + scripts/npm-clean.sh | 1 + scripts/npm-link-demo-shell.sh | 11 ++++++++++- scripts/npm-publish.sh | 1 + scripts/update-version.sh | 2 ++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/npm-build-all.sh b/scripts/npm-build-all.sh index 82e3d40f5d..76b65c74ff 100755 --- a/scripts/npm-build-all.sh +++ b/scripts/npm-build-all.sh @@ -12,6 +12,7 @@ build_project() { for PACKAGE in \ ng2-alfresco-core \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-tasklist \ diff --git a/scripts/npm-check.sh b/scripts/npm-check.sh index 704e3b72a4..fa64945cef 100755 --- a/scripts/npm-check.sh +++ b/scripts/npm-check.sh @@ -7,6 +7,7 @@ npm install -g npm-check echo 'start' > ../check-dependecies.log for PACKAGE in \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-processlist \ diff --git a/scripts/npm-clean.sh b/scripts/npm-clean.sh index 0d5679972c..49adc15d9e 100755 --- a/scripts/npm-clean.sh +++ b/scripts/npm-clean.sh @@ -3,6 +3,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" for PACKAGE in \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-alfresco-core \ ng2-alfresco-datatable \ diff --git a/scripts/npm-link-demo-shell.sh b/scripts/npm-link-demo-shell.sh index 107801474f..ce6837b726 100755 --- a/scripts/npm-link-demo-shell.sh +++ b/scripts/npm-link-demo-shell.sh @@ -56,9 +56,17 @@ npm link ng2-activiti-tasklist npm link npm run build +#LINK ANALYTICS +echo "====== linking component: ng2-activiti-analytics =====" +cd "$DIR/../ng2-components/ng2-activiti-analytics" +npm link ng2-alfresco-core +npm link ng2-alfresco-diagrams +npm link +npm run build + #LINK ALL THE OTHERS COMPONENTS for PACKAGE in \ - ng2-activiti-analytics \ + ng2-activiti-diagrams \ ng2-alfresco-login \ ng2-alfresco-search \ ng2-alfresco-userinfo \ @@ -78,6 +86,7 @@ done #LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL cd "$DIR/../demo-shell-ng2" for PACKAGE in \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-processlist \ diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 0e72830416..c294cec093 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -6,6 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" for PACKAGE in \ ng2-alfresco-core \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-tasklist \ diff --git a/scripts/update-version.sh b/scripts/update-version.sh index dca9b25a6b..ec93ed5c6a 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -15,6 +15,7 @@ then fi for PACKAGE in \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-processlist \ @@ -36,6 +37,7 @@ do done for PACKAGE in \ + ng2-activiti-diagrams \ ng2-activiti-analytics \ ng2-activiti-form \ ng2-activiti-processlist \ From ce183df84f5c7f1fbe2b79990a3571132e436e9b Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 10:47:10 +0100 Subject: [PATCH 50/61] Fix posttest command --- ng2-components/ng2-activiti-diagrams/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng2-components/ng2-activiti-diagrams/package.json b/ng2-components/ng2-activiti-diagrams/package.json index 857e879bcb..25d685ee6c 100644 --- a/ng2-components/ng2-activiti-diagrams/package.json +++ b/ng2-components/ng2-activiti-diagrams/package.json @@ -18,7 +18,7 @@ "pretest": "npm run build", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run", "test-browser": "concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"", - "posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", + "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", "travis": "echo 'placeholder'" From e9cbe3e5d42a548c0a29172c3e088963a1357fc5 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 11:58:24 +0100 Subject: [PATCH 51/61] Fix travis setting inside package.json --- ng2-components/ng2-activiti-analytics/package.json | 2 +- ng2-components/ng2-activiti-diagrams/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/package.json b/ng2-components/ng2-activiti-analytics/package.json index 6107f4f185..5fe5f2ba41 100644 --- a/ng2-components/ng2-activiti-analytics/package.json +++ b/ng2-components/ng2-activiti-analytics/package.json @@ -21,7 +21,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core ng2-activiti-diagrams" }, "contributors": [ { diff --git a/ng2-components/ng2-activiti-diagrams/package.json b/ng2-components/ng2-activiti-diagrams/package.json index 25d685ee6c..bbc0145c88 100644 --- a/ng2-components/ng2-activiti-diagrams/package.json +++ b/ng2-components/ng2-activiti-diagrams/package.json @@ -21,7 +21,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core" }, "contributors": [ { From 94799f8ea94b870530aff699e2186fb5b1f12145 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 12:56:34 +0100 Subject: [PATCH 52/61] update travis build --- .travis.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08c3c00b76..d120dbdd18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ env: before_script: - if ([ "$MODULE" != "ng2-alfresco-core" ]); then - (cd ng2-components/ng2-alfresco-core; npm install; npm link; cd ng2-components/$MODULE; npm link ng2-alfresco-core;); + (cd ng2-components/ng2-alfresco-core; npm install; npm link); fi - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then (cd ng2-components/ng2-alfresco-datatable; npm install; npm link); @@ -52,20 +52,8 @@ before_script: (cd ng2-components/ng2-activiti-diagrams; npm install; npm link); fi - cd ng2-components/$MODULE; - - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then - npm link ng2-alfresco-datatable; - fi - - if ([ "$MODULE" == "ng2-activiti-tasklist" ]); then - npm link ng2-activiti-form; - fi - - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then - npm link ng2-activiti-tasklist; - fi - - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then - npm link ng2-activiti-diagrams; - fi - - npm install; - npm run travis + - npm install; - ls -ltrh ./node_modules/ script: npm run test # Send coverage data to Coveralls From 0dd8b5c3adf56d5106d1f35ef81f2393c63914c1 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 15:47:26 +0100 Subject: [PATCH 53/61] Fix travis build setting --- .travis.yml | 8 ++++---- ng2-components/ng2-alfresco-tag/package.json | 2 +- ng2-components/ng2-alfresco-userinfo/package.json | 2 +- ng2-components/ng2-alfresco-viewer/package.json | 2 +- ng2-components/ng2-alfresco-webscript/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d120dbdd18..7a6c4c312a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,16 +40,16 @@ before_script: (cd ng2-components/ng2-alfresco-core; npm install; npm link); fi - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then - (cd ng2-components/ng2-alfresco-datatable; npm install; npm link); + (cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; npm install; npm link); fi - if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-form; npm install; npm link); + (cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; npm install; npm link); fi - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); + (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); fi - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then - (cd ng2-components/ng2-activiti-diagrams; npm install; npm link); + (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); fi - cd ng2-components/$MODULE; - npm run travis diff --git a/ng2-components/ng2-alfresco-tag/package.json b/ng2-components/ng2-alfresco-tag/package.json index 70e9252f1d..2ce0aa24be 100644 --- a/ng2-components/ng2-alfresco-tag/package.json +++ b/ng2-components/ng2-alfresco-tag/package.json @@ -21,7 +21,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core" }, "repository": { "type": "git", diff --git a/ng2-components/ng2-alfresco-userinfo/package.json b/ng2-components/ng2-alfresco-userinfo/package.json index 4f1752b1b2..302a0b705b 100644 --- a/ng2-components/ng2-alfresco-userinfo/package.json +++ b/ng2-components/ng2-alfresco-userinfo/package.json @@ -21,7 +21,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core" }, "repository": { "type": "git", diff --git a/ng2-components/ng2-alfresco-viewer/package.json b/ng2-components/ng2-alfresco-viewer/package.json index fa8baf7057..7e320d2ea2 100644 --- a/ng2-components/ng2-alfresco-viewer/package.json +++ b/ng2-components/ng2-alfresco-viewer/package.json @@ -19,7 +19,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", diff --git a/ng2-components/ng2-alfresco-webscript/package.json b/ng2-components/ng2-alfresco-webscript/package.json index 60db62d0f7..1da32f23ae 100644 --- a/ng2-components/ng2-alfresco-webscript/package.json +++ b/ng2-components/ng2-alfresco-webscript/package.json @@ -21,7 +21,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "echo 'placeholder'" + "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable" }, "repository": { "type": "git", From 92ec8b4b32c4a6e926d5c72b408249ed86700970 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 17:52:14 +0100 Subject: [PATCH 54/61] Travis remove the hardcoded create link --- .travis.yml | 16 +--------------- .../ng2-activiti-processlist/package.json | 2 +- .../ng2-activiti-tasklist/package.json | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a6c4c312a..f5507a1646 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,24 +36,10 @@ env: - MODULE=ng2-alfresco-userinfo before_script: - - if ([ "$MODULE" != "ng2-alfresco-core" ]); then - (cd ng2-components/ng2-alfresco-core; npm install; npm link); - fi - - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then - (cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; npm install; npm link); - fi - - if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; npm install; npm link); - fi - - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then - (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); - fi - - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then - (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); - fi - cd ng2-components/$MODULE; - npm run travis - npm install; + - npm link; - ls -ltrh ./node_modules/ script: npm run test # Send coverage data to Coveralls diff --git a/ng2-components/ng2-activiti-processlist/package.json b/ng2-components/ng2-activiti-processlist/package.json index 421fc60e3a..1c60bbc2a5 100644 --- a/ng2-components/ng2-activiti-processlist/package.json +++ b/ng2-components/ng2-activiti-processlist/package.json @@ -19,7 +19,7 @@ "posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable" + "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable ng2-activiti-form" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", diff --git a/ng2-components/ng2-activiti-tasklist/package.json b/ng2-components/ng2-activiti-tasklist/package.json index 626272aff8..87fbf34d15 100644 --- a/ng2-components/ng2-activiti-tasklist/package.json +++ b/ng2-components/ng2-activiti-tasklist/package.json @@ -19,7 +19,7 @@ "posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable" + "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable ng2-activiti-form" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", From 3b68da363b4f24ea7a667965c46c7ef5d978874d Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 27 Oct 2016 17:59:47 +0100 Subject: [PATCH 55/61] Travis add dependency --- .travis.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f5507a1646..560d3defe0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,10 +36,24 @@ env: - MODULE=ng2-alfresco-userinfo before_script: + - if ([ "$MODULE" != "ng2-alfresco-core" ]); then + (cd ng2-components/ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then + (cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then + (cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then + (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); + fi + - if ([ "$MODULE" == "ng2-aqctiviti-analitycs" ]); then + (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); + fi - cd ng2-components/$MODULE; - npm run travis - npm install; - - npm link; - ls -ltrh ./node_modules/ script: npm run test # Send coverage data to Coveralls From 7516411aa8a606e59baf146aa5cb5754c75f6e2a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 10:55:34 +0100 Subject: [PATCH 56/61] Basic Diagram component unit test --- ng2-components/ng2-activiti-diagrams/index.ts | 9 +- .../src/components/diagram.component.spec.ts | 109 ++++++++++++++++++ .../src/components/diagram.component.ts | 4 + .../src/components/index.ts | 13 ++- 4 files changed, 126 insertions(+), 9 deletions(-) create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/diagram.component.spec.ts diff --git a/ng2-components/ng2-activiti-diagrams/index.ts b/ng2-components/ng2-activiti-diagrams/index.ts index 75c5358549..121a0c86bf 100644 --- a/ng2-components/ng2-activiti-diagrams/index.ts +++ b/ng2-components/ng2-activiti-diagrams/index.ts @@ -18,9 +18,7 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; import { CoreModule } from 'ng2-alfresco-core'; -import { DIAGRAM_DIRECTIVES } from './src/components/index'; -import { DiagramColorService } from './src/services/diagram-color.service'; -import { DiagramsService } from './src/services/diagrams.service'; +import { DIAGRAM_DIRECTIVES, DIAGRAM_PROVIDERS } from './src/components/index'; import { RAPHAEL_DIRECTIVES } from './src/components/raphael/index'; import { RAPHAEL_PROVIDERS } from './src/components/raphael/index'; @@ -29,11 +27,6 @@ import { RAPHAEL_PROVIDERS } from './src/components/raphael/index'; export * from './src/components/index'; export * from './src/components/raphael/index'; -export const DIAGRAM_PROVIDERS: any[] = [ - DiagramsService, - DiagramColorService -]; - @NgModule({ imports: [ CoreModule diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.spec.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.spec.ts new file mode 100644 index 0000000000..f436e82842 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.spec.ts @@ -0,0 +1,109 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; +import { + CoreModule +} from 'ng2-alfresco-core'; + +import { DIAGRAM_DIRECTIVES, DIAGRAM_PROVIDERS } from './index'; +import { RAPHAEL_DIRECTIVES, RAPHAEL_PROVIDERS } from './raphael/index'; +import { DiagramComponent } from './index'; +import { DebugElement } from '@angular/core'; + +declare let jasmine: any; + +describe('Test ng2-activiti-diagrams ', () => { + + let component: any; + let fixture: ComponentFixture; + let debug: DebugElement; + let element: HTMLElement; + + let componentHandler: any; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + CoreModule + ], + declarations: [ + ...DIAGRAM_DIRECTIVES, + ...RAPHAEL_DIRECTIVES + ], + providers: [ + ...DIAGRAM_PROVIDERS, + ...RAPHAEL_PROVIDERS + ] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DiagramComponent); + component = fixture.componentInstance; + debug = fixture.debugElement; + element = fixture.nativeElement; + fixture.detectChanges(); + componentHandler = jasmine.createSpyObj('componentHandler', [ + 'upgradeAllRegistered' + ]); + window['componentHandler'] = componentHandler; + }); + + describe('Diagrams component ', () => { + beforeEach(() => { + jasmine.Ajax.install(); + }); + + afterEach(() => { + jasmine.Ajax.uninstall(); + }); + + it('Should render the StartEvent', async(() => { + component.processDefinitionId = 'fakeprocess:24:38399'; + component.metricPercentages = {startEvent: 0}; + + component.onSuccess.subscribe((res) => { + fixture.detectChanges(); + fixture.whenStable().then(() => { + expect(res).toBeDefined(); + let startEvent: any = element.querySelector('diagram-start-event'); + expect(startEvent).toBeDefined(); + let raphaelCircle: any = element.querySelector('raphael-circle'); + expect(raphaelCircle).toBeDefined(); + }); + }); + component.ngOnChanges(); + let startEvent = { + id: 'startEvent1', + type: 'StartEvent', + width: 30, + height: 30, + x: 15, + y: 48.5, + properties: [{}] + }; + let resp = {elements : [startEvent] }; + + jasmine.Ajax.requests.mostRecent().respondWith({ + status: 200, + contentType: 'json', + responseText: resp + }); + })); + }); +}); diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts index f7af6eb5d5..30d87ab5f2 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.ts @@ -39,6 +39,9 @@ export class DiagramComponent { @Input() height: number = 500; + @Output() + onSuccess = new EventEmitter(); + @Output() onError = new EventEmitter(); @@ -70,6 +73,7 @@ export class DiagramComponent { this.diagramsService.getProcessDefinitionModel(processDefinitionId).subscribe( (res: any) => { this.diagram = res; + this.onSuccess.emit(res); }, (err: any) => { this.onError.emit(err); diff --git a/ng2-components/ng2-activiti-diagrams/src/components/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/index.ts index 244c024e94..b6346365b9 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/index.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/index.ts @@ -24,6 +24,10 @@ import { DIAGRAM_ICONS_DIRECTIVES } from './icons/index'; import { DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES } from './boundary-events/index'; import { DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES } from './intermediate-catching-events/index'; import { DIAGRAM_STRUCTURAL_DIRECTIVES } from './structural/index'; +import { DIAGRAM_SWIMLANES_DIRECTIVES } from './swimlanes/index'; + +import { DiagramColorService } from '../services/diagram-color.service'; +import { DiagramsService } from '../services/diagrams.service'; // primitives export * from './diagram.component'; @@ -34,6 +38,7 @@ export * from './diagram-sequence-flow.component'; export * from './boundary-events/index'; export * from './intermediate-catching-events/index'; export * from './structural/index'; +export * from './swimlanes/index'; export const DIAGRAM_DIRECTIVES: any[] = [ DiagramComponent, @@ -44,5 +49,11 @@ export const DIAGRAM_DIRECTIVES: any[] = [ DIAGRAM_ICONS_DIRECTIVES, DIAGRAM_BOUNDARY_EVENTS_DIRECTIVES, DIAGRAM_INTERMEDIATE_EVENTS_DIRECTIVES, - DIAGRAM_STRUCTURAL_DIRECTIVES + DIAGRAM_STRUCTURAL_DIRECTIVES, + DIAGRAM_SWIMLANES_DIRECTIVES +]; + +export const DIAGRAM_PROVIDERS: any[] = [ + DiagramsService, + DiagramColorService ]; From 1c6871e0042378cced78e0d0788627179f2ccade Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 10:55:59 +0100 Subject: [PATCH 57/61] Fix processlist travis dependency --- ng2-components/ng2-activiti-processlist/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng2-components/ng2-activiti-processlist/package.json b/ng2-components/ng2-activiti-processlist/package.json index 1c60bbc2a5..f5d01b1880 100644 --- a/ng2-components/ng2-activiti-processlist/package.json +++ b/ng2-components/ng2-activiti-processlist/package.json @@ -19,7 +19,7 @@ "posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", "prepublish": "npm run build", - "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable ng2-activiti-form" + "travis": "npm link ng2-alfresco-core ng2-alfresco-datatable ng2-activiti-form ng2-activiti-tasklist" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", From 589acc8b337aeb9bddff03b4d8caa1bc2cb288dc Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 11:10:29 +0100 Subject: [PATCH 58/61] Add pool and lane components --- .../src/components/diagram.component.html | 3 ++ .../raphael/raphael-text.component.ts | 8 ++- .../swimlanes/diagram-lane.component.html | 4 ++ .../swimlanes/diagram-lane.component.ts | 54 +++++++++++++++++++ .../swimlanes/diagram-lanes.component.html | 5 ++ .../swimlanes/diagram-lanes.component.ts | 37 +++++++++++++ .../swimlanes/diagram-pool.component.html | 4 ++ .../swimlanes/diagram-pool.component.ts | 54 +++++++++++++++++++ .../swimlanes/diagram-pools.component.html | 6 +++ .../swimlanes/diagram-pools.component.ts | 37 +++++++++++++ .../src/components/swimlanes/index.ts | 35 ++++++++++++ 11 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.html create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.ts create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.html create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.ts create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.html create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.ts create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.html create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.ts create mode 100644 ng2-components/ng2-activiti-diagrams/src/components/swimlanes/index.ts diff --git a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html index 3f2240fcdd..9cf62cc2d4 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html +++ b/ng2-components/ng2-activiti-diagrams/src/components/diagram.component.html @@ -61,4 +61,7 @@
+
+ +
diff --git a/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts index b116d5df89..bb177072bb 100644 --- a/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts +++ b/ng2-components/ng2-activiti-diagrams/src/components/raphael/raphael-text.component.ts @@ -28,6 +28,9 @@ export class RaphaelTextDirective extends RaphaelBase implements OnInit { @Input() position: Point; + @Input() + transform: string; + @Input() text: string; @@ -48,11 +51,14 @@ export class RaphaelTextDirective extends RaphaelBase implements OnInit { } public draw(position: Point, text: string) { - return this.paper.text(position.x, position.y, text).attr({ + let textPaper = this.paper.text(position.x, position.y, text).attr({ 'text-anchor' : 'middle', 'font-family' : 'Arial', 'font-size' : '11', 'fill' : '#373e48' }); + + textPaper.transform(this.transform); + return textPaper; } } diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.html b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.html new file mode 100644 index 0000000000..a4460506bd --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.html @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.ts new file mode 100644 index 0000000000..325b018f63 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lane.component.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from '../../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-lane', + templateUrl: './diagram-lane.component.html' +}) +export class DiagramLaneComponent { + @Input() + lane: any; + + @Output() + onError = new EventEmitter(); + + rectLeftCorner: any; + width: any; + height: any; + + textPosition: any; + text: string; + textTransform: string; + options: any = {stroke: '#000000', fillColors: 'none', fillOpacity: '', strokeWidth: '1', radius: 0}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.rectLeftCorner = {x: this.lane.x, y: this.lane.y}; + this.width = this.lane.width; + this.height = this.lane.height; + + this.textPosition = {x: this.lane.x + 10, y: this.lane.y + ( this.lane.height / 2 )}; + this.text = this.lane.name; + this.textTransform = 'r270'; + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.html b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.html new file mode 100644 index 0000000000..ef914e2b45 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.html @@ -0,0 +1,5 @@ +
+
+ +
+
diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.ts new file mode 100644 index 0000000000..072175d68c --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-lanes.component.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-lanes', + templateUrl: './diagram-lanes.component.html' +}) +export class DiagramLanesComponent { + @Input() + lanes: any []; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.html b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.html new file mode 100644 index 0000000000..a4460506bd --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.html @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.ts new file mode 100644 index 0000000000..59dd0a0dde --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pool.component.ts @@ -0,0 +1,54 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; +import { DiagramColorService } from '../../services/diagram-color.service'; + +@Component({ + moduleId: module.id, + selector: 'diagram-pool', + templateUrl: './diagram-pool.component.html' +}) +export class DiagramPoolComponent { + @Input() + pool: any; + + @Output() + onError = new EventEmitter(); + + rectLeftCorner: any; + width: any; + height: any; + + textPosition: any; + text: string; + textTransform: string; + options: any = {stroke: '#000000', fillColors: 'none', fillOpacity: '', strokeWidth: '1', radius: 0}; + + constructor(public elementRef: ElementRef, + private diagramColorService: DiagramColorService) {} + + ngOnInit() { + this.rectLeftCorner = {x: this.pool.x, y: this.pool.y}; + this.width = this.pool.width; + this.height = this.pool.height; + + this.textPosition = {x: this.pool.x + 14, y: this.pool.y + ( this.pool.height / 2 )}; + this.text = this.pool.name; + this.textTransform = 'r270'; + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.html b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.html new file mode 100644 index 0000000000..e963bcdbad --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.html @@ -0,0 +1,6 @@ +
+
+ + +
+
diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.ts b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.ts new file mode 100644 index 0000000000..e54b1f0704 --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/diagram-pools.component.ts @@ -0,0 +1,37 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { Component, ElementRef, Input, Output, EventEmitter } from '@angular/core'; + +@Component({ + moduleId: module.id, + selector: 'diagram-pools', + templateUrl: './diagram-pools.component.html' +}) +export class DiagramPoolsComponent { + @Input() + pools: any []; + + @Output() + onError = new EventEmitter(); + + constructor(public elementRef: ElementRef) {} + + ngOnInit() { + + } +} diff --git a/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/index.ts b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/index.ts new file mode 100644 index 0000000000..218e2b88fb --- /dev/null +++ b/ng2-components/ng2-activiti-diagrams/src/components/swimlanes/index.ts @@ -0,0 +1,35 @@ +/*! + * @license + * Copyright 2016 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. + */ + +import { DiagramPoolsComponent } from './diagram-pools.component'; +import { DiagramPoolComponent } from './diagram-pool.component'; + +import { DiagramLanesComponent } from './diagram-lanes.component'; +import { DiagramLaneComponent } from './diagram-lane.component'; + +// primitives +export * from './diagram-pools.component'; +export * from './diagram-pool.component'; +export * from './diagram-lanes.component'; +export * from './diagram-lane.component'; + +export const DIAGRAM_SWIMLANES_DIRECTIVES: any[] = [ + DiagramPoolsComponent, + DiagramPoolComponent, + DiagramLanesComponent, + DiagramLaneComponent +]; From a7248e2ddfbfa056283c9bf209c2d8d44eb0748a Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 12:38:50 +0100 Subject: [PATCH 59/61] Fix typing error --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 560d3defe0..b37cd52a02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,8 +47,8 @@ before_script: fi - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); - fi - - if ([ "$MODULE" == "ng2-aqctiviti-analitycs" ]); then + fiinstall + - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); fi - cd ng2-components/$MODULE; From 2e80411eb1a07208d798afd0ad7605b2bec15963 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 13:49:27 +0100 Subject: [PATCH 60/61] Fix typing error --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b37cd52a02..7a6c4c312a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ before_script: fi - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); - fiinstall + fi - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); fi From 5c97c89ad8fd468b5e0c7ef22835bcd95ae167d7 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 28 Oct 2016 15:06:48 +0100 Subject: [PATCH 61/61] Fix typing error --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7a6c4c312a..a3786026b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ before_script: - if ([ "$MODULE" == "ng2-activiti-processlist" ]); then (cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; npm install; npm link); fi - - if ([ "$MODULE" == "ng2-activiti-analitycs" ]); then + - if ([ "$MODULE" == "ng2-activiti-analytics" ]); then (cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; npm install; npm link); fi - cd ng2-components/$MODULE;