From 0977d1e9a16b9074df45c9ce7a8066ab83d3c116 Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Tue, 30 Jun 2020 19:11:29 +0530 Subject: [PATCH] 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 --- app/models/custom-form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/custom-form.js b/app/models/custom-form.js index 2d9577fee07..d32e144ebae 100644 --- a/app/models/custom-form.js +++ b/app/models/custom-form.js @@ -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; }),