Fix start process form (#4847)

This commit is contained in:
Maurizio Vitale
2019-06-13 18:21:33 +01:00
committed by GitHub
parent c44c2eae77
commit 819ed9ae6a
7 changed files with 206 additions and 129 deletions

View File

@@ -20,7 +20,7 @@ import {
Output, SimpleChanges, OnDestroy
} from '@angular/core';
import { Observable, of, forkJoin, Subject } from 'rxjs';
import { switchMap, takeUntil } from 'rxjs/operators';
import { switchMap, takeUntil, map } from 'rxjs/operators';
import { Subscription } from 'rxjs';
import {
FormBaseComponent,
@@ -206,7 +206,13 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
getFormById(appName: string, formId: string) {
this.formCloudService
.getForm(appName, formId)
.pipe(takeUntil(this.onDestroy$))
.pipe(
map((form: any) => {
const flattenForm = {...form.formRepresentation, ...form.formRepresentation.formDefinition};
delete flattenForm.formDefinition;
return flattenForm;
}),
takeUntil(this.onDestroy$))
.subscribe(
(form) => {
const parsedForm = this.parseForm(form);