mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
* #1426 - added remove checklist feature on task details * #1426 - Improved test for tasklist service * 426 - added component test for deleting a checklist
This commit is contained in:
@@ -44,6 +44,9 @@ export class ActivitiChecklist implements OnInit, OnChanges {
|
||||
@Output()
|
||||
checklistTaskCreated: EventEmitter<TaskDetailsModel> = new EventEmitter<TaskDetailsModel>();
|
||||
|
||||
@Output()
|
||||
checklistTaskDeleted: EventEmitter<string> = new EventEmitter<string>();
|
||||
|
||||
@ViewChild('dialog')
|
||||
dialog: any;
|
||||
|
||||
@@ -129,6 +132,17 @@ export class ActivitiChecklist implements OnInit, OnChanges {
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
public delete(taskId: string) {
|
||||
this.activitiTaskList.deleteTask(taskId).subscribe(
|
||||
() => {
|
||||
this.checklist = this.checklist.filter(check => check.id !== taskId);
|
||||
this.checklistTaskDeleted.emit(taskId);
|
||||
},
|
||||
(err) => {
|
||||
this.logService.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
public cancel() {
|
||||
if (this.dialog) {
|
||||
this.dialog.nativeElement.close();
|
||||
|
Reference in New Issue
Block a user