@capillarytech/creatives-library 6.9.2 → 6.9.5

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 (101) hide show
  1. package/components/CapTagList/index.js +1 -1
  2. package/components/Edmeditor/index.js +1 -1
  3. package/components/FormBuilder/index.js +1 -0
  4. package/components/TemplatePreview/_templatePreview.scss +6 -0
  5. package/components/TemplatePreview/index.js +35 -28
  6. package/config/app.js +1 -1
  7. package/containers/TagList/index.js +4 -5
  8. package/index.html +0 -5
  9. package/package.json +1 -2
  10. package/services/api.js +1 -16
  11. package/v2Components/CapTagList/index.js +26 -55
  12. package/v2Components/Carousel/index.js +120 -0
  13. package/v2Components/Carousel/style.scss +40 -0
  14. package/v2Components/CmsTemplatesComponent/index.js +4 -4
  15. package/v2Components/Edmeditor/index.js +1 -1
  16. package/v2Components/EmailPreview/_emailPreview.scss +2 -2
  17. package/v2Components/FormBuilder/index.js +43 -79
  18. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
  19. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
  20. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
  21. package/v2Components/TemplatePreview/_templatePreview.scss +1 -0
  22. package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
  23. package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
  24. package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
  25. package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
  26. package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
  27. package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
  28. package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
  29. package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
  30. package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
  31. package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
  32. package/v2Components/TemplatePreview/index.js +36 -29
  33. package/v2Components/TemplatePreview/tests/index.test.js +10 -10
  34. package/v2Containers/CreativesContainer/SlideBoxContent.js +7 -1
  35. package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
  36. package/v2Containers/CreativesContainer/actions.js +27 -27
  37. package/v2Containers/CreativesContainer/constants.js +17 -17
  38. package/v2Containers/CreativesContainer/index.js +2 -7
  39. package/v2Containers/CreativesContainer/index.scss +44 -44
  40. package/v2Containers/CreativesContainer/messages.js +305 -305
  41. package/v2Containers/CreativesContainer/reducer.js +29 -29
  42. package/v2Containers/CreativesContainer/sagas.js +11 -11
  43. package/v2Containers/CreativesContainer/selectors.js +30 -30
  44. package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
  45. package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
  46. package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
  47. package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
  48. package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
  49. package/v2Containers/Email/constants.js +0 -1
  50. package/v2Containers/Email/index.js +115 -169
  51. package/v2Containers/Email/initialSchema.js +3 -18
  52. package/v2Containers/Email/sagas.js +2 -2
  53. package/v2Containers/Email/selectors.js +0 -5
  54. package/v2Containers/EmailWrapper/index.js +3 -19
  55. package/v2Containers/Line/Container/Image/index.js +21 -19
  56. package/v2Containers/Line/Container/ImageCarousel/Content.js +554 -0
  57. package/v2Containers/Line/Container/ImageCarousel/constants.js +10 -0
  58. package/v2Containers/Line/Container/ImageCarousel/index.js +526 -0
  59. package/v2Containers/Line/Container/ImageCarousel/messages.js +178 -0
  60. package/v2Containers/Line/Container/ImageCarousel/style.js +61 -0
  61. package/v2Containers/Line/Container/ImageMap/constants.js +2 -1
  62. package/v2Containers/Line/Container/ImageMap/index.js +31 -6
  63. package/v2Containers/Line/Container/ImageMap/messages.js +12 -0
  64. package/v2Containers/Line/Container/Wrapper/index.js +5 -1
  65. package/v2Containers/Line/Container/Wrapper/messages.js +4 -0
  66. package/v2Containers/Line/Container/Wrapper/utils.js +15 -16
  67. package/v2Containers/Line/Container/_lineCreate.scss +2 -2
  68. package/v2Containers/Line/Container/actions.js +4 -2
  69. package/v2Containers/Line/Container/constants.js +3 -0
  70. package/v2Containers/Line/Container/index.js +49 -11
  71. package/v2Containers/Line/Container/reducer.js +2 -2
  72. package/v2Containers/Line/Container/sagas.js +2 -2
  73. package/v2Containers/Line/Container/style.js +2 -1
  74. package/v2Containers/TagList/index.js +0 -6
  75. package/v2Containers/Templates/_templates.scss +9 -0
  76. package/v2Containers/Templates/actions.js +117 -122
  77. package/v2Containers/Templates/constants.js +47 -49
  78. package/v2Containers/Templates/index.js +47 -36
  79. package/v2Containers/Templates/messages.js +4 -8
  80. package/v2Containers/Templates/reducer.js +145 -153
  81. package/v2Containers/Templates/sagas.js +179 -179
  82. package/v2Containers/Templates/selectors.js +1 -19
  83. package/v2Containers/Templates/tests/actions.test.js +18 -18
  84. package/v2Containers/Templates/tests/index.test.js +10 -10
  85. package/v2Containers/Templates/tests/reducer.test.js +9 -9
  86. package/v2Containers/Templates/tests/sagas.test.js +15 -15
  87. package/v2Containers/Templates/tests/selectors.test.js +10 -10
  88. package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
  89. package/v2Containers/TemplatesV2/actions.js +16 -16
  90. package/v2Containers/TemplatesV2/constants.js +10 -10
  91. package/v2Containers/TemplatesV2/messages.js +61 -61
  92. package/v2Containers/TemplatesV2/selectors.js +25 -25
  93. package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
  94. package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
  95. package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
  96. package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
  97. package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
  98. package/v2Components/BeeEditor/index.js +0 -272
  99. package/v2Components/BeeEditor/index.scss +0 -11
  100. package/v2Components/BeeEditor/messages.js +0 -47
  101. package/v2Components/BeeEditor/tests/index.test.js +0 -10
@@ -1,122 +1,117 @@
1
- /*
2
- *
3
- * Templates actions
4
- *
5
- */
6
-
7
- import * as types from './constants';
8
-
9
- export function getAllTemplates(channel, queryParams) {
10
- console.log('get all templates action trigereed', channel, queryParams);
11
- return {
12
- type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
13
- };
14
- }
15
-
16
- export function resetTemplate() {
17
- return {
18
- type: types.RESET_TEMPLATE,
19
- };
20
- }
21
-
22
- export function resetAccount() {
23
- return {
24
- type: types.RESET_ACCOUNT,
25
- };
26
- }
27
-
28
- export function deleteTemplate(channel, id) {
29
- console.log('delete template action trigereed', channel, id);
30
- return {
31
- type: types.DELETE_TEMPLATE_REQUEST, channel, id,
32
- };
33
- }
34
-
35
- export function getUserList() {
36
- return {
37
- type: types.GET_USER_LIST_REQUEST,
38
- };
39
- }
40
-
41
- export function getWeCrmAccounts(source) {
42
- return {
43
- type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
44
- };
45
- }
46
-
47
- export function setWeChatAccount(weChatAccount) {
48
- console.log('setting wechat account', weChatAccount);
49
- return {
50
- type: types.SET_WECHAT_ACCOUNT,
51
- weChatAccount,
52
- };
53
- }
54
-
55
- export function setLineAccount(lineAccount) {
56
- return {
57
- type: types.SET_LINE_ACCOUNT,
58
- lineAccount,
59
- };
60
- }
61
-
62
- export function handleHtmlUpload(selectedTemplate) {
63
- return {
64
- type: types.SET_SELECTED_LAYOUT,
65
- selectedTemplate,
66
- };
67
- }
68
-
69
- export function handleZipUpload(selectedFile, successHandler, errorHandler) {
70
- return {
71
- type: types.SEND_ZIPPED_FILE_REQUEST,
72
- selectedFile,
73
- successHandler,
74
- errorHandler,
75
- };
76
- }
77
-
78
- export function getDefaultBeeTemplates() {
79
- return {
80
- type: types.GET_DEAFULT_BEE_TEMPLATES_REQUEST,
81
- };
82
- }
83
-
84
- export function setEdmTemplate(template) {
85
- return {
86
- type: types.SET_EDM_TEMPLATE,
87
- template,
88
- };
89
- }
90
- export function setBEETemplate(template) {
91
- return {
92
- type: types.SET_BEE_TEMPLATE,
93
- template,
94
- };
95
- }
96
- export function getTemplateDetails(id, channel) {
97
- console.log('getting template', id, channel);
98
- return {
99
- type: types.GET_TEMPLATE_DETAILS_REQUEST,
100
- id,
101
- channel,
102
- };
103
- }
104
-
105
- export function resetTemplateData() {
106
- return {
107
- type: types.RESET_TEMPLATE_DATA,
108
- };
109
- }
110
-
111
- export function resetUploadData() {
112
- console.log('clearing upload data');
113
- return {
114
- type: types.RESET_UPLOAD_DATA,
115
- };
116
- }
117
-
118
- export function resetTemplateStoreData() {
119
- return {
120
- type: types.CLEAR_TEMPLATE_STORE_DATA,
121
- };
122
- }
1
+ /*
2
+ *
3
+ * Templates actions
4
+ *
5
+ */
6
+
7
+ import * as types from './constants';
8
+
9
+ export function getAllTemplates(channel, queryParams) {
10
+ console.log('get all templates action trigereed', channel, queryParams);
11
+ return {
12
+ type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
13
+ };
14
+ }
15
+
16
+ export function resetTemplate() {
17
+ return {
18
+ type: types.RESET_TEMPLATE,
19
+ };
20
+ }
21
+
22
+ export function resetAccount() {
23
+ return {
24
+ type: types.RESET_ACCOUNT,
25
+ };
26
+ }
27
+
28
+ export function deleteTemplate(channel, id) {
29
+ console.log('delete template action trigereed', channel, id);
30
+ return {
31
+ type: types.DELETE_TEMPLATE_REQUEST, channel, id,
32
+ };
33
+ }
34
+
35
+ export function getUserList() {
36
+ return {
37
+ type: types.GET_USER_LIST_REQUEST,
38
+ };
39
+ }
40
+
41
+ export function getWeCrmAccounts(source) {
42
+ return {
43
+ type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
44
+ };
45
+ }
46
+
47
+ export function setWeChatAccount(weChatAccount) {
48
+ console.log('setting wechat account', weChatAccount);
49
+ return {
50
+ type: types.SET_WECHAT_ACCOUNT,
51
+ weChatAccount,
52
+ };
53
+ }
54
+
55
+ export function setLineAccount(lineAccount) {
56
+ return {
57
+ type: types.SET_LINE_ACCOUNT,
58
+ lineAccount,
59
+ };
60
+ }
61
+
62
+ export function handleHtmlUpload(selectedTemplate) {
63
+ return {
64
+ type: types.SET_SELECTED_LAYOUT,
65
+ selectedTemplate,
66
+ };
67
+ }
68
+
69
+ export function handleZipUpload(selectedFile, successHandler, errorHandler) {
70
+ return {
71
+ type: types.SEND_ZIPPED_FILE_REQUEST,
72
+ selectedFile,
73
+ successHandler,
74
+ errorHandler,
75
+ };
76
+ }
77
+
78
+ export function getEdmDefaultTemplates() {
79
+ return {
80
+ type: types.GET_EDM_DEAFULT_TEMPLATES_REQUEST,
81
+ };
82
+ }
83
+
84
+ export function setEdmTemplate(template) {
85
+ return {
86
+ type: types.SET_EDM_TEMPLATE,
87
+ template,
88
+ };
89
+ }
90
+
91
+ export function getTemplateDetails(id, channel) {
92
+ console.log('getting template', id, channel);
93
+ return {
94
+ type: types.GET_TEMPLATE_DETAILS_REQUEST,
95
+ id,
96
+ channel,
97
+ };
98
+ }
99
+
100
+ export function resetTemplateData() {
101
+ return {
102
+ type: types.RESET_TEMPLATE_DATA,
103
+ };
104
+ }
105
+
106
+ export function resetUploadData() {
107
+ console.log('clearing upload data');
108
+ return {
109
+ type: types.RESET_UPLOAD_DATA,
110
+ };
111
+ }
112
+
113
+ export function resetTemplateStoreData() {
114
+ return {
115
+ type: types.CLEAR_TEMPLATE_STORE_DATA,
116
+ };
117
+ }
@@ -1,49 +1,47 @@
1
- /*
2
- *
3
- * Templates constants
4
- *
5
- */
6
-
7
- export const DEFAULT_ACTION = 'app/Templates/DEFAULT_ACTION';
8
-
9
- export const GET_ALL_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_REQUEST';
10
- export const GET_ALL_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_SUCCESS';
11
- export const GET_ALL_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_FAILURE';
12
-
13
- export const DELETE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_TEMPLATE_REQUEST';
14
- export const DELETE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/DELETE_TEMPLATE_SUCCESS';
15
- export const DELETE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/DELETE_TEMPLATE_FAILURE';
16
-
17
- export const GET_USER_LIST_REQUEST = "app/v2Containers/GET_USER_LIST_REQUEST";
18
- export const GET_USER_LIST_SUCCESS = "app/v2Containers/GET_USER_LIST_SUCCESS";
19
- export const GET_USER_LIST_FAILURE = "app/v2Containers/GET_USER_LIST_FAILURE";
20
-
21
- export const GET_WECRM_ACCOUNTS_REQUEST = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_REQUEST";
22
- export const GET_WECRM_ACCOUNTS_SUCCESS = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_SUCCESS";
23
- export const GET_WECRM_ACCOUNTS_FAILURE = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_FAILURE";
24
- export const SET_WECHAT_ACCOUNT = "app/v2Containers/Templates/SET_WECHAT_ACCOUNT";
25
-
26
- export const SET_SELECTED_LAYOUT = "app/v2Containers/Templates/SET_SELECTED_LAYOUT";
27
- export const SEND_ZIPPED_FILE_REQUEST = "app/v2Containers/Templates/SEND_ZIPPED_FILE_REQUEST";
28
- export const SEND_ZIPPED_FILE_SUCCESS = "app/v2Containers/Templates/SEND_ZIPPED_FILE_SUCCESS";
29
- export const SEND_ZIPPED_FILE_FAILURE = "app/v2Containers/Templates/SEND_ZIPPED_FILE_FAILURE";
30
-
31
- export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_REQUEST';
32
- export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_SUCCESS';
33
- export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_FAILURE';
34
-
35
-
36
- export const SET_EDM_TEMPLATE = "app/v2Containers/Templates/SET_EDM_TEMPLATE";
37
- export const SET_BEE_TEMPLATE = "app/v2Containers/Templates/SET_BEE_TEMPLATE";
38
-
39
- export const RESET_ACCOUNT = "app/v2Containers/Templates/RESET_ACCOUNT";
40
- export const RESET_TEMPLATE = "app/v2Containers/Templates/RESET_TEMPLATE";
41
- export const RESET_TEMPLATE_DATA = "app/v2Containers/Templates/RESET_TEMPLATE_DATA";
42
- export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
43
- export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
44
-
45
- export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
46
-
47
- export const GET_DEAFULT_BEE_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_REQUEST';
48
- export const GET_DEAFULT_BEE_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_SUCCESS';
49
- export const GET_DEAFULT_BEE_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_FAILURE';
1
+ /*
2
+ *
3
+ * Templates constants
4
+ *
5
+ */
6
+
7
+ export const DEFAULT_ACTION = 'app/Templates/DEFAULT_ACTION';
8
+
9
+ export const GET_ALL_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_REQUEST';
10
+ export const GET_ALL_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_SUCCESS';
11
+ export const GET_ALL_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_FAILURE';
12
+
13
+ export const DELETE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_TEMPLATE_REQUEST';
14
+ export const DELETE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/DELETE_TEMPLATE_SUCCESS';
15
+ export const DELETE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/DELETE_TEMPLATE_FAILURE';
16
+
17
+ export const GET_USER_LIST_REQUEST = "app/v2Containers/GET_USER_LIST_REQUEST";
18
+ export const GET_USER_LIST_SUCCESS = "app/v2Containers/GET_USER_LIST_SUCCESS";
19
+ export const GET_USER_LIST_FAILURE = "app/v2Containers/GET_USER_LIST_FAILURE";
20
+
21
+ export const GET_WECRM_ACCOUNTS_REQUEST = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_REQUEST";
22
+ export const GET_WECRM_ACCOUNTS_SUCCESS = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_SUCCESS";
23
+ export const GET_WECRM_ACCOUNTS_FAILURE = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_FAILURE";
24
+ export const SET_WECHAT_ACCOUNT = "app/v2Containers/Templates/SET_WECHAT_ACCOUNT";
25
+
26
+ export const SET_SELECTED_LAYOUT = "app/v2Containers/Templates/SET_SELECTED_LAYOUT";
27
+ export const SEND_ZIPPED_FILE_REQUEST = "app/v2Containers/Templates/SEND_ZIPPED_FILE_REQUEST";
28
+ export const SEND_ZIPPED_FILE_SUCCESS = "app/v2Containers/Templates/SEND_ZIPPED_FILE_SUCCESS";
29
+ export const SEND_ZIPPED_FILE_FAILURE = "app/v2Containers/Templates/SEND_ZIPPED_FILE_FAILURE";
30
+
31
+ export const GET_EDM_DEAFULT_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_REQUEST';
32
+ export const GET_EDM_DEAFULT_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_SUCCESS';
33
+ export const GET_EDM_DEAFULT_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_FAILURE';
34
+
35
+ export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_REQUEST';
36
+ export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_SUCCESS';
37
+ export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_FAILURE';
38
+
39
+
40
+ export const SET_EDM_TEMPLATE = "app/v2Containers/Templates/SET_EDM_TEMPLATE";
41
+ export const RESET_ACCOUNT = "app/v2Containers/Templates/RESET_ACCOUNT";
42
+ export const RESET_TEMPLATE = "app/v2Containers/Templates/RESET_TEMPLATE";
43
+ export const RESET_TEMPLATE_DATA = "app/v2Containers/Templates/RESET_TEMPLATE_DATA";
44
+ export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
45
+ export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
46
+
47
+ export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
@@ -82,6 +82,7 @@ const LINE_FILTERS = {
82
82
  TEXT: 'text',
83
83
  IMAGE_VIDEO: 'image',
84
84
  IMAGE_MAP: 'imagemap',
85
+ IMAGE_CAROUSEL: 'template',
85
86
  };
86
87
 
87
88
  export class Templates extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -207,6 +208,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
207
208
  queryParams.perPage = this.state.perPageLimit;
208
209
  const channel = this.state.channel;
209
210
  this.props.actions.getAllTemplates(channel, queryParams);
211
+ //this.getAllTemplates({});
212
+ // if (this.state.channel.toLowerCase() === "email") {
213
+ // this.props.actions.getEdmDefaultTemplates();
214
+ // }
210
215
  }
211
216
 
212
217
  window.addEventListener("message", this.handleFrameTasks);
@@ -231,6 +236,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
231
236
  nextProps.actions.getWeCrmAccounts();
232
237
  } else if (nextProps.route.name.toLowerCase() === 'email') {
233
238
  channel = 'Email';
239
+ // this.props.actions.getEdmDefaultTemplates();
234
240
  } else if (nextProps.route.name.toLowerCase() === "mobilepush") {
235
241
  this.setState({defaultAccount: true});
236
242
  channel = "mobilepush";
@@ -635,11 +641,34 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
635
641
  stickerUrl = '',
636
642
  animatedStickerUrl = '',
637
643
  baseUrl = '',
644
+ template: carouselTemplate,
638
645
  }] = [{}],
639
646
  } = {},
640
647
  } = template.versions.base;
641
648
  templateData.content = text;
642
649
  templateData.url = originalContentUrl || animatedStickerUrl || stickerUrl || (baseUrl ? `${baseUrl}/1040` : '');
650
+ if (carouselTemplate) {
651
+ const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
652
+ templateData.content = (
653
+ <div style={{ display: 'flex'}}>
654
+ {
655
+ carouselContent.map(({
656
+ imageUrl,
657
+ actionLabel
658
+ }) => (
659
+ <img
660
+ width={208}
661
+ height={279}
662
+ src={imageUrl}
663
+ alt={actionLabel}
664
+ key={`${imageUrl}_${actionLabel}`}
665
+ />
666
+ ))
667
+ }
668
+ </div>
669
+ );
670
+ templateData.className = 'carousel-img-section';
671
+ }
643
672
  break;
644
673
  }
645
674
  default:
@@ -972,7 +1001,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
972
1001
  break;
973
1002
  }
974
1003
  };
975
-
1004
+
976
1005
  createTemplate(ev) {
977
1006
  const type = this.props.location.query.type;
978
1007
  const module = this.props.location.query.module ? this.props.location.query.module : 'default';
@@ -1091,7 +1120,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1091
1120
  toggleEdmEmailTemplateSelection = () => {
1092
1121
  this.setState( (prevState) => ({
1093
1122
  showEdmEmailTemplates: !prevState.showEdmEmailTemplates}), () => {
1094
- this.props.actions.getDefaultBeeTemplates();
1123
+ this.props.actions.getEdmDefaultTemplates();
1095
1124
  });
1096
1125
  };
1097
1126
 
@@ -1386,7 +1415,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1386
1415
  //content = template.versions.base.messages[0].Text;
1387
1416
  const lineContent = template.versions.base.content;
1388
1417
  content = {
1389
- bodyText: lineContent && lineContent.messages[0].text ? lineContent.messages[0].text : '',
1418
+ bodyText:lineContent && lineContent.messages[0].text ? lineContent.messages[0].text : '',
1390
1419
  bodyImage: lineContent && lineContent.messages[0].originalContentUrl ? lineContent.messages[0].originalContentUrl : '',
1391
1420
  };
1392
1421
  const modeType = lineContent && lineContent.messages[0].type;
@@ -1509,23 +1538,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1509
1538
 
1510
1539
 
1511
1540
  isLoading = () => {
1512
- const { EmailCreate, Templates } = this.props;
1513
- const {
1514
- getAllTemplatesInProgress,
1515
- deleteTemplateInProgress,
1516
- fetchingWeCrmAccounts,
1517
- sendingFile,
1518
- } = Templates;
1519
- const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
1520
- const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
1521
- const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
1522
- const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
1523
- const emailLoader = (
1524
- (getAllTemplatesInProgress ||
1525
- sendingFile ||
1526
- deleteTemplateInProgress ||
1527
- EmailCreate.duplicateTemplateInProgress) && this.state.channel.toLowerCase() === 'email');
1528
- const ebillLoader = ((getAllTemplatesInProgress || sendingFile) && this.state.channel.toLowerCase() === 'ebill');
1541
+ const lineLoader = (this.props.Templates.getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
1542
+ const smsLoader = (this.props.Templates.getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
1543
+ const wechatLoader = (((this.state.selectedAccount !== '' && this.props.Templates.getAllTemplatesInProgress) || (this.props.Templates.fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
1544
+ const mobilePushLoader = (((this.props.Templates.getAllTemplatesInProgress) || (this.props.Templates.fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
1545
+ const emailLoader = ((this.props.Templates.getAllTemplatesInProgress || this.props.Templates.sendingFile) && this.state.channel.toLowerCase() === 'email');
1546
+ const ebillLoader = ((this.props.Templates.getAllTemplatesInProgress || this.props.Templates.sendingFile) && this.state.channel.toLowerCase() === 'ebill');
1529
1547
  const isLoading = ((wechatLoader !== undefined) ? wechatLoader : false) ||
1530
1548
  (smsLoader !== undefined ? smsLoader : false) ||
1531
1549
  (emailLoader !== undefined ? emailLoader : false) ||
@@ -1783,13 +1801,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1783
1801
  </CapRadio.CapRadioGroup>
1784
1802
  }
1785
1803
  {
1786
- channel.toUpperCase() === LINE &&
1804
+ channel.toUpperCase() === LINE &&
1787
1805
  isFullMode
1788
1806
  ? (
1789
1807
  <CapRadio.CapRadioGroup className="line-filters" defaultValue={lineFilter} onChange={this.setLineFilter}>
1790
1808
  {
1791
1809
  (() => {
1792
- const { ALL, TEXT, IMAGE_VIDEO, STICKER, IMAGE_MAP } = LINE_FILTERS;
1810
+ const { ALL, TEXT, IMAGE_VIDEO, IMAGE_CAROUSEL, IMAGE_MAP } = LINE_FILTERS;
1793
1811
  return (
1794
1812
  <>
1795
1813
  <CapRadio.Button value={ALL}><CapLabel type="label2">
@@ -1804,13 +1822,18 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1804
1822
  <CapRadio.Button value={IMAGE_MAP}><CapLabel type="label2">
1805
1823
  <FormattedMessage {...messages.imageMapTemplate} />
1806
1824
  </CapLabel></CapRadio.Button>
1825
+ <CapRadio.Button value={IMAGE_CAROUSEL}><CapLabel type="label2">
1826
+ <FormattedMessage {...messages.imageCarouselTemplate} />
1827
+ </CapLabel></CapRadio.Button>
1807
1828
  </>
1808
1829
  );
1809
1830
  })()
1810
1831
  }
1811
1832
  </CapRadio.CapRadioGroup>
1812
1833
  )
1813
- : () => null
1834
+ : () => {
1835
+ return null;
1836
+ }
1814
1837
  }
1815
1838
  <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
1816
1839
  {isfilterContentVisisble && !isWechatEmbedded && <CapButton
@@ -1835,19 +1858,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1835
1858
  const creativesParams = this.getCreativesParams();
1836
1859
  const templates = this.props.TemplatesList || [];
1837
1860
  const {route} = this.props;
1838
- const loadingTipMap = {
1839
- sendingFile: 'uploadingFile',
1840
- deleteTemplateInProgress: 'deletingTemplate',
1841
- duplicateTemplateInProgress: 'duplicatingTemplate',
1842
- };
1843
- const { sendingFile, deleteTemplateInProgress } = this.props.Templates;
1844
- const loadingTipIntl =
1845
- ((['email', 'ebill'].includes(this.state.channel.toLowerCase() === 'email')) && sendingFile && 'sendingFile') ||
1846
- (deleteTemplateInProgress && 'deletingTemplate') ||
1847
- (this.props.EmailCreate.duplicateTemplateInProgress && 'duplicatingTemplate');
1848
-
1849
- const loadingTip = messages[loadingTipIntl] ? this.props.intl.formatMessage(messages[loadingTipIntl]) : this.props.intl.formatMessage(messages.gettingAllTemplates);
1850
-
1861
+ const loadingTip = (this.props.Templates.sendingFile && (this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill')) ? this.props.intl.formatMessage(messages.uploadingFile) : this.props.intl.formatMessage(messages.gettingAllTemplates);
1851
1862
  return (
1852
1863
  <>
1853
1864
  {activeMode === ACCOUNT_CHANGE_MODE && this.renderAccountSelection()}
@@ -242,6 +242,10 @@ export default defineMessages({
242
242
  id: `${scope}.imageMapTemplate`,
243
243
  defaultMessage: `Rich message`,
244
244
  },
245
+ "imageCarouselTemplate": {
246
+ id: `${scope}.imageCarouselTemplate`,
247
+ defaultMessage: `Card message`,
248
+ },
245
249
  "selectDefaultButton": {
246
250
  id: `${scope}.selectDefaultButton`,
247
251
  defaultMessage: `Select`,
@@ -350,12 +354,4 @@ export default defineMessages({
350
354
  id: `${scope}.richMediaTemplates`,
351
355
  defaultMessage: 'Rich media templates',
352
356
  },
353
- deletingTemplate: {
354
- id: `${scope}.deletingTemplate`,
355
- defaultMessage: 'Deleting template...',
356
- },
357
- duplicatingTemplate: {
358
- id: `${scope}.duplicatingTemplate`,
359
- defaultMessage: 'Duplicating template...'
360
- },
361
357
  });