+
+
+
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts
new file mode 100644
index 0000000000..55a93c9de2
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-comments.component.ts
@@ -0,0 +1,104 @@
+/*!
+ * @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, Input, OnInit, OnChanges, ViewChild } from '@angular/core';
+import { AlfrescoTranslationService, AlfrescoAuthenticationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core';
+import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
+import { Comment } from '../models/comment.model';
+
+declare let componentHandler: any;
+declare let __moduleName: string;
+
+@Component({
+ selector: 'activiti-comments',
+ moduleId: __moduleName,
+ templateUrl: './activiti-comments.component.html',
+ styleUrls: ['./activiti-comments.component.css'],
+ providers: [ActivitiTaskListService],
+ pipes: [ AlfrescoPipeTranslate ]
+
+})
+export class ActivitiComments implements OnInit, OnChanges {
+
+ @Input()
+ taskId: string;
+
+ @ViewChild('dialog')
+ dialog: any;
+
+ comments: Comment [] = [];
+
+ /**
+ * Constructor
+ * @param auth
+ * @param translate
+ */
+ constructor(private auth: AlfrescoAuthenticationService,
+ private translate: AlfrescoTranslationService,
+ private activitiTaskList: ActivitiTaskListService) {
+
+ if (translate) {
+ translate.addTranslationFolder('node_modules/ng2-activiti-tasklist');
+ }
+ }
+
+ ngOnInit() {
+ if (this.taskId) {
+ this.load(this.taskId);
+ }
+ }
+
+ ngOnChanges(change) {
+ this.load(this.taskId);
+ }
+
+ public load(taskId: string) {
+ if (this.taskId) {
+ this.activitiTaskList.getTaskComments(this.taskId).subscribe(
+ (res: Comment[]) => {
+ this.comments = res;
+ }
+ );
+ } else {
+ this.comments = [];
+ }
+ }
+
+ public showDialog() {
+ if (this.dialog) {
+ this.dialog.nativeElement.showModal();
+ }
+ }
+
+ public add() {
+ alert('add comment');
+ if (this.taskId) {
+ this.activitiTaskList.addTaskComment(this.taskId, 'test comment').subscribe(
+ (res: Comment[]) => {
+ this.comments = res;
+ }
+ );
+ }
+ this.cancel();
+ }
+
+ public cancel() {
+ if (this.dialog) {
+ this.dialog.nativeElement.close();
+ }
+ }
+}
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.css b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.css
new file mode 100644
index 0000000000..6979275ee7
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.css
@@ -0,0 +1,11 @@
+:host {
+ width: 100%;
+}
+
+.activiti-label {
+ color: rgb(255,152,0);
+}
+
+.material-icons:hover {
+ color: rgb(255, 152, 0);
+}
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.html b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.html
new file mode 100644
index 0000000000..f5fe224419
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.html
@@ -0,0 +1,19 @@
+{{ 'TASK_DETAILS.LABELS.PEOPLE' | translate }}
+
add
+
+ Add a people
+
+
0">
+
+
+
+ face
+ {{user.firstName}}
+
+
+
+
+
+ {{ 'TASK_DETAILS.PEOPLE.NONE' | translate }}
+
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.component.ts
new file mode 100644
index 0000000000..46bcc4a2c6
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-people.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 { Component, Input, OnInit } from '@angular/core';
+import { AlfrescoTranslationService, AlfrescoAuthenticationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core';
+import { User } from '../models/user.model';
+
+declare let componentHandler: any;
+declare let __moduleName: string;
+
+@Component({
+ selector: 'activiti-people',
+ moduleId: __moduleName,
+ templateUrl: './activiti-people.component.html',
+ styleUrls: ['./activiti-people.component.css'],
+ pipes: [ AlfrescoPipeTranslate ]
+
+})
+export class ActivitiPeople implements OnInit {
+
+ @Input()
+ people: User [] = [];
+
+ /**
+ * Constructor
+ * @param auth
+ * @param translate
+ */
+ constructor(private auth: AlfrescoAuthenticationService,
+ private translate: AlfrescoTranslationService) {
+
+ if (translate) {
+ translate.addTranslationFolder('node_modules/ng2-activiti-tasklist');
+ }
+ }
+
+ ngOnInit() {
+
+ }
+
+}
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.html b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.html
index 371288afe5..8963833316 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.html
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.html
@@ -3,12 +3,17 @@
{{taskDetails.name}}
+
-
Assignee: {{taskDetails.assignee.lastName}}
-
Due: {{taskDetails.dueDate}}
-
Due: No due date
-
Form: {{taskForm?.name}}
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts
index a82f962ae5..7acaf89fb4 100644
--- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts
@@ -18,7 +18,12 @@
import { Component, Input, OnInit, OnChanges } from '@angular/core';
import { AlfrescoTranslationService, AlfrescoAuthenticationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core';
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
+import { ActivitiTaskHeader } from './activiti-task-header.component';
+import { ActivitiComments } from './activiti-comments.component';
+import { ActivitiChecklist } from './activiti-checklist.component';
+import { ActivitiPeople } from './activiti-people.component';
import { TaskDetailsModel } from '../models/task-details.model';
+import { User } from '../models/user.model';
import { ActivitiForm, FormModel, FormService } from 'ng2-activiti-form';
@@ -30,8 +35,8 @@ declare let __moduleName: string;
moduleId: __moduleName,
templateUrl: './activiti-task-details.component.html',
styleUrls: ['./activiti-task-details.component.css'],
- providers: [ActivitiTaskListService, FormService],
- directives: [ActivitiForm],
+ providers: [ ActivitiTaskListService, FormService ],
+ directives: [ ActivitiTaskHeader, ActivitiPeople, ActivitiComments, ActivitiChecklist, ActivitiForm ],
pipes: [ AlfrescoPipeTranslate ]
})
@@ -44,6 +49,8 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
taskForm: FormModel;
+ taskPeople: User[] = [];
+
/**
* Constructor
* @param auth
@@ -76,16 +83,15 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
loadDetails(id: string) {
this.taskForm = null;
+ this.taskPeople = [];
if (id) {
this.activitiTaskList.getTaskDetails(id).subscribe(
(res: TaskDetailsModel) => {
this.taskDetails = res;
- if (this.taskDetails && this.taskDetails.formKey) {
- this.activitiForm.getTaskForm(this.taskDetails.id).subscribe(
- (response) => {
- this.taskForm = response;
- }
- );
+ if (this.taskDetails && this.taskDetails.involvedPeople) {
+ this.taskDetails.involvedPeople.forEach((user) => {
+ this.taskPeople.push(new User(user.id, user.email, user.firstName, user.lastName));
+ });
}
console.log(this.taskDetails);
}
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.css b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.css
new file mode 100644
index 0000000000..61bded3cfd
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.css
@@ -0,0 +1,7 @@
+:host {
+ width: 100%;
+}
+
+.activiti-label {
+ color: rgb(255,152,0);
+}
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.html b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.html
new file mode 100644
index 0000000000..c098c1d8c3
--- /dev/null
+++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-header.component.html
@@ -0,0 +1,18 @@
+