@capillarytech/creatives-library 8.0.25 → 8.0.27

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": "8.0.25",
4
+ "version": "8.0.27",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -46,7 +46,6 @@ import { v2SmsCreateSagas } from '../Sms/Create/sagas';
46
46
  import { v2EbillSagas } from '../Ebill/sagas';
47
47
  import { v2EmailDuplicateTemplateSaga } from '../Email/sagas';
48
48
  import { v2LineContainerSagas } from '../Line/Container/sagas'
49
- import { v2ZaloSagas } from '../Zalo/saga';
50
49
  import { v2MobilePushCreateSagas } from '../MobilePush/Create/sagas';
51
50
  import { v2WechatMapTemplatesSagas } from '../WeChat/MapTemplates/sagas';
52
51
  import { v2RcsSagas } from '../Rcs/sagas';
@@ -616,7 +615,6 @@ const withEmailSaga = injectSaga({ key: 'email', saga: v2EmailDuplicateTemplateS
616
615
  const withLineContainerSaga = injectSaga({ key: 'lineCreate', saga: v2LineContainerSagas });
617
616
  const withMobilePushCreateSaga = injectSaga({ key: 'mobileCreate', saga: v2MobilePushCreateSagas });
618
617
  const withWechatMapTemplatesSaga = injectSaga({ key: 'weChatMapTemplate', saga: v2WechatMapTemplatesSagas });
619
- const withZaloSaga = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
620
618
  const withRcsSaga = injectSaga({ key: 'rcs', saga: v2RcsSagas });
621
619
  const withInAppSaga = injectSaga({ key: 'inapp', saga: v2InAppSagas });
622
620
  const withViberSaga = injectSaga({ key: 'viber', saga: v2ViberSagas });
@@ -630,7 +628,6 @@ export default compose(
630
628
  withMobilePushCreateSaga,
631
629
  withWechatMapTemplatesSaga,
632
630
  withRcsSaga,
633
- withZaloSaga,
634
631
  withInAppSaga,
635
632
  withViberSaga,
636
633
  withFacebookSaga,
@@ -448,7 +448,7 @@ export class Creatives extends React.Component {
448
448
  } = {},
449
449
  } = templateData;
450
450
  const mediaParams = {};
451
- const { url = '', previewUrl = '', docParams = {}, footer = '', headerVarMapped = {}, headerTemplate = ''} = whatsappMedia;
451
+ const { url = '', previewUrl = '', docParams = {}, footer = '', headerVarMapped = {}, headerTemplate = ''} = whatsappMedia || {};
452
452
  switch (mediaType) {
453
453
  case (WHATSAPP_MEDIA_TYPES.IMAGE):
454
454
  mediaParams.imageUrl = url;
@@ -122,11 +122,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
122
122
  const { id: selectedWeChatAccountId } = editSelectedWeChatAccount || {};
123
123
  const { definition } = templateDetails || {};
124
124
  const { accountId: templateAccountId } = definition || {};
125
- const { Edit: nextEdit } = nextProps || {};
125
+ const { Templates: nextTemplates, Edit: nextEdit } = nextProps || {};
126
126
  if (isEmbeddedEditOrPreview(queryType, creativesMode)) {
127
127
  selectedWeChatAccount = !_.isEmpty(editSelectedWeChatAccount)
128
128
  ? editSelectedWeChatAccount
129
- : nextEdit?.selectedWeChatAccount;
129
+ : nextTemplates?.selectedWeChatAccount;
130
130
  } else if (!_.isEmpty(Templates?.selectedWeChatAccount)) {
131
131
  selectedWeChatAccount = Templates?.selectedWeChatAccount;
132
132
  }
@@ -159,11 +159,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
159
159
  ) {
160
160
  this.setMobilePushAccountOptions(nextEdit?.weCrmAccounts, templateAccountId);
161
161
  }
162
- if (!_.isEmpty(nextEdit?.selectedWeChatAccount) && !_.isEqual(editSelectedWeChatAccount, nextEdit?.selectedWeChatAccount) && (queryType === EMBEDDED) && this.props.location.query.module === "loyalty") {
162
+ if (!_.isEmpty(nextTemplates?.selectedWeChatAccount) && !_.isEqual(editSelectedWeChatAccount, nextEdit?.selectedWeChatAccount) && (queryType === EMBEDDED) && this.props.location.query.module === "loyalty") {
163
163
  const params = {
164
164
  name: '',
165
165
  sortBy: 'Most Recent',
166
- accountId: nextEdit?.selectedWeChatAccount?.id,
166
+ accountId: nextTemplates?.selectedWeChatAccount?.id,
167
167
  };
168
168
  this.props.actions.getMobilepushTemplatesList('mobilepush', params);
169
169
  }
@@ -174,8 +174,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
174
174
  if (nextProps.location.query.module !== 'loyalty' && templateId && templateId !== 'temp') {
175
175
  this.props.actions.getTemplateDetails(templateId);
176
176
  }
177
- const type = this.props.location.query.type;
178
- if (type === 'embedded' && templateId === 'temp' && _.isEmpty(this.state.formData)) { // when his.props.params.id is temp that means mobile push template content will be passed from post message from parent with startTemplateCreation action
177
+ if (queryType === EMBEDDED && templateId === 'temp' && _.isEmpty(this.state.formData)) { // when his.props.params.id is temp that means mobile push template content will be passed from post message from parent with startTemplateCreation action
179
178
  const response = {
180
179
  action: 'startTemplateCreation',
181
180
  };
@@ -183,12 +182,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
183
182
  this.getTags();
184
183
  }
185
184
  });
186
- if (this.props.location.query.type === 'embedded') {
185
+ if (queryType === EMBEDDED) {
187
186
  this.showNext();
188
187
  }
189
188
  }
190
189
  if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && nextProps.Edit.mobilepushTemplates && !_.isEqual(nextProps.Edit.mobilepushTemplates, this.props.Edit.mobilepushTemplates)) { //used inloyalty
191
- if (nextProps.location.query.type === 'embedded' && nextProps.location.query.module === 'loyalty') {
190
+ if (nextProps.location.query.type === EMBEDDED && nextProps.location.query.module === 'loyalty') {
192
191
  this.setTemplateOptions(nextProps.Edit.mobilepushTemplates);
193
192
  }
194
193
  }
@@ -52,6 +52,7 @@ import injectSaga from '../../utils/injectSaga';
52
52
  import injectReducer from '../../utils/injectReducer';
53
53
  import * as globalActions from '../Cap/actions';
54
54
  import v2ZaloReducer from './reducer';
55
+ import { v2ZaloSagas } from './saga';
55
56
 
56
57
  export const Zalo = (props) => {
57
58
  const {
@@ -505,6 +506,7 @@ const mapDispatchToProps = (dispatch) => ({
505
506
 
506
507
 
507
508
  const withReducer = injectReducer({ key: 'zalo', reducer: v2ZaloReducer });
509
+ const withZaloSaga = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
508
510
 
509
511
  export default withCreatives({
510
512
  WrappedComponent: Zalo,
@@ -512,4 +514,5 @@ export default withCreatives({
512
514
  mapDispatchToProps,
513
515
  userAuth: true,
514
516
  reducers: [withReducer],
517
+ sagas: [withZaloSaga],
515
518
  });