mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4788] Fix parsing of process variables from APS2 BE (#4972)
This commit is contained in:
committed by
Eugenio Romano
parent
623b484673
commit
964e89f6ef
@@ -375,7 +375,7 @@ export class FormFieldModel extends FormWidgetModel {
|
||||
case FormFieldTypes.UPLOAD:
|
||||
this.form.hasUpload = true;
|
||||
if (this.value && this.value.length > 0) {
|
||||
this.form.values[this.id] = this.value.map((elem) => elem.id).join(',');
|
||||
this.form.values[this.id] = Array.isArray(this.value) ? this.value.map((elem) => elem.id).join(',') : [this.value];
|
||||
} else {
|
||||
this.form.values[this.id] = null;
|
||||
}
|
||||
|
@@ -73,7 +73,6 @@ export class FormCloud extends FormBaseModel {
|
||||
|
||||
if (formData && formData.length > 0) {
|
||||
this.loadData(formData);
|
||||
this.fixIncompatibilityFromPreviousAndNewForm(formData);
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.fields.length; i++) {
|
||||
@@ -114,15 +113,6 @@ export class FormCloud extends FormBaseModel {
|
||||
this.validateForm();
|
||||
}
|
||||
|
||||
fixIncompatibilityFromPreviousAndNewForm(formData) {
|
||||
Object.keys(this.values).forEach( (propertyName) => {
|
||||
const fieldValue = formData.find((value) => { return value.name === propertyName; });
|
||||
if (fieldValue) {
|
||||
this.values[propertyName] = fieldValue.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
hasTabs(): boolean {
|
||||
return this.tabs && this.tabs.length > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user