mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Code fixes
This commit is contained in:
@@ -131,7 +131,7 @@ export class FormFieldModel extends FormWidgetModel {
|
|||||||
updateForm() {
|
updateForm() {
|
||||||
|
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case FormFieldTypes.DROPDOWN: {
|
case FormFieldTypes.DROPDOWN:
|
||||||
/*
|
/*
|
||||||
This is needed due to Activiti reading dropdown values as string
|
This is needed due to Activiti reading dropdown values as string
|
||||||
but saving back as object: { id: <id>, name: <name> }
|
but saving back as object: { id: <id>, name: <name> }
|
||||||
@@ -144,8 +144,8 @@ export class FormFieldModel extends FormWidgetModel {
|
|||||||
this.form.values[this.id] = entry[0];
|
this.form.values[this.id] = entry[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
break;
|
||||||
case FormFieldTypes.RADIO_BUTTONS: {
|
case FormFieldTypes.RADIO_BUTTONS:
|
||||||
/*
|
/*
|
||||||
This is needed due to Activiti issue related to reading radio button values as value string
|
This is needed due to Activiti issue related to reading radio button values as value string
|
||||||
but saving back as object: { id: <id>, name: <name> }
|
but saving back as object: { id: <id>, name: <name> }
|
||||||
@@ -156,19 +156,18 @@ export class FormFieldModel extends FormWidgetModel {
|
|||||||
} else if (this.options.length > 0) {
|
} else if (this.options.length > 0) {
|
||||||
this.form.values[this.id] = this.options[0];
|
this.form.values[this.id] = this.options[0];
|
||||||
}
|
}
|
||||||
} break;
|
break;
|
||||||
case FormFieldTypes.UPLOAD: {
|
case FormFieldTypes.UPLOAD:
|
||||||
if (this.value && this.value.length > 0) {
|
if (this.value && this.value.length > 0) {
|
||||||
this.form.values[this.id] = `${this.value[0].id}`;
|
this.form.values[this.id] = `${this.value[0].id}`;
|
||||||
} else {
|
} else {
|
||||||
this.form.values[this.id] = null;
|
this.form.values[this.id] = null;
|
||||||
}
|
}
|
||||||
} break;
|
break;
|
||||||
default: {
|
default:
|
||||||
if (!FormFieldTypes.isReadOnlyType(this.type)) {
|
if (!FormFieldTypes.isReadOnlyType(this.type)) {
|
||||||
this.form.values[this.id] = this.value;
|
this.form.values[this.id] = this.value;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user