@capillarytech/creatives-library 8.0.44 → 8.0.45

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.
Files changed (53) hide show
  1. package/containers/Cap/sagas.js +15 -10
  2. package/containers/Cap/tests/saga.test.js +10 -9
  3. package/containers/Ebill/sagas.js +3 -1
  4. package/containers/Email/sagas.js +3 -1
  5. package/containers/Line/Create/sagas.js +3 -2
  6. package/containers/Line/Edit/sagas.js +1 -1
  7. package/containers/MobilePush/Create/sagas.js +3 -1
  8. package/containers/MobilePush/Edit/sagas.js +3 -1
  9. package/containers/Sms/Create/sagas.js +3 -1
  10. package/containers/Sms/Edit/sagas.js +3 -1
  11. package/containers/Templates/sagas.js +3 -1
  12. package/containers/WeChat/MapTemplates/sagas.js +3 -1
  13. package/hoc/withCreatives.js +2 -3
  14. package/package.json +1 -1
  15. package/services/api.js +18 -22
  16. package/styles/containers/login/_loginPage.scss +2 -1
  17. package/v2Components/Ckeditor/index.js +2 -4
  18. package/v2Components/NavigationBar/index.js +5 -7
  19. package/v2Containers/Assets/Gallery/sagas.js +1 -1
  20. package/v2Containers/BeeEditor/sagas.js +2 -2
  21. package/v2Containers/CallTask/sagas.js +1 -1
  22. package/v2Containers/Cap/index.js +7 -0
  23. package/v2Containers/Cap/sagas.js +9 -5
  24. package/v2Containers/CapFacebookPreview/sagas.js +4 -2
  25. package/v2Containers/CreativesContainer/index.js +155 -111
  26. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +5 -5
  27. package/v2Containers/Email/sagas.js +4 -2
  28. package/v2Containers/FTP/sagas.js +4 -2
  29. package/v2Containers/Facebook/sagas.js +7 -3
  30. package/v2Containers/InApp/sagas.js +3 -1
  31. package/v2Containers/InApp/tests/sagas.test.js +2 -2
  32. package/v2Containers/LanguageProvider/sagas.js +3 -1
  33. package/v2Containers/Line/Container/index.js +3 -10
  34. package/v2Containers/Line/Container/sagas.js +3 -1
  35. package/v2Containers/MobilePush/Create/index.js +1 -1
  36. package/v2Containers/MobilePush/Create/sagas.js +3 -1
  37. package/v2Containers/MobilePush/Edit/sagas.js +15 -27
  38. package/v2Containers/Rcs/sagas.js +3 -1
  39. package/v2Containers/Sms/Create/sagas.js +3 -1
  40. package/v2Containers/Sms/Edit/index.js +0 -1
  41. package/v2Containers/Sms/Edit/sagas.js +8 -9
  42. package/v2Containers/SmsTrai/Create/sagas.js +3 -1
  43. package/v2Containers/Templates/actions.js +3 -1
  44. package/v2Containers/Templates/index.js +5 -0
  45. package/v2Containers/Templates/reducer.js +6 -6
  46. package/v2Containers/Templates/sagas.js +9 -27
  47. package/v2Containers/TemplatesV2/index.js +0 -8
  48. package/v2Containers/Viber/sagas.js +3 -2
  49. package/v2Containers/WeChat/MapTemplates/sagas.js +14 -23
  50. package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +3 -1
  51. package/v2Containers/Whatsapp/sagas.js +3 -1
  52. package/v2Containers/Zalo/index.js +0 -4
  53. package/v2Containers/Zalo/saga.js +1 -1
@@ -1,27 +1,27 @@
1
- import { take, call, put, takeLatest, cancel, all } from 'redux-saga/effects';
1
+ import {
2
+ call, put, takeLatest, all,
3
+ } from 'redux-saga/effects';
2
4
  import * as Api from '../../../services/api';
3
5
  import * as types from './constants';
4
6
 
5
7
  export function* getDefaultWeChatTemplates(params) {
6
8
  try {
7
-
8
- const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
9
- yield put({ type: types.GET_WECHAT_DEFAULT_TEMPLATES_SUCCESS, data: result.response.unMapped, templateData: result.response.mapped});
9
+ const result = yield call(Api.getAllTemplates, { channel: params.channel, queryParams: params.queryParams });
10
+ yield put({ type: types.GET_WECHAT_DEFAULT_TEMPLATES_SUCCESS, data: result.response.unMapped, templateData: result.response.mapped });
10
11
  } catch (error) {
11
12
  yield put({ type: types.GET_WECHAT_DEFAULT_TEMPLATES_FAILURE, error });
12
13
  }
13
14
  }
14
15
 
15
- export function* createTemplate({template, callback}) {
16
+ export function* createTemplate({ template, callback }) {
16
17
  try {
17
- const result = yield call(Api.createWeChatTemplate, {template});
18
+ const result = yield call(Api.createWeChatTemplate, { template });
18
19
  if (callback) {
19
20
  yield call(callback, result.response);
20
21
  }
21
22
  // const sidebar = result.response.sidebar;
22
23
  yield put({ type: types.CREATE_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '' });
23
24
  } catch (error) {
24
-
25
25
  yield put({ type: types.CREATE_TEMPLATE_FAILURE, error });
26
26
  }
27
27
  }
@@ -30,20 +30,19 @@ export function* fetchWeCrmAccounts() {
30
30
  try {
31
31
  const result = yield call(Api.fetchWeCrmAccounts);
32
32
  yield put({
33
- type: types.GET_WECRM_ACCOUNTS_SUCCESS,
34
- data: result.response,
35
- });
33
+ type: types.GET_WECRM_ACCOUNTS_SUCCESS,
34
+ data: result.response,
35
+ });
36
36
  } catch (error) {
37
37
  yield put({
38
- type: types.GET_WECRM_ACCOUNTS_FAILURE,
39
- data: error,
40
- });
38
+ type: types.GET_WECRM_ACCOUNTS_FAILURE,
39
+ data: error,
40
+ });
41
41
  }
42
42
  }
43
43
 
44
44
  export function* getTemplateDetails(id) {
45
45
  try {
46
-
47
46
  const result = yield call(Api.getTemplateDetails, id);
48
47
  // const sidebar = result.response.sidebar;
49
48
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
@@ -54,26 +53,18 @@ export function* getTemplateDetails(id) {
54
53
 
55
54
  function* watchGetDefaultWechatTemplates() {
56
55
  yield takeLatest(types.GET_WECHAT_DEFAULT_TEMPLATES_REQUEST, getDefaultWeChatTemplates);
57
-
58
-
59
56
  }
60
57
 
61
58
  function* watchCreateTemplate() {
62
59
  yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
63
-
64
-
65
60
  }
66
61
 
67
62
  function* watchFetchWeCrmAccounts() {
68
63
  yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
69
-
70
-
71
64
  }
72
65
 
73
66
  function* watchGetTemplateDetails() {
74
67
  yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
75
-
76
-
77
68
  }
78
69
 
79
70
  // All sagas to be loaded
@@ -91,4 +82,4 @@ export function* v2WechatMapTemplatesSagas() {
91
82
  watchFetchWeCrmAccounts(),
92
83
  watchGetTemplateDetails(),
93
84
  ]);
94
- }
85
+ }
@@ -1,4 +1,6 @@
1
- import { take, cancel, call, put, takeLatest, all } from 'redux-saga/effects';
1
+ import {
2
+ call, put, takeLatest, all,
3
+ } from 'redux-saga/effects';
2
4
  import orderBy from 'lodash/orderBy';
3
5
  import moment from 'moment';
4
6
  import * as Api from '../../../../services/api';
@@ -1,4 +1,6 @@
1
- import { take, cancel, call, put, takeLatest, all } from 'redux-saga/effects';
1
+ import {
2
+ call, put, takeLatest, all,
3
+ } from 'redux-saga/effects';
2
4
  import isEmpty from 'lodash/isEmpty';
3
5
  import get from 'lodash/get';
4
6
  import * as Api from '../../services/api';
@@ -48,11 +48,9 @@ import withCreatives from '../../hoc/withCreatives';
48
48
  import TagList from '../TagList';
49
49
  import { validateTags } from '../../utils/tagValidations';
50
50
  import TemplatePreview from '../../v2Components/TemplatePreview';
51
- import injectSaga from '../../utils/injectSaga';
52
51
  import injectReducer from '../../utils/injectReducer';
53
52
  import * as globalActions from '../Cap/actions';
54
53
  import v2ZaloReducer from './reducer';
55
- import { v2ZaloSagas } from './saga';
56
54
 
57
55
  export const Zalo = (props) => {
58
56
  const {
@@ -506,7 +504,6 @@ const mapDispatchToProps = (dispatch) => ({
506
504
 
507
505
 
508
506
  const withReducer = injectReducer({ key: 'zalo', reducer: v2ZaloReducer });
509
- const withZaloSaga = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
510
507
 
511
508
  export default withCreatives({
512
509
  WrappedComponent: Zalo,
@@ -514,5 +511,4 @@ export default withCreatives({
514
511
  mapDispatchToProps,
515
512
  userAuth: true,
516
513
  reducers: [withReducer],
517
- sagas: [withZaloSaga],
518
514
  });
@@ -42,4 +42,4 @@ export default [watchForGetTemplateInfoById];
42
42
 
43
43
  export function* v2ZaloSagas() {
44
44
  yield all([watchForGetTemplateInfoById()]);
45
- }
45
+ }