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); + } +}