@capillarytech/creatives-library 7.13.18 → 7.13.20

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.
@@ -455,9 +455,10 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
455
455
  getFormData(e) {
456
456
 
457
457
  const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.WeChat.selectedWeChatAccount);
458
+ const base = this.state?.editTemplateData?.versions?.base;
458
459
  const data = {
459
- template_id: this.state.editTemplateData.versions.base.template_id,
460
- Title: this.state.editTemplateData.versions.base.Title,
460
+ template_id: _.get(base, 'template_id'),
461
+ Title: _.get(base, 'Title'),
461
462
  Tag: [],
462
463
  TopColor: "#000000",
463
464
  data: {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.13.18",
4
+ "version": "7.13.20",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -217,7 +217,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
217
217
  this.setState({tabKey});
218
218
  }
219
219
  this.setState({formData: nextProps.formData, currentLangTab}, () => {
220
- if (nextProps.isNewVersionFlow && !this.state.formData[this.state.currentTab - 1][this.state.formData[this.state.currentTab - 1].activeTab].tabKey) {
220
+ if (nextProps.isNewVersionFlow && !this.state.formData[this.state.currentTab - 1][this.state.formData[this.state.currentTab - 1].activeTab]?.tabKey) {
221
221
  this.resetTabKeys(nextProps.formData, nextProps.tabCount, false, true);
222
222
  }
223
223
  if (type === 'embedded' || ( this.props.schema.channel && this.props.schema.channel.toUpperCase() === 'EMAIL')) {
@@ -887,8 +887,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
887
887
  const cardDataList = filteredTemplates && filteredTemplates.length ? map(filteredTemplates, (template) => {
888
888
  const templateData =
889
889
  {
890
- key: `${currentChannel}-card-${template.name}`,
891
- title: <span title={template.name} >{template.name}</span>,
890
+ key: `${currentChannel}-card-${template?.name}`,
891
+ title: <span title={template?.name} >{template?.name}</span>,
892
892
  extra: [
893
893
  <CapIcon
894
894
  className={`view-${channelLowerCase}`}
@@ -1070,7 +1070,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1070
1070
  const { whatsappImageSrc = '', templateMsg} = getWhatsappContent(template);
1071
1071
  templateData.title = (
1072
1072
  <CapRow>
1073
- <CapLabel className="whatsapp-rcs-template-name">{template.name}</CapLabel>
1073
+ <CapLabel className="whatsapp-rcs-template-name">{template?.name}</CapLabel>
1074
1074
  <WhatsappStatusContainer template={template} />
1075
1075
  </CapRow>
1076
1076
  );
@@ -1094,7 +1094,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1094
1094
  break;
1095
1095
  }
1096
1096
  case RCS: {
1097
- templateData.title = <CapLabel className="whatsapp-rcs-template-name">{template.name}</CapLabel>;
1097
+ templateData.title = <CapLabel className="whatsapp-rcs-template-name">{template?.name}</CapLabel>;
1098
1098
  templateData.content = getRCSContent(template);
1099
1099
  break;
1100
1100
  }
@@ -1610,7 +1610,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1610
1610
 
1611
1611
  duplicateTemplate(template) {
1612
1612
  const duplicateObj = cloneDeep(template);
1613
- duplicateObj.name = `Copy of ${template.name} ${moment().format('MM-DD-YYYY HH:mm:ss')}`;
1613
+ duplicateObj.name = `Copy of ${template?.name} ${moment().format('MM-DD-YYYY HH:mm:ss')}`;
1614
1614
  delete duplicateObj._id;
1615
1615
 
1616
1616
  if (this.state.channel.toLowerCase() === "mobilepush") {
@@ -1953,7 +1953,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1953
1953
  <div className="card-title">
1954
1954
  <span className="template-name" style={{ fontWeight: `${this.state.channel.toLowerCase() === 'wechat' ? '400' : '600'}` }}>
1955
1955
  { template && template.versions && template.versions.history && template.versions.history.length > 1 && this.state.channel.toLowerCase() !== 'mobilepush' && <i style={{fontSize: '16px', margin: '0 8px 0 0', verticalAlign: 'middle'}} className="material-icons">filter_none</i>}
1956
- {template.name}
1956
+ {template?.name}
1957
1957
  </span>
1958
1958
  {this.props.location.query.type !== 'embedded' && <CapPopover
1959
1959
  trigger="click"