[ADF-3409] [ADF-3413] Standalone task - Attach/Remove forms bugs (#3670)

* Fix 3409 disable button logic
Fix 3413 change the formName based on selected form

* [ADF-3409] fixed missing import

* [ADF-3409] fixed Observable.of in of
This commit is contained in:
Maurizio Vitale
2018-08-10 10:17:19 +01:00
committed by Eugenio Romano
parent e1d5ef6ee9
commit 8330ed2879
8 changed files with 210 additions and 34 deletions

View File

@@ -217,11 +217,34 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
if (taskId && !taskId.currentValue) {
this.reset();
} else if (taskId && taskId.currentValue) {
this.taskFormName = null;
this.loadDetails(taskId.currentValue);
}
}
isStandaloneTask(): boolean {
return !(this.taskDetails && (!!this.taskDetails.processDefinitionId));
}
isStandaloneTaskWithForm(): boolean {
return this.isStandaloneTask() && this.hasFormKey();
}
isStandaloneTaskWithoutForm(): boolean {
return this.isStandaloneTask() && !this.hasFormKey();
}
isFormComponentVisible(): boolean {
return this.hasFormKey() && !this.isShowAttachForm();
}
isTaskStandaloneComponentVisible(): boolean {
return this.isStandaloneTaskWithoutForm() && !this.isShowAttachForm();
}
isShowAttachForm(): boolean {
return this.showAttachForm;
}
/**
* Reset the task details
*/
@@ -232,10 +255,8 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
/**
* Check if the task has a form
*/
hasFormKey(): TaskDetailsModel | string | boolean {
return (this.taskDetails
&& this.taskDetails.formKey
&& this.taskDetails.formKey !== 'null');
hasFormKey(): boolean {
return (this.taskDetails && (!!this.taskDetails.formKey));
}
isTaskActive() {
@@ -272,10 +293,12 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
private loadDetails(taskId: string) {
this.taskPeople = [];
this.readOnlyForm = false;
this.taskFormName = null;
if (taskId) {
this.taskListService.getTaskDetails(taskId).subscribe(
(res: TaskDetailsModel) => {
this.showAttachForm = false;
this.taskDetails = res;
if (this.taskDetails.name === 'null') {