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

View File

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

View File

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