code style fixes

This commit is contained in:
Denys Vuika
2016-07-26 16:05:25 +01:00
parent 9a0a5caddd
commit abe9477b86

View File

@@ -151,11 +151,11 @@ export class FormFieldModel extends FormWidgetModel {
}
updateForm() {
if (this.type === FormFieldTypes.DROPDOWN) {
/*
This is needed due to Activiti reading dropdown values as string
but saving back as object: { id: <id>, name: <name> }
*/
if (this.type === FormFieldTypes.DROPDOWN) {
if (this.value === 'empty' || this.value === '') {
this.form.values[this.id] = {};
} else {
@@ -164,21 +164,18 @@ export class FormFieldModel extends FormWidgetModel {
this.form.values[this.id] = entry[0];
}
}
}
} else if (this.type === FormFieldTypes.RADIO_BUTTONS) {
/*
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> }
*/
else if (this.type === FormFieldTypes.RADIO_BUTTONS) {
let entry: FormFieldOption[] = this.options.filter(opt => opt.id === this.value);
if (entry.length > 0) {
this.form.values[this.id] = entry[0];
} else if (this.options.length > 0) {
this.form.values[this.id] = this.options[0].id;
}
}
// default value resolver
else {
} else {
this.form.values[this.id] = this.value;
}
}
@@ -206,13 +203,12 @@ export class ContainerModel extends FormWidgetModel {
params: FormFieldMetadata = {};
columns: ContainerColumnModel[] = [];
isExpanded: boolean = true;
isGroup(): boolean {
return this.type == FormFieldTypes.GROUP;
return this.type === FormFieldTypes.GROUP;
}
isExpanded: boolean = true;
isCollapsible(): boolean {
let allowCollapse = false;