mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
#440 ability to 'complete' task forms
- show ‘complete’ button when no custom outcomes present - save and complete task form
This commit is contained in:
@@ -81,8 +81,14 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
if (outcome.id === '$save') {
|
||||
return this.saveTaskForm();
|
||||
}
|
||||
|
||||
if (outcome.id === '$complete') {
|
||||
return this.completeTaskForm();
|
||||
}
|
||||
|
||||
} else {
|
||||
alert(`Outcome clicked: ${outcome.name}`);
|
||||
}
|
||||
alert(`Outcome clicked: ${outcome.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +114,17 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
);
|
||||
}
|
||||
|
||||
private completeTaskForm() {
|
||||
let form = {
|
||||
values: this.form.values
|
||||
};
|
||||
this.formService.completeTaskForm(this.form.taskId, form).subscribe(
|
||||
(response) => {
|
||||
console.log(response);
|
||||
alert('Saved');
|
||||
},
|
||||
(err) => window.alert(err)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user