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