@capillarytech/creatives-library 6.3.5 → 6.3.7

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.
@@ -163,7 +163,8 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
163
163
  _.forEach(this.props.events, (event, index) => {
164
164
  this.editorInstance.on(index, event);
165
165
  });
166
- if (this.props.channel.toLowerCase() === 'wechat') {
166
+ const channel = _.get(this.props, 'channel', '');
167
+ if (channel === 'wechat') {
167
168
  this.editorInstance.on('blur', this.onFocusOut);
168
169
  _.forEach(this.props.events, (event, index) => {
169
170
  this.editorInstance.on(index, event);
@@ -721,8 +721,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
721
721
  if (this.props.location.query.module === "library" && this.props.templateData) {
722
722
  this.props.templatesActions.resetTemplateData();
723
723
  }
724
- if (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.is_drag_drop) {
725
- this.setState({isDragDrop: true});
724
+ if (!_.isEmpty(this.props.Templates.edmTemplate)) {
725
+ if (this.props.Templates.edmTemplate.versions.base.is_drag_drop) {
726
+ this.setState({isDragDrop: true});
727
+ }
726
728
  if (this.props.params.id) {
727
729
  this.props.actions.getCmsSetting('edm', this.props.Templates.edmTemplate.versions.base.drag_drop_id, 'open', undefined, isEdmSupport);
728
730
  } else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "6.3.5",
4
+ "version": "6.3.7",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -67,7 +67,7 @@ function checkStatus(response) {
67
67
  fatal: true,
68
68
  });
69
69
  }
70
- if ((status >= 200 && status < 300) || response.status === 500) {
70
+ if ((status >= 200 && status < 300) || [500,409,413].includes(response.status)) {
71
71
  return response;
72
72
  }
73
73
  const isLoginPage = window.location.pathname.indexOf('/login') !== -1;
@@ -209,7 +209,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
209
209
  _.forEach(this.props.events, (event, index) => {
210
210
  this.editorInstance.on(index, event);
211
211
  });
212
- const channel = _.get(this.props, 'channel');
212
+ const channel = _.get(this.props, 'channel', '');
213
213
  if (channel && channel.toLowerCase() === 'wechat') {
214
214
  this.editorInstance.on('blur', this.onFocusOut);
215
215
  _.forEach(this.props.events, (event, index) => {
@@ -183,8 +183,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
183
183
  if (this.props.location.query.module === "library" && this.props.templateData) {
184
184
  this.props.templatesActions.resetTemplateData();
185
185
  }
186
- if (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.is_drag_drop) {
187
- this.setState({isDragDrop: true});
186
+ if (!_.isEmpty(this.props.Templates.edmTemplate)) {
187
+ if (this.props.Templates.edmTemplate.versions.base.is_drag_drop) {
188
+ this.setState({isDragDrop: true});
189
+ }
188
190
  if (this.props.params.id) {
189
191
  this.props.actions.getCmsSetting('edm', this.props.Templates.edmTemplate.versions.base.drag_drop_id, 'open', undefined, isEdmSupport);
190
192
  } else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
@@ -7,7 +7,7 @@ export function* createTemplate(template) {
7
7
  let errorMsg;
8
8
  try {
9
9
  const result = yield call(Api.createEmailTemplate, template);
10
- if (result.status.code === 500) {
10
+ if (result.message || result.status.code === 500) {
11
11
  errorMsg = result.message;
12
12
  yield put({ type: types.CREATE_TEMPLATE_FAILURE, errorMsg });
13
13
  } else {