@capillarytech/creatives-library 7.17.121-alpha.0 → 7.17.121

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": "7.17.121-alpha.0",
4
+ "version": "7.17.121",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1442,14 +1442,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1442
1442
  return formData;
1443
1443
  }
1444
1444
 
1445
- /**
1446
- * Initializes the form with the given schema.
1447
- *
1448
- * @param {Object} schema - The schema object for the form.
1449
- * @param {boolean} makeFormEmpty - Flag indicating whether to make the form empty.
1450
- * @param {boolean} resetTabKeys - Flag indicating whether to reset tab keys.
1451
- * @returns {void}
1452
- */
1453
1445
  initialiseForm(schema, makeFormEmpty, resetTabKeys) {
1454
1446
  let formData = makeFormEmpty ? {} : _.cloneDeep(this.state.formData);
1455
1447
  let errorData = {};
@@ -1479,13 +1471,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1479
1471
  }
1480
1472
  }
1481
1473
  const tempFormData = _.cloneDeep(formData);
1482
- // Store the value of 'template-name' before the deletion process
1483
- const templateNameValue = tempFormData['template-name'];
1484
1474
  if (!this.props.isNewVersionFlow) {
1485
1475
  _.forEach(formData, (element, key) => {
1486
- // This code block is used to clean up the tempFormData object.
1487
- // If the element is not an object and the key of the element is not found in the formElements array,
1488
- // then the element is removed from the tempFormData object.
1489
1476
  if (typeof element !== 'object' && this.formElements.indexOf(key) === -1) {
1490
1477
  delete tempFormData[key];
1491
1478
  } else if (typeof element === "object") {
@@ -1495,15 +1482,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1495
1482
  }
1496
1483
  });
1497
1484
  }
1498
- // If the element is an object, it iterates over its properties (innerElement).
1499
- // If the property key (innerKey) is not "tabKey", "base", "name", "imagePreview", "image"
1500
- // and is not found in the formElements array, then the property is removed from the object in tempFormData.
1501
1485
  });
1502
1486
  }
1503
- // If 'template-name' was deleted, re-add it to tempFormData for mobilepush channel
1504
- if (!Object.prototype.hasOwnProperty.call(tempFormData, 'template-name') && this.props.schema.channel.toUpperCase() === MOBILE_PUSH) {
1505
- tempFormData['template-name'] = templateNameValue;
1506
- }
1507
1487
  formData = _.cloneDeep(tempFormData);
1508
1488
  this.setState({formData, errorData}, () => {
1509
1489
  this.validateForm();
@@ -647,7 +647,7 @@ export const Viber = (props) => {
647
647
  return true;
648
648
  }
649
649
  //if template title is empty
650
- if (messageTitle?.trim() === '') {
650
+ if (isFullMode && messageTitle?.trim() === '') {
651
651
  return true;
652
652
  }
653
653
  // if media type is image/video than image/video should be uploaded