Skip to content

Commit

Permalink
fix: Assign custom form name on init (#4507)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iamareebjamal authored Jun 30, 2020
1 parent 554e64e commit 0977d1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/custom-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ export default ModelBase.extend({
ageGroup : 'Age Group'
},

ready() {
if (!this.name) {
this.name = this[this.form][this.fieldIdentifier];
}
},

identifierPath: computed('isComplex', function() {
return !this.isComplex ? this.fieldIdentifier : 'complexFieldValues.' + this.fieldIdentifier;
}),
Expand Down

1 comment on commit 0977d1e

@vercel
Copy link

@vercel vercel bot commented on 0977d1e Jun 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.