@capillarytech/creatives-library 7.18.0-beta.0 → 8.0.0

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 (334) hide show
  1. package/app.js +27 -54
  2. package/assets/Line_Preview_English.svg +24 -0
  3. package/assets/Line_Preview_Japanese.svg +24 -0
  4. package/components/CapTagList/index.js +2 -2
  5. package/components/CapTagList/messages.js +8 -0
  6. package/components/Ckeditor/index.js +4 -2
  7. package/components/Ckeditor/style.scss +3 -0
  8. package/components/FormBuilder/_formBuilder.scss +4 -16
  9. package/components/FormBuilder/index.js +4 -3
  10. package/components/FormBuilder/messages.js +4 -0
  11. package/components/Sidebar/index.js +4 -4
  12. package/config/path.js +1 -1
  13. package/containers/App/constants.js +95 -0
  14. package/containers/App/index.js +52 -0
  15. package/containers/App/sagas.js +8 -3
  16. package/containers/Assets/Gallery/index.js +17 -3
  17. package/containers/Assets/Gallery/messages.js +4 -0
  18. package/containers/Assets/Gallery/sagas.js +14 -14
  19. package/containers/Cap/index.js +84 -50
  20. package/containers/Cap/sagas.js +20 -12
  21. package/containers/Cap/selectors.js +13 -13
  22. package/containers/Cap/tests/__snapshots__/index.test.js.snap +1 -1
  23. package/containers/Cap/tests/saga.test.js +81 -1
  24. package/containers/Dashboard/index.js +34 -17
  25. package/containers/Dashboard/sagas.js +7 -1
  26. package/containers/Ebill/index.js +16 -3
  27. package/containers/Ebill/sagas.js +18 -11
  28. package/containers/Email/index.js +20 -3
  29. package/containers/Email/sagas.js +34 -23
  30. package/containers/LanguageProvider/index.js +49 -31
  31. package/containers/LanguageProvider/tests/index.test.js +5 -3
  32. package/containers/Line/Create/index.js +15 -2
  33. package/containers/Line/Create/sagas.js +26 -17
  34. package/containers/Line/Edit/sagas.js +12 -13
  35. package/containers/Login/index.js +36 -11
  36. package/containers/MobilePush/Create/index.js +17 -2
  37. package/containers/MobilePush/Create/sagas.js +18 -12
  38. package/containers/MobilePush/Edit/index.js +20 -3
  39. package/containers/MobilePush/Edit/sagas.js +30 -20
  40. package/containers/Sms/Create/index.js +15 -2
  41. package/containers/Sms/Create/sagas.js +8 -6
  42. package/containers/Sms/Edit/index.js +15 -3
  43. package/containers/Sms/Edit/sagas.js +14 -8
  44. package/containers/TagList/constants.js +23 -0
  45. package/containers/Templates/actions.js +0 -5
  46. package/containers/Templates/index.js +47 -14
  47. package/containers/Templates/sagas.js +20 -23
  48. package/containers/WeChat/MapTemplates/index.js +19 -2
  49. package/containers/WeChat/MapTemplates/sagas.js +17 -17
  50. package/containers/WeChat/RichmediaTemplates/Create/index.js +18 -2
  51. package/containers/WeChat/RichmediaTemplates/Create/sagas.js +11 -8
  52. package/containers/WeChat/RichmediaTemplates/Edit/index.js +21 -2
  53. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +9 -5
  54. package/entry.js +2 -0
  55. package/global-styles.js +2 -2
  56. package/gtm/eventDefinitionsMap.js +1 -1
  57. package/helpers/intl-enzym-test-helpers.js +1 -1
  58. package/hoc/withReactRouterV3Compatibility.js +66 -0
  59. package/index.js +12 -0
  60. package/initialReducer.js +32 -0
  61. package/initialState.js +1 -0
  62. package/mfe-exposed-components.js +8 -0
  63. package/package.json +16 -11
  64. package/routes.js +206 -749
  65. package/services/api.js +62 -17
  66. package/services/tests/api.test.js +248 -1
  67. package/styles/components/navigation/_leftnav.scss +13 -0
  68. package/styles/containers/layout/_layoutPage.scss +14 -0
  69. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +21 -16
  70. package/tests/store.test.js +5 -3
  71. package/translations/en.json +1 -9
  72. package/translations/ja-JP.json +0 -8
  73. package/translations/zh.json +0 -8
  74. package/utils/authWrapper.js +43 -17
  75. package/utils/cdnTransformation.js +73 -44
  76. package/utils/checkStore.js +21 -0
  77. package/utils/common.js +198 -8
  78. package/utils/commonUtils.js +17 -1
  79. package/utils/customAuthWrapper.js +62 -0
  80. package/utils/customConnectedAuthWrapper.js +26 -0
  81. package/utils/history.js +8 -0
  82. package/utils/injectReducer.js +2 -0
  83. package/utils/injectSaga.js +2 -0
  84. package/utils/tagValidations.js +2 -2
  85. package/utils/tests/cdnTransformation.test.js +6 -4
  86. package/utils/tests/common.mockdata.js +623 -0
  87. package/utils/tests/common.test.js +273 -0
  88. package/utils/tests/commonUtil.test.js +79 -0
  89. package/v2Components/CapDeviceContent/index.js +330 -0
  90. package/v2Components/CapDeviceContent/index.scss +115 -0
  91. package/v2Components/CapDeviceContent/messages.js +94 -0
  92. package/v2Components/CapDeviceContent/tests/index.test.js +89 -0
  93. package/v2Components/CapImageUpload/constants.js +6 -0
  94. package/v2Components/CapImageUpload/index.js +23 -15
  95. package/v2Components/CapImageUpload/index.scss +6 -0
  96. package/v2Components/CapImageUpload/messages.js +7 -7
  97. package/v2Components/CapInAppCTA/constants.js +25 -0
  98. package/v2Components/CapInAppCTA/index.js +279 -0
  99. package/v2Components/CapInAppCTA/index.scss +99 -0
  100. package/v2Components/CapInAppCTA/messages.js +85 -0
  101. package/v2Components/CapTagList/index.js +149 -26
  102. package/v2Components/CapTagList/messages.js +12 -0
  103. package/v2Components/CapTagList/style.scss +26 -0
  104. package/v2Components/CapVideoUpload/constants.js +6 -0
  105. package/v2Components/CapVideoUpload/index.js +48 -22
  106. package/v2Components/CapVideoUpload/index.scss +4 -2
  107. package/v2Components/CapVideoUpload/messages.js +10 -6
  108. package/v2Components/CapWhatsappQuickReply/index.js +255 -0
  109. package/v2Components/CapWhatsappQuickReply/index.scss +54 -0
  110. package/v2Components/CapWhatsappQuickReply/messages.js +32 -0
  111. package/v2Components/Ckeditor/index.js +56 -22
  112. package/v2Components/Ckeditor/style.scss +3 -0
  113. package/v2Components/Ckeditor/tests/index.test.js +44 -0
  114. package/v2Components/CmsTemplatesComponent/index.js +1 -0
  115. package/v2Components/CmsTemplatesComponent/messages.js +4 -0
  116. package/v2Components/EmailMobilePreview/index.js +4 -2
  117. package/v2Components/EmailPreviewV2/index.js +6 -4
  118. package/v2Components/EmailPreviewV2/tests/__snapshots__/index.test.js.snap +0 -3
  119. package/v2Components/FormBuilder/_formBuilder.scss +1 -0
  120. package/v2Components/FormBuilder/constants.js +1 -1
  121. package/v2Components/FormBuilder/index.js +111 -29
  122. package/v2Components/FormBuilder/messages.js +4 -0
  123. package/v2Components/FormBuilder/tests/index.test.js +5 -2
  124. package/v2Components/MobilePushPreviewV2/index.js +57 -22
  125. package/v2Components/NavigationBar/constants.js +1 -0
  126. package/v2Components/NavigationBar/index.js +84 -113
  127. package/v2Components/NavigationBar/messages.js +8 -0
  128. package/v2Components/NavigationBar/style.js +9 -0
  129. package/v2Components/NavigationBar/tests/index.test.js +32 -9
  130. package/v2Components/NavigationBar/tests/mockData.js +1 -0
  131. package/v2Components/NewCallTask/tests/index.test.js +5 -3
  132. package/v2Components/Pagination/index.js +2 -1
  133. package/v2Components/RenderRoute/RenderRoute.js +11 -0
  134. package/v2Components/RenderRoute/index.js +1 -0
  135. package/v2Components/TemplatePreview/_templatePreview.scss +535 -0
  136. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +11 -0
  137. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +11 -0
  138. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +11 -0
  139. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +11 -0
  140. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +6 -0
  141. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +18 -0
  142. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +7 -0
  143. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +13 -0
  144. package/v2Components/TemplatePreview/index.js +745 -362
  145. package/v2Components/TemplatePreview/messages.js +8 -0
  146. package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +47 -14
  147. package/v2Components/TemplatePreview/tests/index.test.js +9 -0
  148. package/v2Components/WhatsappStatusContainer/_whatsappStatusContainer.scss +8 -1
  149. package/v2Containers/App/constants.js +12 -6
  150. package/v2Containers/App/sagas.js +0 -1
  151. package/v2Containers/Assets/Gallery/index.js +1 -0
  152. package/v2Containers/Assets/Gallery/sagas.js +15 -14
  153. package/v2Containers/BeeEditor/index.js +3 -1
  154. package/v2Containers/BeeEditor/sagas.js +8 -5
  155. package/v2Containers/CallTask/sagas.js +7 -1
  156. package/v2Containers/Cap/actions.js +4 -0
  157. package/v2Containers/Cap/constants.js +20 -1
  158. package/v2Containers/Cap/index.js +116 -17
  159. package/v2Containers/Cap/messages.js +8 -0
  160. package/v2Containers/Cap/reducer.js +18 -3
  161. package/v2Containers/Cap/sagas.js +64 -9
  162. package/v2Containers/Cap/selectors.js +27 -13
  163. package/v2Containers/Cap/tests/Cap.test.js +164 -0
  164. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +2 -1
  165. package/v2Containers/Cap/tests/actions.test.js +11 -0
  166. package/v2Containers/Cap/tests/reducer.test.js +59 -0
  167. package/v2Containers/Cap/tests/saga.test.js +181 -2
  168. package/v2Containers/Cap/tests/selectors.test.js +42 -18
  169. package/v2Containers/CapFacebookPreview/sagas.js +7 -5
  170. package/v2Containers/CreativesContainer/SlideBoxContent.js +86 -4
  171. package/v2Containers/CreativesContainer/SlideBoxFooter.js +4 -3
  172. package/v2Containers/CreativesContainer/SlideBoxHeader.js +30 -14
  173. package/v2Containers/CreativesContainer/constants.js +5 -0
  174. package/v2Containers/CreativesContainer/index.js +157 -38
  175. package/v2Containers/CreativesContainer/index.scss +12 -0
  176. package/v2Containers/CreativesContainer/messages.js +33 -1
  177. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +11 -0
  178. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +5 -2
  179. package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +7 -1
  180. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +227 -0
  181. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +73 -0
  182. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +80 -0
  183. package/v2Containers/CreativesContainer/tests/index.test.js +16 -0
  184. package/v2Containers/Ebill/sagas.js +3 -10
  185. package/v2Containers/Email/index.js +38 -19
  186. package/v2Containers/Email/initialSchema.js +1 -1
  187. package/v2Containers/Email/sagas.js +22 -26
  188. package/v2Containers/EmailWrapper/index.js +18 -8
  189. package/v2Containers/FTP/index.js +2 -2
  190. package/v2Containers/FTP/sagas.js +3 -4
  191. package/v2Containers/Facebook/sagas.js +26 -17
  192. package/v2Containers/InApp/actions.js +64 -0
  193. package/v2Containers/InApp/constants.js +160 -0
  194. package/v2Containers/InApp/index.js +792 -0
  195. package/v2Containers/InApp/index.scss +50 -0
  196. package/v2Containers/InApp/messages.js +114 -0
  197. package/v2Containers/InApp/reducer.js +109 -0
  198. package/v2Containers/InApp/sagas.js +151 -0
  199. package/v2Containers/InApp/selectors.js +12 -0
  200. package/v2Containers/InApp/tests/action.test.js +53 -0
  201. package/v2Containers/InApp/tests/index.test.js +165 -0
  202. package/v2Containers/InApp/tests/mockData.js +898 -0
  203. package/v2Containers/InApp/tests/reducer.test.js +177 -0
  204. package/v2Containers/InApp/tests/sagas.test.js +391 -0
  205. package/v2Containers/InApp/utils.js +12 -0
  206. package/v2Containers/LanguageProvider/index.js +17 -5
  207. package/v2Containers/LanguageProvider/reducer.js +3 -2
  208. package/v2Containers/LanguageProvider/sagas.js +7 -8
  209. package/v2Containers/LanguageProvider/selectors.js +2 -1
  210. package/v2Containers/LanguageProvider/tests/index.test.js +5 -2
  211. package/v2Containers/LanguageProvider/tests/reducer.test.js +6 -3
  212. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +28 -16
  213. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -2
  214. package/v2Containers/Line/Container/ImageCarousel/tests/content.test.js +5 -3
  215. package/v2Containers/Line/Container/ImageCarousel/tests/index.test.js +5 -3
  216. package/v2Containers/Line/Container/ImageMap/index.js +1 -1
  217. package/v2Containers/Line/Container/Text/index.js +16 -1
  218. package/v2Containers/Line/Container/Video/index.js +2 -1
  219. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +18134 -107
  220. package/v2Containers/Line/Container/Wrapper/tests/index.test.js +5 -3
  221. package/v2Containers/Line/Container/Wrapper/utils.js +1 -1
  222. package/v2Containers/Line/Container/index.js +4 -0
  223. package/v2Containers/Line/Container/sagas.js +30 -20
  224. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +123 -81
  225. package/v2Containers/Line/Container/tests/index.test.js +5 -2
  226. package/v2Containers/Login/index.js +1 -2
  227. package/v2Containers/MobilePush/Create/index.js +40 -17
  228. package/v2Containers/MobilePush/Create/sagas.js +18 -12
  229. package/v2Containers/MobilePush/Edit/index.js +16 -7
  230. package/v2Containers/MobilePush/Edit/sagas.js +30 -20
  231. package/v2Containers/MobilepushWrapper/index.js +3 -0
  232. package/v2Containers/Rcs/sagas.js +14 -14
  233. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +123 -87
  234. package/v2Containers/Rcs/tests/index.test.js +5 -3
  235. package/v2Containers/Sms/Create/sagas.js +10 -6
  236. package/v2Containers/Sms/Edit/sagas.js +14 -8
  237. package/v2Containers/SmsTrai/Create/sagas.js +9 -10
  238. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -4
  239. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +12 -8
  240. package/v2Containers/SmsTrai/Edit/tests/index.test.js +5 -3
  241. package/v2Containers/TagList/_tagList.scss +18 -0
  242. package/v2Containers/TagList/index.js +81 -42
  243. package/v2Containers/TagList/tests/TagList.test.js +6 -7
  244. package/v2Containers/TagList/tests/mockdata.js +10 -166
  245. package/v2Containers/TagList/tests/utils.test.js +17 -0
  246. package/v2Containers/TagList/utils.js +15 -0
  247. package/v2Containers/Templates/_templates.scss +60 -5
  248. package/v2Containers/Templates/actions.js +6 -5
  249. package/v2Containers/Templates/constants.js +2 -1
  250. package/v2Containers/Templates/index.js +576 -181
  251. package/v2Containers/Templates/messages.js +52 -8
  252. package/v2Containers/Templates/reducer.js +3 -1
  253. package/v2Containers/Templates/sagas.js +54 -38
  254. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +669 -43
  255. package/v2Containers/Templates/tests/actions.test.js +19 -0
  256. package/v2Containers/Templates/tests/index.test.js +53 -1
  257. package/v2Containers/Templates/tests/mockData.js +45 -1
  258. package/v2Containers/Templates/tests/reducer.test.js +50 -0
  259. package/v2Containers/Templates/tests/sagas.test.js +116 -3
  260. package/v2Containers/Templates/tests/selector.test.js +17 -0
  261. package/v2Containers/TemplatesV2/index.js +180 -8
  262. package/v2Containers/TemplatesV2/messages.js +8 -0
  263. package/v2Containers/TemplatesV2/tests/index.test.js +104 -0
  264. package/v2Containers/TemplatesV2/tests/mockData.js +685 -0
  265. package/v2Containers/Viber/constants.js +58 -0
  266. package/v2Containers/Viber/index.js +404 -421
  267. package/v2Containers/Viber/index.scss +107 -0
  268. package/v2Containers/Viber/messages.js +70 -2
  269. package/v2Containers/Viber/sagas.js +22 -14
  270. package/v2Containers/Viber/style.js +20 -0
  271. package/v2Containers/Viber/tests/index.test.js +299 -0
  272. package/v2Containers/Viber/tests/mockData.js +134 -0
  273. package/v2Containers/WeChat/MapTemplates/sagas.js +22 -14
  274. package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +12 -11
  275. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +9 -5
  276. package/v2Containers/Whatsapp/actions.js +16 -0
  277. package/v2Containers/Whatsapp/constants.js +24 -0
  278. package/v2Containers/Whatsapp/index.js +892 -222
  279. package/v2Containers/Whatsapp/index.scss +91 -1
  280. package/v2Containers/Whatsapp/messages.js +98 -1
  281. package/v2Containers/Whatsapp/reducer.js +19 -0
  282. package/v2Containers/Whatsapp/sagas.js +67 -12
  283. package/v2Containers/Whatsapp/styles.scss +35 -0
  284. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34983 -24886
  285. package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +12 -0
  286. package/v2Containers/Whatsapp/tests/actions.test.js +21 -0
  287. package/v2Containers/Whatsapp/tests/index.test.js +17 -4
  288. package/v2Containers/Whatsapp/tests/mockData.js +77 -0
  289. package/v2Containers/Whatsapp/tests/reducer.test.js +67 -0
  290. package/v2Containers/Whatsapp/tests/saga.test.js +201 -0
  291. package/v2Containers/Whatsapp/tests/utils.test.js +18 -0
  292. package/v2Containers/Whatsapp/utils.js +65 -4
  293. package/v2Containers/Zalo/actions.js +24 -0
  294. package/v2Containers/Zalo/constants.js +59 -0
  295. package/v2Containers/Zalo/index.js +548 -0
  296. package/v2Containers/Zalo/index.scss +75 -0
  297. package/v2Containers/Zalo/messages.js +86 -0
  298. package/v2Containers/Zalo/reducer.js +63 -0
  299. package/v2Containers/Zalo/saga.js +45 -0
  300. package/v2Containers/Zalo/selectors.js +19 -0
  301. package/v2Containers/Zalo/tests/actions.test.js +26 -0
  302. package/v2Containers/Zalo/tests/index.test.js +149 -0
  303. package/v2Containers/Zalo/tests/mockData.js +11527 -0
  304. package/v2Containers/Zalo/tests/reducer.test.js +96 -0
  305. package/v2Containers/Zalo/tests/saga.test.js +118 -0
  306. package/v2Containers/Zalo/tests/selector.test.js +51 -0
  307. package/v2Containers/mockdata.js +1531 -680
  308. package/containers/TestPage/constants.js +0 -7
  309. package/containers/TestPage/index.js +0 -31
  310. package/containers/TestPage/messages.js +0 -13
  311. package/containers/TestPage/reducer.js +0 -21
  312. package/containers/TestPage/sagas.js +0 -11
  313. package/containers/Testv2/actions.js +0 -15
  314. package/containers/Testv2/constants.js +0 -7
  315. package/containers/Testv2/index.js +0 -47
  316. package/containers/Testv2/messages.js +0 -21
  317. package/containers/Testv2/reducer.js +0 -23
  318. package/containers/Testv2/sagas.js +0 -11
  319. package/containers/Testv2/selectors.js +0 -25
  320. package/reducers.js +0 -73
  321. package/store.js +0 -61
  322. package/utils/tests/asyncInjectors.test.js +0 -173
  323. package/v2Containers/TestPage/constants.js +0 -7
  324. package/v2Containers/TestPage/index.js +0 -31
  325. package/v2Containers/TestPage/messages.js +0 -13
  326. package/v2Containers/TestPage/reducer.js +0 -21
  327. package/v2Containers/TestPage/sagas.js +0 -11
  328. package/v2Containers/Testv2/actions.js +0 -15
  329. package/v2Containers/Testv2/constants.js +0 -7
  330. package/v2Containers/Testv2/index.js +0 -47
  331. package/v2Containers/Testv2/messages.js +0 -21
  332. package/v2Containers/Testv2/reducer.js +0 -23
  333. package/v2Containers/Testv2/sagas.js +0 -11
  334. package/v2Containers/Testv2/selectors.js +0 -25
@@ -0,0 +1,19 @@
1
+ import { getAllTemplates } from "../actions";
2
+ import * as types from "../constants";
3
+
4
+ describe("Test zalo list actions", () => {
5
+ it("has a type of GET_ALL_TEMPLATES_REQUEST action", () => {
6
+ const channel = "Zalo";
7
+ const queryParams = {
8
+ page: 1,
9
+ perPage: 25,
10
+ };
11
+ const expected = {
12
+ type: types.GET_ALL_TEMPLATES_REQUEST,
13
+ channel,
14
+ intlCopyOf: "test",
15
+ queryParams,
16
+ };
17
+ expect(getAllTemplates(channel, queryParams, "test")).toEqual(expected);
18
+ });
19
+ });
@@ -4,7 +4,7 @@ import { shallowWithIntl } from '../../../helpers/intl-enzym-test-helpers';
4
4
  import { Templates } from '../index';
5
5
  import mockdata from '../../mockdata';
6
6
 
7
- const { whatsappTemplates: TemplatesProp, getCreativesParamsOutput } = mockdata;
7
+ const { whatsappTemplates: TemplatesProp, getCreativesParamsOutput, zaloTemplates: ZaloTemplateProp } = mockdata;
8
8
 
9
9
  jest.mock('../../CreativesContainer', () => ({
10
10
  __esModule: true,
@@ -57,6 +57,36 @@ describe('Test Templates container', () => {
57
57
  );
58
58
  };
59
59
 
60
+ const renderZaloFunction = (isFullMode) => {
61
+ renderedComponent = shallowWithIntl(
62
+ <Templates
63
+ route={{
64
+ name: 'Zalo',
65
+ }}
66
+ Templates={ZaloTemplateProp}
67
+ actions={{
68
+ getWeCrmAccounts,
69
+ setChannelAccount,
70
+ getAllTemplates,
71
+ getUserList,
72
+ getSenderDetails,
73
+ }}
74
+ location={{
75
+ pathname: '/Zalo',
76
+ query: {},
77
+ search: '',
78
+ }}
79
+ EmailCreate={{
80
+ duplicateTemplateInProgress: false,
81
+ }}
82
+ isFullMode={isFullMode}
83
+ intl={{
84
+ formatMessage: () => {},
85
+ }}
86
+ />,
87
+ );
88
+ };
89
+
60
90
  it('Should render correct component for whatsapp channel', () => {
61
91
  renderFunction();
62
92
  expect(renderedComponent).toMatchSnapshot();
@@ -97,6 +127,28 @@ describe('Test Templates container', () => {
97
127
  getCreativesParamsOutput,
98
128
  );
99
129
  });
130
+ it('Should render correct component for zalo channel', () => {
131
+ renderZaloFunction();
132
+ expect(renderedComponent).toMatchSnapshot();
133
+ });
134
+ it('Should render temlates when zalo templates are passed', () => {
135
+ renderZaloFunction();
136
+ renderedComponent.setProps({ TemplatesList: ZaloTemplateProp.templates });
137
+ expect(renderedComponent).toMatchSnapshot();
138
+ });
139
+ it('Should render temlates when Zalo templates are passed in full mode', () => {
140
+ renderZaloFunction(true);
141
+ renderedComponent.setProps({ TemplatesList: ZaloTemplateProp.templates });
142
+ expect(renderedComponent).toMatchSnapshot();
143
+ });
144
+ it('Should render illustration when no templates are passed', () => {
145
+ renderZaloFunction();
146
+ renderedComponent.setProps({
147
+ TemplatesList: [],
148
+ Templates: {},
149
+ });
150
+ expect(renderedComponent).toMatchSnapshot();
151
+ });
100
152
 
101
153
  const getFilterContainer = () => {
102
154
  const FilterContainer = () =>
@@ -23,8 +23,52 @@ export const getCdnTransformationConfigSuccess = {
23
23
  }
24
24
  };
25
25
 
26
+ export const getAllTemplatesListSuccess = {
27
+ "name": "Test2 QR - Thông báo thanh toán thành công",
28
+ "versions": {
29
+ "base": {
30
+ "content": {
31
+ "ZALO": {
32
+ "templateId": "268531",
33
+ "templateName": "Test QR - Thông báo thanh toán thành công",
34
+ "listParams": [
35
+ {
36
+ "name": "danh_xung",
37
+ "require": true,
38
+ "type": "STRING",
39
+ "maxLength": 30,
40
+ "minLength": 0,
41
+ "acceptNull": false,
42
+ },
43
+ {
44
+ "name": "name",
45
+ "require": true,
46
+ "type": "STRING",
47
+ "maxLength": 30,
48
+ "minLength": 0,
49
+ "acceptNull": false,
50
+ },
51
+ ],
52
+ "previewUrl": "https://account.zalo.cloud/znspreview/-e0cMil4NU5WUUAVzP7T_g=="
53
+ },
54
+ },
55
+ },
56
+ },
57
+ "type": "ZALO",
58
+ response: {
59
+ templates: [{name: '1', id: '2'}],
60
+ },
61
+ intlCopyOf: 'test',
62
+ };
63
+
26
64
  export const getCdnTransformationConfigFailure = {
27
65
  "isError": true,
28
66
  "message": "Resource Not Found",
29
67
  "error": {}
30
- };
68
+ };
69
+
70
+ export const getAllTemplatesListFailure = {
71
+ "isError": true,
72
+ "message": "Resource Not Found",
73
+ "error": {},
74
+ };
@@ -0,0 +1,50 @@
1
+ import reducer, { initialState } from "../reducer";
2
+ import * as types from "../constants";
3
+ import * as mockData from "./mockData";
4
+
5
+ describe("test reducer", () => {
6
+ afterEach(() => {
7
+ jest.clearAllMocks();
8
+ });
9
+
10
+ it("should return the initial state", () => {
11
+ expect(reducer(undefined, {})).toEqual(initialState);
12
+ });
13
+
14
+ it("should handle GET_ALL_TEMPLATES_REQUEST", () => {
15
+ const action = {
16
+ type: types.GET_ALL_TEMPLATES_REQUEST,
17
+ };
18
+ expect(reducer(initialState, action).toJS()).toEqual({
19
+ ...initialState.toJS(),
20
+ getAllTemplatesInProgress: true,
21
+ });
22
+ });
23
+
24
+ it("should handle GET_ALL_TEMPLATES_SUCCESS", () => {
25
+ const action = {
26
+ type: types.GET_ALL_TEMPLATES_SUCCESS,
27
+ data: mockData.getAllTemplatesListSuccess,
28
+ };
29
+ const expectedResult = {
30
+ ...initialState.toJS(),
31
+ getAllTemplatesInProgress: false,
32
+ templateError: {},
33
+ weCRMtemplates: [],
34
+ templates: [undefined],
35
+ isSearch: undefined,
36
+ };
37
+ expect(reducer(initialState, action).toJS()).toEqual(expectedResult);
38
+ });
39
+
40
+ it("should handle GET_ALL_TEMPLATES_FAILURE", () => {
41
+ const action = {
42
+ type: types.GET_ALL_TEMPLATES_FAILURE,
43
+ };
44
+ expect(reducer(initialState, action).toJS()).toEqual({
45
+ ...initialState.toJS(),
46
+ getAllTemplatesInProgress: false,
47
+ templateError: undefined,
48
+ });
49
+ });
50
+ });
@@ -1,5 +1,5 @@
1
1
  import { expectSaga } from 'redux-saga-test-plan';
2
- import { take, call, takeLatest, takeEvery } from 'redux-saga/effects';
2
+ import { take, call, takeLatest, takeEvery, put } from 'redux-saga/effects';
3
3
  import * as matchers from 'redux-saga-test-plan/matchers';
4
4
  import * as api from '../../../services/api';
5
5
  import * as types from '../constants';
@@ -7,10 +7,15 @@ import * as cdnUtils from '../../../utils/cdnTransformation';
7
7
 
8
8
  import {
9
9
  getCdnTransformationConfig,
10
- watchGetCdnTransformationConfig
10
+ getAllTemplates,
11
+ watchGetCdnTransformationConfig,
12
+ watchGetAllTemplates,
13
+ getSenderDetails,
11
14
  } from '../sagas';
12
15
 
13
16
  import * as mockData from './mockData';
17
+ import { ZALO } from '../../CreativesContainer/constants';
18
+ import { VIET_GUYS } from '../../Zalo/constants';
14
19
 
15
20
  describe('getCdnTransformationConfig saga', () => {
16
21
  it("handle valid response from api", () => {
@@ -73,4 +78,112 @@ describe('watchForGetJourneyList saga', () => {
73
78
  takeLatest(types.GET_CDN_TRANSFORMATION_CONFIG_REQUEST, getCdnTransformationConfig),
74
79
  );
75
80
  });
76
- });
81
+ });
82
+
83
+ describe('templateList saga', () => {
84
+ it('handle valid response from api', () => {
85
+ expectSaga(getAllTemplates, mockData.getAllTemplatesListSuccess)
86
+ .provide([
87
+ [
88
+ matchers.call.fn(api.getAllTemplates),
89
+ mockData.getAllTemplatesListSuccess,
90
+ ],
91
+ ]).put({
92
+ type: types.GET_ALL_TEMPLATES_SUCCESS,
93
+ data: mockData.getAllTemplatesListSuccess,
94
+ weCRMTemplate: mockData.getAllTemplatesListSuccess,
95
+ isReset: mockData.getAllTemplatesListSuccess?.queryParams?.page === 1,
96
+ })
97
+ .run();
98
+ });
99
+
100
+ it('handle valid response from api', () => {
101
+ mockData.getAllTemplatesListSuccess.intlCopyOf = '';
102
+ expectSaga(getAllTemplates, mockData.getAllTemplatesListSuccess)
103
+ .provide([
104
+ [
105
+ matchers.call.fn(api.getAllTemplates),
106
+ mockData.getAllTemplatesListSuccess,
107
+ ],
108
+ ]).put({
109
+ type: types.GET_ALL_TEMPLATES_SUCCESS,
110
+ data: mockData.getAllTemplatesListSuccess,
111
+ weCRMTemplate: mockData.getAllTemplatesListSuccess,
112
+ isReset: mockData.getAllTemplatesListSuccess?.queryParams?.page === 1,
113
+ })
114
+ .run();
115
+ });
116
+ it('handles error thrown from api', () => {
117
+ expectSaga(getAllTemplates, mockData.getAllTemplatesListFailure)
118
+ .provide([
119
+ [
120
+ call(api.getAllTemplates),
121
+ mockData.getAllTemplatesListFailure,
122
+ ],
123
+ ])
124
+ .put({
125
+ type: types.GET_ALL_TEMPLATES_FAILURE,
126
+ res: mockData.getAllTemplatesListFailure,
127
+ })
128
+ .run();
129
+ });
130
+ });
131
+
132
+ describe('watchForTemplates saga', () => {
133
+ const generator = watchGetAllTemplates();
134
+ it('should call watchers functions', () => {
135
+ expect(generator.next().value).toEqual(
136
+ takeLatest(types.GET_ALL_TEMPLATES_REQUEST, getAllTemplates),
137
+ );
138
+ });
139
+ });
140
+
141
+ describe('getSenderDetails Saga', () => {
142
+ const channel = 'someChannel';
143
+ const orgUnitId = 'someOrgUnitId';
144
+ const action = { channel, orgUnitId };
145
+
146
+ it('should handle apiResponse with hostName', () => {
147
+ const apiResponse = {
148
+ entity: {
149
+ [channel]: [
150
+ {
151
+ domainProperties: {
152
+ hostName: 'example.com',
153
+ },
154
+ },
155
+ ],
156
+ },
157
+ };
158
+
159
+ const generator = getSenderDetails(action);
160
+ expect(generator.next().value).toEqual(call(api.getSenderDetails, channel, orgUnitId));
161
+ expect(generator.next(apiResponse).value).toEqual(
162
+ put({
163
+ type: types.GET_SENDER_DETAILS_SUCCESS,
164
+ payload: 'example.com',
165
+ })
166
+ );
167
+ });
168
+
169
+ it('should handle apiResponse without hostName', () => {
170
+ const apiResponse = {
171
+ entity: {
172
+ [channel]: [
173
+ {
174
+ domainProperties: {},
175
+ },
176
+ ],
177
+ },
178
+ };
179
+
180
+ const generator = getSenderDetails(action);
181
+ expect(generator.next().value).toEqual(call(api.getSenderDetails, channel, orgUnitId));
182
+ expect(generator.next(apiResponse).value).toEqual(
183
+ put({
184
+ type: types.GET_SENDER_DETAILS_SUCCESS,
185
+ payload: '',
186
+ })
187
+ );
188
+ });
189
+ });
@@ -0,0 +1,17 @@
1
+ import { fromJS } from "immutable";
2
+ import { makeSelectTemplatesResponse } from "../selectors";
3
+
4
+ describe("Template selectors", () => {
5
+ const mockState = fromJS({
6
+ templates: [],
7
+ });
8
+
9
+ describe("makeSelectTemplatesResponse selector", () => {
10
+ it("should return the correct substate", () => {
11
+ const selected = makeSelectTemplatesResponse().resultFunc(
12
+ mockState.get("templates")
13
+ );
14
+ expect(selected).toEqual(mockState.getIn(["templates", "templates"]));
15
+ });
16
+ });
17
+ });
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import { connect } from 'react-redux';
10
10
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
11
11
  import { createStructuredSelector } from 'reselect';
12
- import { bindActionCreators } from 'redux';
12
+ import { bindActionCreators, compose } from 'redux';
13
13
  import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon, CapTooltip } from '@capillarytech/cap-ui-library';
14
14
  import { find, get } from 'lodash';
15
15
  import isEmpty from 'lodash/isEmpty';
@@ -29,9 +29,60 @@ import FTP from '../FTP';
29
29
  import Gallery from '../Assets/Gallery';
30
30
  import withStyles from '../../hoc/withStyles';
31
31
  import styles, { CapTabStyle } from './TemplatesV2.style';
32
- import { CREATIVES_UI_VIEW, LOYALTY, WHATSAPP, RCS } from '../App/constants';
32
+ import { CREATIVES_UI_VIEW, LOYALTY, WHATSAPP, RCS, LINE, EMAIL, ASSETS, JP_LOCALE_HIDE_FEATURE, ZALO, INAPP } from '../App/constants';
33
33
  import AccessForbidden from '../../v2Components/AccessForbidden';
34
34
  import { getObjFromQueryParams } from '../../utils/v2common';
35
+ import { makeSelectAuthenticated, selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
36
+ import injectSaga from '../../utils/injectSaga';
37
+ import injectReducer from '../../utils/injectReducer';
38
+
39
+ import reducer from '../Templates/reducer';
40
+ import v2CapReducer from '../Cap/reducer';
41
+ import v2CreativesContainerReducer from '../CreativesContainer/reducer';
42
+ import v2SmsCreateReducer from '../Sms/Create/reducer';
43
+ import v2SmsEditReducer from '../Sms/Edit/reducer';
44
+ import v2EmailReducer from '../Email/reducer';
45
+ import v2CallTaskReducer from '../CallTask/reducer';
46
+ import v2MobilePushCreateReducer from '../MobilePush/Create/reducer';
47
+ import v2MobilePushEditReducer from '../MobilePush/Edit/reducer';
48
+ import v2WechatMapTemplatesReducer from '../WeChat/MapTemplates/reducer';
49
+ import v2WechatRichmediaTemplatesCreateReducer from '../WeChat/RichmediaTemplates/Create/reducer';
50
+ import v2WechatRichmediaTemplatesEditReducer from '../WeChat/RichmediaTemplates/Edit/reducer';
51
+ import v2AssetsGalleryReducer from '../Assets/Gallery/reducer';
52
+ import v2FacebookReducer from '../Facebook/reducer';
53
+ import v2LineContainerReducer from '../Line/Container/reducer';
54
+ import v2ViberReducer from '../Viber/reducer';
55
+ import v2CapFacebookPreviewReducer from '../CapFacebookPreview/reducer';
56
+ import v2SmsTraiCreateReducer from '../SmsTrai/Create/reducer';
57
+ import v2WhatsappReducer from '../Whatsapp/reducer';
58
+ import v2ZaloReducer from '../Zalo/reducer';
59
+ import v2InAppReducer from '../InApp/reducer';
60
+ import v2RcsReducer from '../InApp/reducer';
61
+ import leftNavReducer from '@capillarytech/cap-ui-library/CapCollapsibleLeftNavigation/reducer';
62
+
63
+ import { v2TemplateSaga } from '../Templates/sagas';
64
+ import { v2CapSagas } from '../Cap/sagas';
65
+ import { v2SmsCreateSagas } from '../Sms/Create/sagas';
66
+ import { v2SmsEditSagas } from '../Sms/Edit/sagas';
67
+ import { v2EmailSagas } from '../Email/sagas';
68
+ import { v2BeeEditionSagas } from '../BeeEditor/sagas';
69
+ import { v2CallTaskSagas } from '../CallTask/sagas';
70
+ import { v2MobilePushCreateSagas } from '../MobilePush/Create/sagas';
71
+ import { v2MobilePushEditSagas } from '../MobilePush/Edit/sagas';
72
+ import { v2WechatMapTemplatesSagas } from '../WeChat/MapTemplates/sagas';
73
+ import { v2WechatRichmediaTemplatesCreateSagas } from '../WeChat/RichmediaTemplates/Create/sagas';
74
+ import { v2WechatRichmediaTemplatesEditSagas } from '../WeChat/RichmediaTemplates/Edit/sagas';
75
+ import { v2GallerySagas } from '../Assets/Gallery/sagas';
76
+ import { v2FacebookSagas } from '../Facebook/sagas';
77
+ import { v2LineContainerSagas } from '../Line/Container/sagas';
78
+ import { v2ViberSagas } from '../Viber/sagas';
79
+ import { v2CapFacebookPreviewSagas } from '../CapFacebookPreview/sagas';
80
+ import { v2SmsTraiCreateSagas } from '../SmsTrai/Create/sagas';
81
+ import { v2WhatsappSagas } from '../Whatsapp/sagas';
82
+ import { v2ZaloSagas } from '../Zalo/saga';
83
+ import { v2InAppSagas } from '../InApp/sagas';
84
+ import { v2RcsSagas } from '../Rcs/sagas';
85
+ import navigationSagas from '@capillarytech/cap-ui-library/CapCollapsibleLeftNavigation/saga';
35
86
 
36
87
  const {CapCustomCardList} = CapCustomCard;
37
88
 
@@ -51,6 +102,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
51
102
  onChannelChange,
52
103
  showDisabledFBInfo,
53
104
  enableNewChannels = [],
105
+ currentOrgDetails = {},
106
+ cap = {},
54
107
  } = props;
55
108
 
56
109
  const defaultPanes = {
@@ -60,10 +113,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
60
113
  weChat: {content: <></>, tab: intl.formatMessage(messages.wechat), key: 'wechat'},
61
114
  //'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
62
115
  mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
116
+ inApp: { content: <div></div>, tab: intl.formatMessage(messages.inapp), key: INAPP },
63
117
  line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
64
118
  viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
65
119
  facebook: {content: <div></div>, tab: intl.formatMessage(messages.facebook), key: 'facebook'},
66
120
  whatsapp: { content: <></>, tab: intl.formatMessage(messages.whatsapp), key: WHATSAPP },
121
+ zalo: { content: <div></div>, tab: intl.formatMessage(messages.zalo), key: ZALO },
67
122
  };
68
123
  let filteredPanes = Object.keys(defaultPanes)
69
124
  .filter((key) => !channelsToHide.includes(key)).reduce((obj = [], key) => {
@@ -85,10 +140,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
85
140
 
86
141
  // we only show channels which other than commonChannels
87
142
  // if it is coming in enableNewChannels array
88
- filteredPanes.filter((item) => {
143
+ filteredPanes = filteredPanes.filter((item) => {
89
144
  const channel = item.key;
90
145
  if (!commonChannels.includes(channel)) {
91
- return !enableNewChannels.includes(channel.toUpperCase());
146
+ return enableNewChannels.includes(channel.toUpperCase());
92
147
  }
93
148
  return true;
94
149
  });
@@ -112,6 +167,15 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
112
167
  return pane;
113
168
  });
114
169
 
170
+ // This data will be available when it will be accessed in full mode
171
+ const { accessibleFeatures = [] } = currentOrgDetails || {};
172
+ // This data will be available when it will be accessed in library mode
173
+ const { currentOrgDetails: { accessibleFeatures: libModeAccessibleFeatures = [] } = {} } = cap || {};
174
+ const hideEngagementChannel = accessibleFeatures.includes(JP_LOCALE_HIDE_FEATURE) || libModeAccessibleFeatures.includes(JP_LOCALE_HIDE_FEATURE);
175
+ // Show only line and email channel content with both channel tabs if the JP_LOCALE_HIDE_FEATURE feature is enabled;
176
+ filteredPanes = hideEngagementChannel ? filteredPanes?.filter((pane) => [EMAIL, LINE, ASSETS].includes(pane?.key) && pane) : filteredPanes;
177
+ defaultChannel = hideEngagementChannel ? EMAIL : defaultChannel;
178
+
115
179
  const channel = ['sms', 'email', 'mobilepush', 'line', 'call_task'];
116
180
  if (!isEmpty(channelsToDisable)) {
117
181
  channel.some((ch) => {
@@ -136,7 +200,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
136
200
 
137
201
  componentDidMount() {
138
202
  const queryItems = getObjFromQueryParams(location.search);
139
-
140
203
  if (queryItems.channel === WHATSAPP) {
141
204
  this.channelChange(WHATSAPP);
142
205
  }
@@ -289,8 +352,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
289
352
  return this.props.Templates.loadingTemplates;
290
353
  }
291
354
  render() {
292
- const { isFullMode, className, cap = {}, authData = {}} = this.props;
293
- const { accessiblePermissions = []} = cap.user || authData.user || {};
355
+ const { isFullMode, className, cap = {}, Global = {}} = this.props;
356
+ const { accessiblePermissions = []} = cap.user || Global.user || {};
294
357
  let isCreativeAccessible = true;
295
358
  if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
296
359
  isCreativeAccessible = false;
@@ -341,15 +404,19 @@ TemplatesV2.propTypes = {
341
404
  authData: PropTypes.object,
342
405
  FTPMode: PropTypes.string,
343
406
  messageStrategy: PropTypes.string,
407
+ currentOrgDetails: PropTypes.object,
344
408
  };
345
409
 
346
410
  TemplatesV2.defaultProps = {
347
411
  isFullMode: true,
412
+ currentOrgDetails: {},
348
413
  };
349
414
 
350
415
  const mapStateToProps = createStructuredSelector({
416
+ Global: makeSelectAuthenticated(),
351
417
  Templates: makeSelectTemplates(),
352
418
  TemplatesList: makeSelectTemplatesResponse(),
419
+ currentOrgDetails: selectCurrentOrgDetails(),
353
420
  });
354
421
 
355
422
  function mapDispatchToProps(dispatch) {
@@ -359,4 +426,109 @@ function mapDispatchToProps(dispatch) {
359
426
  };
360
427
  }
361
428
 
362
- export default UserIsAuthenticated(connect(mapStateToProps, mapDispatchToProps)(injectIntl(withStyles(TemplatesV2, styles))));
429
+ const withConnect = connect(mapStateToProps, mapDispatchToProps);
430
+
431
+ const withTemplatesReducer = injectReducer({ key: 'templates', reducer });
432
+ const withCapReducer = injectReducer({ key: 'cap', reducer: v2CapReducer });
433
+ const withCreativesContainerReducer = injectReducer({ key: 'creativesContainer', reducer: v2CreativesContainerReducer });
434
+ const withSmsCreateReducer = injectReducer({ key: 'create', reducer: v2SmsCreateReducer });
435
+ const withSmsEditReducer = injectReducer({ key: 'edit', reducer: v2SmsEditReducer });
436
+ const withEmailReducer = injectReducer({ key: 'email', reducer: v2EmailReducer });
437
+ const withCallTaskReducer = injectReducer({ key: 'callTask', reducer: v2CallTaskReducer });
438
+ const withMobilePushCreateReducer = injectReducer({ key: 'mobileCreate', reducer: v2MobilePushCreateReducer });
439
+ const withMobilePushEditReducer = injectReducer({ key: 'mobileEdit', reducer: v2MobilePushEditReducer });
440
+ const withWeChatMapTemplatesReducer = injectReducer({ key: 'weChatMapTemplate', reducer: v2WechatMapTemplatesReducer });
441
+ const withWeChatRichmediaCreateReducer = injectReducer({ key: 'weChatRichmediaCreate', reducer: v2WechatRichmediaTemplatesCreateReducer });
442
+ const withWeChatRichmediaEditReducer = injectReducer({ key: 'weChatRichmediaEdit', reducer: v2WechatRichmediaTemplatesEditReducer });
443
+ const withGalleryReducer = injectReducer({ key: 'gallery', reducer: v2AssetsGalleryReducer });
444
+ const withFacebookReducer = injectReducer({ key: 'facebook', reducer: v2FacebookReducer });
445
+ const withLineContainerReducer = injectReducer({ key: 'lineCreate', reducer: v2LineContainerReducer });
446
+ const withViberReducer = injectReducer({ key: 'viber', reducer: v2ViberReducer });
447
+ const withCapFacebookPreviewReducer = injectReducer({ key: 'facebookPreview', reducer: v2CapFacebookPreviewReducer });
448
+ const withSmsTraiCreateReducer = injectReducer({ key: 'smsTrai', reducer: v2SmsTraiCreateReducer });
449
+ const withWhatsappReducer = injectReducer({ key: 'whatsapp', reducer: v2WhatsappReducer });
450
+ const withZaloReducer = injectReducer({ key: 'zalo', reducer: v2ZaloReducer });
451
+ const withInAppReducer = injectReducer({ key: 'inapp', reducer: v2InAppReducer });
452
+ const withRcsReducer = injectReducer({ key: 'rcs', reducer: v2RcsReducer });
453
+ const withNavigationReducer = injectReducer({ key: 'navigationBar', reducer: leftNavReducer });
454
+
455
+ const withSaga = injectSaga({ key: 'templates', saga: v2TemplateSaga });
456
+ const withCapSaga = injectSaga({ key: 'cap', saga: v2CapSagas });
457
+ const withGallerySaga = injectSaga({ key: 'gallery', saga: v2GallerySagas });
458
+ const withSmsCreateSaga = injectSaga({ key: 'create', saga: v2SmsCreateSagas });
459
+ const withSmsEditSaga = injectSaga({ key: 'edit', saga: v2SmsEditSagas });
460
+ const withEmailSaga = injectSaga({ key: 'email', saga: v2EmailSagas });
461
+ const withBeeEditorSaga = injectSaga({ key: 'beeEditor', saga: v2BeeEditionSagas });
462
+ const withCallTaskSagas = injectSaga({ key: 'callTask', saga: v2CallTaskSagas });
463
+ const withMobilePushCreateSaga = injectSaga({ key: 'mobileCreate', saga: v2MobilePushCreateSagas });
464
+ const withMobilePushEditSaga = injectSaga({ key: 'mobileEdit', saga: v2MobilePushEditSagas });
465
+ const withWeChatMapTemplatesSagas = injectSaga({ key: 'weChatMapTemplate', saga: v2WechatMapTemplatesSagas });
466
+ const withWeChatRichmediaCreateSaga = injectSaga({ key: 'weChatRichmediaCreate', saga: v2WechatRichmediaTemplatesCreateSagas });
467
+ const withWeChatRichmediaEditSaga = injectSaga({ key: 'weChatRichmediaEdit', saga: v2WechatRichmediaTemplatesEditSagas });
468
+ const withFacebookSagas = injectSaga({ key: 'facebook', saga: v2FacebookSagas });
469
+ const withLineContainerSagas = injectSaga({ key: 'lineCreate', saga: v2LineContainerSagas });
470
+ const withViberSagas = injectSaga({ key: 'viber', saga: v2ViberSagas });
471
+ const withCapFacebookPreviewSagas = injectSaga({ key: 'facebookPreview', saga: v2CapFacebookPreviewSagas });
472
+ const withSmsTraiCreateSagas = injectSaga({ key: 'smsTrai', saga: v2SmsTraiCreateSagas });
473
+ const withWhatsappSagas = injectSaga({ key: 'whatsapp', saga: v2WhatsappSagas });
474
+ const withZaloSagas = injectSaga({ key: 'zalo', saga: v2ZaloSagas });
475
+ const withInAppSagas = injectSaga({ key: 'inapp', saga: v2InAppSagas });
476
+ const withRcsSagas = injectSaga({ key: 'rcs', saga: v2RcsSagas });
477
+ const withNavigationSaga = injectSaga({
478
+ key: 'navigation',
479
+ saga: function* navigationConfigSaga() {
480
+ yield all(navigationSagas.map(saga => saga.call()));
481
+ },
482
+ });
483
+
484
+ export default compose(
485
+ UserIsAuthenticated,
486
+ withSaga,
487
+ withCapSaga,
488
+ withGallerySaga,
489
+ withSmsCreateSaga,
490
+ withSmsEditSaga,
491
+ withEmailSaga,
492
+ withBeeEditorSaga,
493
+ withCallTaskSagas,
494
+ withMobilePushCreateSaga,
495
+ withMobilePushEditSaga,
496
+ withWeChatMapTemplatesSagas,
497
+ withWeChatRichmediaCreateSaga,
498
+ withWeChatRichmediaEditSaga,
499
+ withFacebookSagas,
500
+ withLineContainerSagas,
501
+ withViberSagas,
502
+ withCapFacebookPreviewSagas,
503
+ withSmsTraiCreateSagas,
504
+ withWhatsappSagas,
505
+ withZaloSagas,
506
+ withInAppSagas,
507
+ withRcsSagas,
508
+ withNavigationSaga,
509
+
510
+ withTemplatesReducer,
511
+ withCapReducer,
512
+ withCreativesContainerReducer,
513
+ withSmsCreateReducer,
514
+ withSmsEditReducer,
515
+ withEmailReducer,
516
+ withCallTaskReducer,
517
+ withMobilePushCreateReducer,
518
+ withMobilePushEditReducer,
519
+ withWeChatMapTemplatesReducer,
520
+ withWeChatRichmediaCreateReducer,
521
+ withWeChatRichmediaEditReducer,
522
+ withGalleryReducer,
523
+ withFacebookReducer,
524
+ withLineContainerReducer,
525
+ withViberReducer,
526
+ withCapFacebookPreviewReducer,
527
+ withSmsTraiCreateReducer,
528
+ withWhatsappReducer,
529
+ withZaloReducer,
530
+ withInAppReducer,
531
+ withRcsReducer,
532
+ withNavigationReducer,
533
+ withConnect,
534
+ )(injectIntl(withStyles(TemplatesV2, styles)));
@@ -78,4 +78,12 @@ export default defineMessages({
78
78
  id: `creatives.containersV2.TemplatesV2.facebookDisableinfo`,
79
79
  defaultMessage: 'Please integrate Facebook page ID & page name to enable this option.',
80
80
  },
81
+ zalo: {
82
+ id: `creatives.containersV2.TemplatesV2.zalo`,
83
+ defaultMessage: 'Zalo',
84
+ },
85
+ inapp: {
86
+ id: `creatives.containersV2.TemplatesV2.inapp`,
87
+ defaultMessage: 'In app message',
88
+ },
81
89
  });