@capillarytech/creatives-library 8.0.8 → 8.0.9

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.
@@ -45,7 +45,7 @@ export function* getTemplateDetails(id) {
45
45
  export function* getAllAssets(assetType, queryParams) {
46
46
  try {
47
47
  const result = yield call(Api.getAllAssets, assetType, queryParams);
48
- yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result.data.response, isReset: assetType.queryParams.page === 1 });
48
+ yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result?.response, isReset: assetType.queryParams.page === 1 });
49
49
  } catch (error) {
50
50
  yield put({ type: types.GET_ALL_ASSETS_FAILURE, error });
51
51
  }
@@ -63,4 +63,10 @@ export function* createMPushSaga() {
63
63
  watchUploadAsset(),
64
64
  watchGetIosCtas(),
65
65
  ]);
66
+ }
67
+
68
+ export function* duplicateMPushSaga() {
69
+ yield all([
70
+ watchCreateTemplate(),
71
+ ]);
66
72
  }
@@ -56,6 +56,7 @@ import mobilePushCreateReducer from '../MobilePush/Create/reducer';
56
56
  import lineCreateReducer from '../Line/Create/reducer';
57
57
  import { ebillSaga } from '../Ebill/sagas';
58
58
  import { lineCreateSaga } from '../Line/Create/sagas';
59
+ import { duplicateMPushSaga } from '../MobilePush/Create/sagas';
59
60
 
60
61
  const MenuItem = Menu.Item;
61
62
  const Option = Select.Option;
@@ -1709,6 +1710,7 @@ const withCreateSmsSaga = injectSaga({ key: 'create', saga: createSmsSaga });
1709
1710
  const withEditSmsSaga = injectSaga({ key: 'edit', saga: editSmsSaga });
1710
1711
  const withEmailSaga = injectSaga({ key: 'email', saga: emailSaga });
1711
1712
  const withEbillSaga = injectSaga({ key: 'ebill', saga: ebillSaga });
1713
+ const withMpushSaga = injectSaga({ key: 'mobileCreate', saga: duplicateMPushSaga });
1712
1714
  const withLineCreateSaga = injectSaga({ key: 'line', saga: lineCreateSaga });
1713
1715
  const withReducer = injectReducer({ key: 'templates', reducer });
1714
1716
  const withMPushCreateReducer = injectReducer({ key: 'mobileCreate', reducer: mobilePushCreateReducer });
@@ -1721,6 +1723,7 @@ export default compose(
1721
1723
  withCreateSmsSaga,
1722
1724
  withEditSmsSaga,
1723
1725
  withEmailSaga,
1726
+ withMpushSaga,
1724
1727
  withEbillSaga,
1725
1728
  withLineCreateSaga,
1726
1729
  withReducer,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.8",
4
+ "version": "8.0.9",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -5,7 +5,7 @@ import * as types from './constants';
5
5
  export function* getAllAssets(assetType, queryParams) {
6
6
  try {
7
7
  const result = yield call(Api.getAllAssets, assetType, queryParams);
8
- yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result.data.response, isReset: assetType.queryParams.page === 1 });
8
+ yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result?.response, isReset: assetType.queryParams.page === 1 });
9
9
  } catch (error) {
10
10
  yield put({ type: types.GET_ALL_ASSETS_FAILURE, error });
11
11
  }
@@ -40,11 +40,13 @@ import RenderRoute from '../../v2Components/RenderRoute';
40
40
  import injectReducer from '../../utils/injectReducer';
41
41
  import injectSaga from '../../utils/injectSaga';
42
42
  import reducer from './reducer';
43
+ import zaloReducer from '../Zalo/reducer';
43
44
  import { v2CapSagas } from './sagas';
44
45
  import { v2SmsCreateSagas } from '../Sms/Create/sagas';
45
46
  import { v2EbillSagas } from '../Ebill/sagas';
46
47
  import { v2EmailDuplicateTemplateSaga } from '../Email/sagas';
47
48
  import { v2LineContainerSagas } from '../Line/Container/sagas'
49
+ import { v2ZaloSagas } from '../Zalo/saga';
48
50
  import { v2MobilePushCreateSagas } from '../MobilePush/Create/sagas';
49
51
  import { v2WechatMapTemplatesSagas } from '../WeChat/MapTemplates/sagas';
50
52
  import { v2RcsSagas } from '../Rcs/sagas';
@@ -606,6 +608,7 @@ function mapDispatchToProps(dispatch) {
606
608
 
607
609
  const withConnect = connect(mapStateToProps, mapDispatchToProps);
608
610
  const withReducer = injectReducer({ key: 'cap', reducer });
611
+ const withZaloReducer = injectReducer({ key: 'zalo', reducer: zaloReducer });
609
612
  const withSaga = injectSaga({ key: 'cap', saga: v2CapSagas });
610
613
  const withSmsCreateSaga = injectSaga({ key: 'create', saga: v2SmsCreateSagas });
611
614
  const withEbillSaga = injectSaga({ key: 'ebill', saga: v2EbillSagas });
@@ -613,6 +616,7 @@ const withEmailSaga = injectSaga({ key: 'email', saga: v2EmailDuplicateTemplateS
613
616
  const withLineContainerSaga = injectSaga({ key: 'lineCreate', saga: v2LineContainerSagas });
614
617
  const withMobilePushCreateSaga = injectSaga({ key: 'mobileCreate', saga: v2MobilePushCreateSagas });
615
618
  const withWechatMapTemplatesSaga = injectSaga({ key: 'weChatMapTemplate', saga: v2WechatMapTemplatesSagas });
619
+ const withZaloSaga = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
616
620
  const withRcsSaga = injectSaga({ key: 'rcs', saga: v2RcsSagas });
617
621
  const withInAppSaga = injectSaga({ key: 'inapp', saga: v2InAppSagas });
618
622
  const withViberSaga = injectSaga({ key: 'viber', saga: v2ViberSagas });
@@ -626,9 +630,11 @@ export default compose(
626
630
  withMobilePushCreateSaga,
627
631
  withWechatMapTemplatesSaga,
628
632
  withRcsSaga,
633
+ withZaloSaga,
629
634
  withInAppSaga,
630
635
  withViberSaga,
631
636
  withFacebookSaga,
632
637
  withReducer,
638
+ withZaloReducer,
633
639
  withConnect,
634
640
  )(injectIntl(Cap));
@@ -431,7 +431,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
431
431
 
432
432
  this.setState({ formData }, () => {
433
433
  const isDragDrop = this.checkBeeEditorAllowedForLibrary() && nextProps.Email.CmsSettings.isDragDrop;
434
- this.hideEdmOptions(isDragDrop);
434
+ //hiding this after entire dom is rendered
435
+ setTimeout(() => {
436
+ this.hideEdmOptions(isDragDrop);
437
+ },0);
435
438
  });
436
439
  }
437
440
  if (nextProps.Email.createTemplateError && !_.isEqual(nextProps.Email.createTemplateError, this.props.Email.createTemplateError)) {
@@ -59,7 +59,7 @@ export function* getTemplateDetails(id) {
59
59
  export function* getAllAssets(assetType, queryParams) {
60
60
  try {
61
61
  const result = yield call(Api.getAllAssets, assetType, queryParams);
62
- yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result.data.response, isReset: assetType.queryParams.page === 1 });
62
+ yield put({ type: types.GET_ALL_ASSETS_SUCCESS, data: result?.response, isReset: assetType.queryParams.page === 1 });
63
63
  } catch (error) {
64
64
  yield put({ type: types.GET_ALL_ASSETS_FAILURE, error });
65
65
  }
@@ -7,7 +7,7 @@ import * as types from './constants';
7
7
  export function* createTemplate({ template, callback }) {
8
8
  let errorMsg;
9
9
  try {
10
- const result = yield call(Api.createLineTemplate, { template });
10
+ const result = yield call(Api.createLineTemplate, template);
11
11
  if (result.status.code >= 400) {
12
12
  errorMsg = result.message;
13
13
  throw errorMsg;
@@ -19,6 +19,8 @@ import CapError from '@capillarytech/cap-ui-library/CapError';
19
19
  import CapCheckbox from '@capillarytech/cap-ui-library/CapCheckbox';
20
20
  import CapInfoNote from '@capillarytech/cap-ui-library/CapInfoNote';
21
21
  import * as globalActions from '../../Cap/actions';
22
+ import injectSaga from '../../../utils/injectSaga';
23
+ import injectReducer from '../../../utils/injectReducer';
22
24
  import {
23
25
  CAP_SPACE_16,
24
26
  CAP_SPACE_12,
@@ -47,7 +49,8 @@ import {
47
49
  ALL,
48
50
  LIBRARY,
49
51
  } from './constants';
50
-
52
+ import v2EditSmsReducer from '../../Sms/Edit/reducer';
53
+ import { v2SmsEditSagas } from '../../Sms/Edit/sagas';
51
54
  let varMap = {};
52
55
  let traiData = {};
53
56
  let tagValidationResponse = {};
@@ -632,9 +635,14 @@ const mapDispatchToProps = (dispatch) => ({
632
635
  globalActions: bindActionCreators(globalActions, dispatch),
633
636
  });
634
637
 
638
+ const withSaga = injectSaga({ key: 'edit', saga: v2SmsEditSagas });
639
+ const withReducer = injectReducer({ key: 'edit', reducer: v2EditSmsReducer });
640
+
635
641
  export default withCreatives({
636
642
  WrappedComponent: SmsTraiEdit,
637
643
  mapStateToProps,
638
644
  mapDispatchToProps,
639
645
  userAuth: true,
646
+ sagas: [withSaga],
647
+ reducers: [withReducer],
640
648
  });
@@ -51,7 +51,6 @@ import TemplatePreview from '../../v2Components/TemplatePreview';
51
51
  import injectSaga from '../../utils/injectSaga';
52
52
  import injectReducer from '../../utils/injectReducer';
53
53
  import * as globalActions from '../Cap/actions';
54
- import { v2ZaloSagas } from './saga';
55
54
  import v2ZaloReducer from './reducer';
56
55
 
57
56
  export const Zalo = (props) => {
@@ -501,7 +500,6 @@ const mapDispatchToProps = (dispatch) => ({
501
500
  });
502
501
 
503
502
 
504
- const withSaga = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
505
503
  const withReducer = injectReducer({ key: 'zalo', reducer: v2ZaloReducer });
506
504
 
507
505
  export default withCreatives({
@@ -509,6 +507,5 @@ export default withCreatives({
509
507
  mapStateToProps,
510
508
  mapDispatchToProps,
511
509
  userAuth: true,
512
- sagas: [withSaga],
513
510
  reducers: [withReducer],
514
511
  });