@capillarytech/creatives-library 2.0.89 → 2.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.89",
4
+ "version": "2.0.90",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1234,15 +1234,23 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1234
1234
 
1235
1235
  initializeStandAloneSections(schema, formDataObj, ifError) {
1236
1236
  let formData = _.cloneDeep(formDataObj);
1237
+ const channel = _.get(this, "props.schema.channel");
1238
+ let isContainer = false;
1239
+ let index = -1;
1240
+ if (channel && channel.toUpperCase() === SMS) {
1241
+ // sms v2 scema does not have any containers section the input ant preview fields are in stand alon section and v1 FormBuilder did not have valiation support for stand alone input fields
1242
+ isContainer = true;
1243
+ index = 0;
1244
+ }
1237
1245
  if (schema.standalone) {
1238
1246
  _.forEach(schema.standalone.sections, (section) => {
1239
1247
  if (section) {
1240
1248
  if (section.type === 'multicols') {
1241
- formData = this.initializeMultiColSection(section, formData, false, -1, ifError);
1249
+ formData = this.initializeMultiColSection(section, formData, isContainer, index, ifError);
1242
1250
  } else if (section.type === 'col-label') {
1243
- formData = this.initializeColLabelSection(section, formData, false, -1, ifError);
1251
+ formData = this.initializeColLabelSection(section, formData, isContainer, index, ifError);
1244
1252
  } else if (section.type === 'parent') {
1245
- formData = this.initializeParentSection(section, formData, false, -1, ifError);
1253
+ formData = this.initializeParentSection(section, formData, isContainer, index, ifError);
1246
1254
  }
1247
1255
  }
1248
1256
  });