mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
e1d5ef6ee9
commit
8330ed2879
@@ -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') {
|
||||
|
Reference in New Issue
Block a user