Add Complete Task button for tasks with no form

- Allows standalone tasks to be completed

Refs #530
This commit is contained in:
Will Abson
2016-09-22 14:56:52 +01:00
parent faf4d7eeac
commit 23af7f738f
3 changed files with 11 additions and 1 deletions

View File

@@ -33,6 +33,8 @@
(onError)='onErrorEmitter($event)'
(executeOutcome)='executeOutcomeEmitter($event)'
#activitiForm>
</activiti-form>
<button type="button" class="mdl-button" *ngIf="!hasFormKey() && isTaskActive()" (click)="onComplete()">
{{ 'TASK_DETAILS.BUTTON.COMPLETE' | translate }}
</button>
</div>

View File

@@ -133,6 +133,10 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
&& this.taskDetails.formKey !== 'null';
}
isTaskActive() {
return this.taskDetails && this.taskDetails.duration === null;
}
/**
* Load the activiti task details
* @param taskId
@@ -176,6 +180,7 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
this.activitiTaskList.completeTask(this.taskId).subscribe(
(res) => {
console.log(res);
this.formCompleted.emit(res);
}
);
}

View File

@@ -13,6 +13,9 @@
"COMMENTS": "Comments",
"CHECKLIST": "Checklist"
},
"BUTTON": {
"COMPLETE": "Complete"
},
"MESSAGES": {
"NONE": "No task details found."
},