[ACA-3881] Able to start form with preselected ACS nodes (#6700)

* Move the node to ps before loading

* Add unit test on start process with preseleted nodes

* Fix unit test

* Wrap calls and improve if

* Add type
This commit is contained in:
Maurizio Vitale
2021-02-19 13:25:03 +00:00
committed by GitHub
parent e96617a676
commit 75f011292e
6 changed files with 261 additions and 17 deletions

View File

@@ -127,6 +127,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
isProcessDefinitionsLoading = true;
isAppsLoading = true;
movedNodeToPS: FormValues;
private onDestroy$ = new Subject<boolean>();
constructor(private activitiProcess: ProcessService,
@@ -364,7 +365,9 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
const currentValue = Array.isArray(this.values[key]) ? this.values[key] : [this.values[key]];
const contents = currentValue.filter((value: any) => value && value.isFile)
.map((content: MinimalNode) => this.activitiContentService.applyAlfrescoNode(content, null, accountIdentifier));
forkJoin(contents).subscribe((res: RelatedContentRepresentation[]) => this.values[key] = [...res] );
forkJoin(contents).subscribe((res: RelatedContentRepresentation[]) => {
this.movedNodeToPS = { [key]: [...res]};
});
}
}
}