mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
code style fixes
This commit is contained in:
@@ -151,11 +151,11 @@ export class FormFieldModel extends FormWidgetModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateForm() {
|
updateForm() {
|
||||||
|
if (this.type === 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> }
|
||||||
*/
|
*/
|
||||||
if (this.type === FormFieldTypes.DROPDOWN) {
|
|
||||||
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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user