Skip to content

Commit 0977d1e

Browse files
fix: Assign custom form name on init (#4507)
New field 'name' was added in custom form and it is populated from backend, so new custom forms in frontend were initialized without any name because the previous logic of loading name as custom property was removed. This is a temporary fix since custom forms will start to be created on backend instead of frontend
1 parent 554e64e commit 0977d1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/models/custom-form.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ export default ModelBase.extend({
8484
ageGroup : 'Age Group'
8585
},
8686

87+
ready() {
88+
if (!this.name) {
89+
this.name = this[this.form][this.fieldIdentifier];
90+
}
91+
},
92+
8793
identifierPath: computed('isComplex', function() {
8894
return !this.isComplex ? this.fieldIdentifier : 'complexFieldValues.' + this.fieldIdentifier;
8995
}),

0 commit comments

Comments
 (0)