@capillarytech/creatives-library 2.0.63 → 2.0.64

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.
@@ -3074,7 +3074,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
3074
3074
  const currentLang = this.state.formData[this.state.currentTab - 1].selectedLanguages[index];
3075
3075
  paneTabKey = this.state.formData[this.state.currentTab - 1] && this.state.formData[this.state.currentTab - 1][currentLang] && this.state.formData[this.state.currentTab - 1][currentLang].tabKey;
3076
3076
  }
3077
- if (pane.isSupported) {
3077
+ const isPaneSupported = typeof pane.isSupported === "boolean" ? pane.isSupported : true; // pane.isSupported field exists only in mpush schema, in other channels it is not
3078
+ if (isPaneSupported) {
3078
3079
  renderedPanes.push(
3079
3080
  <TabPane
3080
3081
  forceRender
@@ -177,7 +177,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
177
177
  onFormDataChange = (formData, tabCount) => {
178
178
  const newFormData = cloneDeep(formData);
179
179
  const {templateCta} = this.state;
180
- if (templateCta) {
180
+ if (!isEmpty(templateCta)) {
181
181
  newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-label`] = templateCta.name;
182
182
  newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action`] = templateCta.ctaTemplateDetails[0].buttonText;
183
183
  delete newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action2`];
@@ -227,7 +227,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
227
227
  console.log('Form data changed is ', formData, tabCount, currentTab);
228
228
  const newFormData = _.cloneDeep(formData);
229
229
  const {templateCta} = this.state;
230
- if (templateCta) {
230
+ if (!_.isEmpty(templateCta)) {
231
231
  newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-label`] = templateCta.name;
232
232
  newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action`] = templateCta.ctaTemplateDetails[0].buttonText;
233
233
  delete newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action2`];
@@ -770,7 +770,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
770
770
 
771
771
  getSchemaForFormData = (formdata, inputSchema) => {
772
772
  let schema = inputSchema;
773
- const formData = _.cloneDeep(formData);
773
+ const formData = _.cloneDeep(formdata);
774
774
  if (!_.isEmpty(formData[0])) {
775
775
  if (formData[0]['cta-deeplink']) {
776
776
  formData[0]['add-pri-cta'] = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.63",
4
+ "version": "2.0.64",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",