@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
@@ -82,4 +82,12 @@ export default defineMessages({
82
82
  id: 'creatives.componentsV2.TemplatePreview.videoPreviewTooltip',
83
83
  defaultMessage: "This is just for preview purposes, video cannot be played here",
84
84
  },
85
+ previewUrlMetaImage: {
86
+ id: 'creatives.componentsV2.TemplatePreview.previewUrlMetaImage',
87
+ defaultMessage: 'Preview url meta image',
88
+ },
89
+ addToCart: {
90
+ id: `creatives.componentsV2.TemplatePreview.addToCart`,
91
+ defaultMessage: 'Add to cart',
92
+ },
85
93
  });
@@ -98,13 +98,6 @@ exports[`Test Templates container Should render correct preview component for wh
98
98
  >
99
99
  <CapIcon
100
100
  size="xs"
101
- svgProps={
102
- Object {
103
- "style": Object {
104
- "marginRight": "4px",
105
- },
106
- }
107
- }
108
101
  type="call"
109
102
  />
110
103
  Call
@@ -115,13 +108,6 @@ exports[`Test Templates container Should render correct preview component for wh
115
108
  >
116
109
  <CapIcon
117
110
  size="xs"
118
- svgProps={
119
- Object {
120
- "style": Object {
121
- "marginRight": "4px",
122
- },
123
- }
124
- }
125
111
  type="launch"
126
112
  />
127
113
  Visit
@@ -292,3 +278,50 @@ exports[`Test Templates container Should render correct preview component for wh
292
278
  </CapColumn>
293
279
  </CapRow>
294
280
  `;
281
+
282
+ exports[`Test Templates container Should render correct preview component for zalo channel 1`] = `
283
+ <CapRow>
284
+ <CapColumn
285
+ span={24}
286
+ >
287
+ <div
288
+ className="preview-container "
289
+ >
290
+ <CapRow
291
+ className="zalo-preview-container zalo-preview-container-campaign"
292
+ >
293
+ <CapRow>
294
+ <CapLabel
295
+ className="preview-head"
296
+ type="label1"
297
+ >
298
+ Preview
299
+ </CapLabel>
300
+ </CapRow>
301
+ <CapRow>
302
+ <CapLabel
303
+ className="preview-text"
304
+ type="label1"
305
+ >
306
+ Preview of the template is generated on the Zalo platform. Click on ‘Open preview’ to view it in a new tab
307
+ </CapLabel>
308
+ </CapRow>
309
+ <CapRow>
310
+ <CapLabel
311
+ className="preview-link"
312
+ data-testid="preview-link-button"
313
+ onClick={[Function]}
314
+ type="label1"
315
+ >
316
+ Open Preview
317
+
318
+ <CapIcon
319
+ type="open-in-new-light"
320
+ />
321
+ </CapLabel>
322
+ </CapRow>
323
+ </CapRow>
324
+ </div>
325
+ </CapColumn>
326
+ </CapRow>
327
+ `;
@@ -11,6 +11,7 @@ describe('Test Templates container', () => {
11
11
  content,
12
12
  whatsappAccountName,
13
13
  whatsappContentLen,
14
+ templateData
14
15
  ) => {
15
16
  renderedComponent = shallowWithIntl(
16
17
  <TemplatePreview
@@ -18,6 +19,7 @@ describe('Test Templates container', () => {
18
19
  content={content}
19
20
  whatsappAccountName={whatsappAccountName}
20
21
  whatsappContentLen={whatsappContentLen}
22
+ templateData={templateData}
21
23
  />,
22
24
  );
23
25
  };
@@ -61,6 +63,13 @@ describe('Test Templates container', () => {
61
63
  renderFunction('whatsapp', {}, 'test', 0);
62
64
  expect(renderedComponent).toMatchSnapshot();
63
65
  });
66
+ it('Should render correct preview component for zalo channel', () => {
67
+ renderFunction('zalo', {}, '', '', {
68
+ templatePreviewUrl: 'https://account.zalo.cloud/znspreview/-CL4HT4Hwza4v5ocK3pdVQ=='
69
+ });
70
+ expect(renderedComponent).toMatchSnapshot();
71
+ });
72
+
64
73
  it('Should render correct preview component for rcs channel', () => {
65
74
  renderFunction('rcs', {
66
75
  rcsPreviewContent: {
@@ -1,6 +1,7 @@
1
1
  @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
2
 
3
- .whatsapp-status-container {
3
+ .whatsapp-status-container,
4
+ .zalo-status-container {
4
5
  margin-top: $CAP_SPACE_12;
5
6
  width: 150%;
6
7
  height: 20px;
@@ -12,4 +13,10 @@
12
13
  .whatsapp-category-tag {
13
14
  margin-left: $CAP_SPACE_08;
14
15
  }
16
+ }
17
+
18
+ .zalo-status-color {
19
+ div {
20
+ color: $CAP_G17;
21
+ }
15
22
  }
@@ -20,12 +20,11 @@ export const getLoyaltyTopbarMenuDataValue = () => [
20
20
  link: 'loyalty/ui/',
21
21
  key: 'programs',
22
22
  },
23
- //commented as promotions are not supported in loyalty v2 flow
24
- // {
25
- // label: <FormattedMessage {...globalMessages.promotions} />,
26
- // link: 'loyalty/ui/promotions/',
27
- // key: 'promotions',
28
- // },
23
+ {
24
+ label: <FormattedMessage {...globalMessages.promotions} />,
25
+ link: 'loyalty/ui/promotions/list',
26
+ key: 'promotions',
27
+ },
29
28
  {
30
29
  label: <FormattedMessage {...globalMessages.creatives} />,
31
30
  link: '/creatives/ui/v2/loyalty',
@@ -50,6 +49,13 @@ export const VIBER = 'viber';
50
49
  export const FACEBOOK = 'facebook';
51
50
  export const WHATSAPP = 'whatsapp';
52
51
  export const RCS = 'rcs';
52
+ export const LINE = 'line';
53
+ export const EMAIL = 'email';
54
+ export const ASSETS = 'assets';
55
+ export const ZALO = 'zalo';
56
+ export const INAPP = 'inapp';
57
+
58
+ export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
53
59
 
54
60
  export const TRACK_EDIT_SMS = 'editSms';
55
61
  export const TRACK_EDIT_EMAIL = 'editEmail';
@@ -1,5 +1,4 @@
1
1
  import { call, put, takeLatest } from 'redux-saga/effects';
2
- // import { LOCATION_CHANGE } from 'react-router-redux';
3
2
  // import { schema, normalize } from 'normalizr';
4
3
  import * as Api from '../../services/api';
5
4
  import * as types from './constants';
@@ -307,6 +307,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
307
307
  const currentChannel = 'gallery';
308
308
  const { searchLoader, searchText } = this.state;
309
309
  const cardDataList = templates?.length ? _.map(templates, (template) => {
310
+ template.name = commonUtil.getDecodedFileName(template?.name);
310
311
  const templateData =
311
312
  {
312
313
  key: `${currentChannel}-card-${template.name}`,
@@ -1,5 +1,4 @@
1
- import { take, call, put, takeLatest, cancel } from 'redux-saga/effects';
2
- import { LOCATION_CHANGE } from 'react-router-redux';
1
+ import { call, put, takeLatest, all} from 'redux-saga/effects';
3
2
  import * as Api from '../../../services/api';
4
3
  import * as types from './constants';
5
4
 
@@ -52,27 +51,19 @@ export function* fetchUserList() {
52
51
 
53
52
 
54
53
  function* watchGetAllAssets() {
55
- const watcher = yield takeLatest(types.GET_ALL_ASSETS_REQUEST, getAllAssets);
56
- yield take(LOCATION_CHANGE);
57
- yield cancel(watcher);
54
+ yield takeLatest(types.GET_ALL_ASSETS_REQUEST, getAllAssets);
58
55
  }
59
56
 
60
57
  function* watchDeleteAssetById() {
61
- const watcher = yield takeLatest(types.DELETE_ASSET_REQUEST, deleteAssetById);
62
- yield take(LOCATION_CHANGE);
63
- yield cancel(watcher);
58
+ yield takeLatest(types.DELETE_ASSET_REQUEST, deleteAssetById);
64
59
  }
65
60
 
66
61
  function* watchUploadAsset() {
67
- const watcher = yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
68
- yield take(LOCATION_CHANGE);
69
- yield cancel(watcher);
62
+ yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
70
63
  }
71
64
 
72
65
  function* watchGetUserList() {
73
- const watcher = yield takeLatest(types.GET_USER_LIST_REQUEST, fetchUserList);
74
- yield take(LOCATION_CHANGE);
75
- yield cancel(watcher);
66
+ yield takeLatest(types.GET_USER_LIST_REQUEST, fetchUserList);
76
67
  }
77
68
 
78
69
  // All sagas to be loaded
@@ -82,3 +73,13 @@ export default [
82
73
  watchDeleteAssetById,
83
74
  watchGetUserList,
84
75
  ];
76
+
77
+
78
+ export function* v2GallerySagas() {
79
+ yield all([
80
+ watchGetAllAssets(),
81
+ watchUploadAsset(),
82
+ watchDeleteAssetById(),
83
+ watchGetUserList(),
84
+ ]);
85
+ }
@@ -76,13 +76,15 @@ function BeeEditor(props) {
76
76
  'en': 'en',
77
77
  'zh-cn': 'zh',
78
78
  'zh': 'zh',
79
+ 'jp': 'jp',
80
+ 'ja-JP': 'ja-JP',
79
81
  };
80
82
  const user = localStorage.getItem('user');
81
83
  let locale = 'en';
82
84
  if (user && JSON.parse(user).lang) {
83
85
  locale = JSON.parse(user).lang;
84
86
  }
85
- const defaultFormattedUrl = locale !== DEFAULT_LOCALE && ['zh-cn', 'zh'].includes(locale)
87
+ const defaultFormattedUrl = locale !== DEFAULT_LOCALE && ['zh-cn', 'zh', 'jp', 'ja-JP'].includes(locale)
86
88
  ? `${API_ENDPOINT}/common/getBEECustomLangunage?langid=${MAPPED_LOCALE[locale]}`
87
89
  : "";
88
90
  useEffect(() => {
@@ -1,5 +1,4 @@
1
- import { take, cancel, call, put, takeLatest } from 'redux-saga/effects';
2
- import { LOCATION_CHANGE } from 'react-router-redux';
1
+ import { call, put, takeLatest, all } from 'redux-saga/effects';
3
2
  import * as Api from '../../services/api';
4
3
  import * as types from './constants';
5
4
 
@@ -22,12 +21,16 @@ export function* createCustomRow({data, callback}) {
22
21
  }
23
22
 
24
23
  function* watchCreateCustomRow() {
25
- const watcher = yield takeLatest(types.CREATE_CUSTOM_ROW_REQUEST, createCustomRow);
26
- yield take(LOCATION_CHANGE);
27
- yield cancel(watcher);
24
+ yield takeLatest(types.CREATE_CUSTOM_ROW_REQUEST, createCustomRow);
28
25
  }
29
26
 
30
27
  // All sagas to be loaded
31
28
  export default [
32
29
  watchCreateCustomRow,
33
30
  ];
31
+
32
+ export function* v2BeeEditionSagas() {
33
+ yield all([
34
+ watchCreateCustomRow(),
35
+ ]);
36
+ }
@@ -1,4 +1,4 @@
1
- // import { take, call, put, select } from 'redux-saga/effects';
1
+ import { all } from 'redux-saga/effects';
2
2
 
3
3
  // Individual exports for testing
4
4
  export function* defaultSaga() {
@@ -9,3 +9,9 @@ export function* defaultSaga() {
9
9
  export default [
10
10
  defaultSaga,
11
11
  ];
12
+
13
+ export function* v2CallTaskSagas() {
14
+ yield all([
15
+ defaultSaga(),
16
+ ]);
17
+ }
@@ -73,3 +73,7 @@ export function clearTopbarMenuData() {
73
73
  type: types.CLEAR_TOPBAR_MENU_DATA,
74
74
  };
75
75
  }
76
+
77
+ export const getSupportVideosConfig = () => ({
78
+ type: types.GET_SUPPORT_VIDEOS_CONFIG_REQUEST,
79
+ });
@@ -39,4 +39,23 @@ export const ORG_REFRESH_SEC = 10;
39
39
  export const ORG_CHANGED = 'ORG_CHANGED';
40
40
 
41
41
  export const ENABLE_AI_SUGGESTIONS = 'ENABLE_AI_SUGGESTIONS';
42
-
42
+ export const AI_CONTENT_BOT_DISABLED = 'AI_CONTENT_BOT_DISABLED';
43
+ export const AI_DOCUMENTATION_BOT_ENABLED = 'AI_DOCUMENTATION_BOT_ENABLED';
44
+ export const ERROR_IN_FETCHING_TAGS = 'Error in fetching tags';
45
+ export const ENABLE_NEW_LEFT_NAVIGATION = 'ENABLE_NEW_LEFT_NAVIGATION';
46
+ export const AI_DOCUMENTATION_BOT_DISABLED = 'AI_DOCUMENTATION_BOT_DISABLED';
47
+
48
+ export const GET_SUPPORT_VIDEOS_CONFIG_REQUEST =
49
+ 'cap/GET_SUPPORT_VIDEOS_CONFIG_REQUEST';
50
+ export const GET_SUPPORT_VIDEOS_CONFIG_SUCCESS =
51
+ 'cap/GET_SUPPORT_VIDEOS_CONFIG_SUCCESS';
52
+ export const GET_SUPPORT_VIDEOS_CONFIG_FAILURE =
53
+ 'cap/GET_SUPPORT_VIDEOS_CONFIG_FAILURE';
54
+
55
+ export const REQUEST = 'REQUEST';
56
+ export const SUCCESS = 'SUCCESS';
57
+ export const FAILURE = 'FAILURE';
58
+
59
+ export const ENABLE_PRODUCT_SUPPORT_VIDEOS = 'ENABLE_PRODUCT_SUPPORT_VIDEOS';
60
+ export const DEFAULT = 'default';
61
+ export const DEFAULT_MODULE = 'creatives';
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import Helmet from 'react-helmet';
4
4
  import { connect } from 'react-redux';
5
5
  import { CapNotification, CapModal, CapSnackBar, CapSomethingWentWrong } from '@capillarytech/cap-ui-library';
6
- import { bindActionCreators } from 'redux';
6
+ import { bindActionCreators, compose } from 'redux';
7
7
  import styled from 'styled-components';
8
8
  import { createStructuredSelector } from 'reselect';
9
9
  import _ from 'lodash';
@@ -12,7 +12,7 @@ import moment from 'moment';
12
12
  import { GA, multipleOrgSwitch, utilsSessionStorageApi, Auth } from '@capillarytech/cap-ui-utils';
13
13
  import { injectIntl, FormattedMessage, intlShape, FormattedHTMLMessage } from 'react-intl';
14
14
  import messages from './messages';
15
- import { makeSelectAuthenticated, makeSelectUser } from './selectors';
15
+ import { makeSelectAuthenticated, makeSelectUser, makeSelectDemoVideoAndLink } from './selectors';
16
16
  import * as actions from './actions';
17
17
  import * as locationActions from '../LanguageProvider/actions';
18
18
  import * as appActions from '../App/actions';
@@ -21,13 +21,27 @@ import NavigationBar from '../../v2Components/NavigationBar';
21
21
  import { engagePlusPublicPath, publicPath } from '../../config/path';
22
22
  import { GTM_TRACKING_ID, CREATIVES_UI_VIEW, FAILURE } from '../App/constants';
23
23
  import { makeSelectLocale } from '../../v2Containers/LanguageProvider/selectors';
24
+ import CapSupportVideosWrapper from '@capillarytech/cap-ui-library/CapSupportVideosWrapper';
25
+ import { replaceDynamicAndCompare } from '@capillarytech/cap-ui-library/CapSupportVideosWrapper/utils';
24
26
  import {
25
27
  ORG_SETTINGS_URL,
26
28
  CAMPAIGN_SETTINGS_URL,
27
29
  ORG_REFRESH_SEC,
28
30
  ORG_CHANGED,
31
+ REQUEST,
32
+ DEFAULT,
33
+ ENABLE_PRODUCT_SUPPORT_VIDEOS,
34
+ ENABLE_NEW_LEFT_NAVIGATION,
29
35
  } from './constants';
30
36
  import './_cap.scss';
37
+ import { Switch } from 'react-router';
38
+ import componentRoutes from '../../../app/routes';
39
+ import RenderRoute from '../../v2Components/RenderRoute';
40
+ import injectReducer from '../../utils/injectReducer';
41
+ import injectSaga from '../../utils/injectSaga';
42
+ import reducer from './reducer';
43
+ import { v2CapSagas } from './sagas';
44
+
31
45
  const gtm = window.dataLayer || [];
32
46
  const {
33
47
  logNewTab,
@@ -50,6 +64,17 @@ const CapWrapper = styled.div`
50
64
  `;
51
65
  GA.initialize({ accessKey: GTM_TRACKING_ID, trackUIError: true, trackLoadPerformance: 'creatives' });
52
66
 
67
+ const MainWrapper = styled.div`
68
+ position: relative;
69
+ min-height: calc(100vh - 5.29rem);
70
+ top: ${(props) => (props.isLatestLeftNavigationEnabled ? '1.72rem' : '5.29rem')};
71
+ `;
72
+
73
+ const ContentWrapper = styled.div`
74
+ && {
75
+ margin-left: ${(props) => (props.isLatestLeftNavigationEnabled ? (props.leftNavbarExpanded ? '17rem' : '4.475rem') : 0)};
76
+ }
77
+ `;
53
78
 
54
79
  export class Cap extends React.Component { // eslint-disable-line react/prefer-stateless-function
55
80
 
@@ -63,6 +88,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
63
88
  showRefreshModal: false,
64
89
  showOrgChangeModal: false,
65
90
  localStorageOrgInfo: { oldValue: null, newValue: null },
91
+ leftNavbarExpanded: false,
66
92
  };
67
93
  this.changeOrg = this.changeOrg.bind(this);
68
94
  this.logout = this.logout.bind(this);
@@ -81,7 +107,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
81
107
  }
82
108
  const userGtmData = this.getUserGtmData();
83
109
  this.setDimensionData(userGtmData);
84
- gtm.push({...userGtmData, event: 'userAuthenticated'});
110
+ gtm.push({ ...userGtmData, event: 'userAuthenticated' });
85
111
  Auth.initialize({
86
112
  permissions: userData.accessiblePermissions,
87
113
  isCapUser: userData.isCapUser,
@@ -91,7 +117,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
91
117
  });
92
118
  this.props.actions.getTopbarMenuData(parentModule);
93
119
  if (this.props.Global.orgID !== undefined) {
94
- gtm.push({orgId: this.props.Global.orgID});
120
+ gtm.push({ orgId: this.props.Global.orgID });
95
121
  }
96
122
  if (this.props.Global.isLoggedIn) {
97
123
  if (this.props.Global.user && Object.keys(this.props.Global.user).length) {
@@ -109,7 +135,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
109
135
  }
110
136
  locale = this.getMappedLocale(locale);
111
137
  //locale = 'zh';
112
-
138
+ this.props.actions.getSupportVideosConfig();
113
139
  moment.locale(locale);
114
140
  window.addEventListener('storage', this.handleStorageChange, false);
115
141
  document.addEventListener(
@@ -129,7 +155,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
129
155
  this.navigateToDashboard();
130
156
  }
131
157
 
132
- const callBack = nextProps.routeParams.callbackUrl ? decodeURIComponent(nextProps.routeParams.callbackUrl) : "";
158
+ const callBack = nextProps?.routeParams?.callbackUrl ? decodeURIComponent(nextProps?.routeParams?.callbackUrl) : "";
133
159
  if (nextProps.Global.error) {
134
160
  const locationValue = `${window.location.origin}${callBack}?flash=${nextProps.Global.error}`;
135
161
  window.location.replace(locationValue);
@@ -241,7 +267,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
241
267
  navigateToDashboard() {
242
268
  const dashboardUrl = process.env.NODE_ENV === 'production' ? config.production.dashboard_url_v2 : config.development.dashboard_url_v2;
243
269
  this.props.router.push({ pathname: dashboardUrl, state: {} });
244
- this.props.router.go(dashboardUrl);
270
+ this.props.router.go();
245
271
  }
246
272
 
247
273
  logout() {
@@ -413,6 +439,50 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
413
439
  this.setState({ showOrgChangeModal: false });
414
440
  };
415
441
 
442
+ renderNavigationComponent(component) {
443
+ const { demoVideoAndLinkJSONData: {
444
+ demoVideoAndLinkJSON = {},
445
+ demoVideoAndLinkJSONStatus,
446
+ } = {},
447
+ Global,
448
+ } = this.props;
449
+ const { currentOrgDetails = {}, user = {} } =
450
+ Global || {};
451
+ const { lang: userLocale = '' } = user;
452
+ let wrapperComponent = <>{component}</>;
453
+ const {
454
+ basicDetails: { base_language: orgLocale = '' } = {},
455
+ accessibleFeatures = [],
456
+ } = currentOrgDetails || {};
457
+ if (
458
+ accessibleFeatures.includes(
459
+ ENABLE_PRODUCT_SUPPORT_VIDEOS
460
+ ) &&
461
+ demoVideoAndLinkJSON?.is_active &&
462
+ demoVideoAndLinkJSONStatus !== REQUEST
463
+ ) {
464
+ const demoLocale = userLocale || orgLocale || DEFAULT;
465
+ const JSONInContext = demoVideoAndLinkJSON?.json_config;
466
+ const currentPathJSON = JSONInContext?.find((routeEle) =>
467
+ replaceDynamicAndCompare(location?.pathname, routeEle?.route),
468
+ );
469
+ const targetElements = currentPathJSON?.target_elements || {};
470
+ wrapperComponent = (
471
+ <CapSupportVideosWrapper
472
+ targetElements={targetElements}
473
+ locale={demoLocale}
474
+ >
475
+ {component}
476
+ </CapSupportVideosWrapper>
477
+ );
478
+ }
479
+ return wrapperComponent;
480
+ }
481
+
482
+ handleLeftNavBarExpanded = (leftNavbarExpandedProp) => {
483
+ this.setState({leftNavbarExpanded: leftNavbarExpandedProp})
484
+ }
485
+
416
486
  render() {
417
487
  const { Global, location } = this.props;
418
488
  const { topbarMenuData, isLoggedIn, currentOrgDetails = {}, getUserDataStatus, getUserDataCode } = Global;
@@ -420,7 +490,9 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
420
490
  const type = this.props.location.query.type;
421
491
  const toastMessages = this.props.Global.messages;
422
492
  const { isCreativesAccessible, showOrgChangeModal, showRefreshModal } = this.state;
423
-
493
+ const isLatestLeftNavigationEnabled = currentOrgDetails?.accessibleFeatures?.includes(
494
+ ENABLE_NEW_LEFT_NAVIGATION,
495
+ );
424
496
  return (
425
497
  <CapWrapper>
426
498
  { this.props.loader.localeLoading || this.props.Global.fetching_userdata ?
@@ -441,9 +513,10 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
441
513
  {
442
514
  getUserDataStatus === FAILURE &&
443
515
  getUserDataCode !== 401 &&
444
- <CapSomethingWentWrong url={`${window.location.origin}${publicPath}v2`} />
516
+ <CapSomethingWentWrong url={`${window.location.origin}${publicPath}/v2`} />
445
517
  }
446
518
  {isLoggedIn && type !== 'embedded' ?
519
+ this.renderNavigationComponent(
447
520
  <NavigationBar
448
521
  userData={Global}
449
522
  changeOrg={this.changeOrg}
@@ -455,13 +528,29 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
455
528
  topbarMenuData={topbarMenuDataOptions}
456
529
  location={location}
457
530
  campaignOrgV2Status={currentOrgDetails.org_campaign_v2_status}
458
- /> : ''}
459
- <div className="main" style={{minHeight: 'calc(100vh - 74px', position: 'relative', top: '74px'}}>
460
-
461
- <div className="main-content">
462
- {React.Children.toArray(this.props.children)}
463
- </div>
464
- </div>
531
+ handleLeftNavBarExpanded={this.handleLeftNavBarExpanded}
532
+ leftNavbarExpandedProp={this.state.leftNavbarExpanded}
533
+ />) : ''}
534
+ <MainWrapper isLatestLeftNavigationEnabled={isLatestLeftNavigationEnabled} className="main">
535
+
536
+ <ContentWrapper
537
+ className={`main-content ${this.state.leftNavbarExpanded ? "contet-width-collapse" : "content-width-expanded"}`}
538
+ isLatestLeftNavigationEnabled={isLatestLeftNavigationEnabled}
539
+ leftNavbarExpanded={this.state.leftNavbarExpanded}
540
+ >
541
+ <Switch>
542
+ {componentRoutes.map(routeProps => {
543
+ return (
544
+ <RenderRoute
545
+ {...routeProps}
546
+ key={routeProps.path}
547
+ isLoggedIn={isLoggedIn}
548
+ />
549
+ )}
550
+ )}
551
+ </Switch>
552
+ </ContentWrapper>
553
+ </MainWrapper>
465
554
  </div>
466
555
  {(toastMessages && toastMessages.length > 0) &&
467
556
  toastMessages.map((message) => {
@@ -488,12 +577,14 @@ Cap.propTypes = {
488
577
  locationActions: PropTypes.object,
489
578
  location: PropTypes.object,
490
579
  intl: intlShape.isRequired,
580
+ demoVideoAndLinkJSONData: PropTypes.object,
491
581
  };
492
582
 
493
583
  const mapStateToProps = createStructuredSelector({
494
584
  Global: makeSelectAuthenticated(),
495
585
  User: makeSelectUser(),
496
586
  loader: makeSelectLocale(),
587
+ demoVideoAndLinkJSONData: makeSelectDemoVideoAndLink(),
497
588
  });
498
589
 
499
590
  function mapDispatchToProps(dispatch) {
@@ -504,4 +595,12 @@ function mapDispatchToProps(dispatch) {
504
595
  };
505
596
  }
506
597
 
507
- export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(Cap));
598
+ const withConnect = connect(mapStateToProps, mapDispatchToProps);
599
+ const withReducer = injectReducer({ key: 'cap', reducer });
600
+ const withSaga = injectSaga({ key: 'cap', saga: v2CapSagas });
601
+
602
+ export default compose(
603
+ withReducer,
604
+ withSaga,
605
+ withConnect,
606
+ )(injectIntl(Cap));
@@ -201,5 +201,13 @@ export default defineMessages({
201
201
  id: `creatives.componentsV2.unbalanacedCurlyBraces`,
202
202
  defaultMessage: 'Invalid label, please close all curly braces'
203
203
  },
204
+ "copyOf": {
205
+ id: 'creatives.componentsV2.copyOf',
206
+ defaultMessage: 'Copy of',
207
+ },
208
+ autofill:{
209
+ id: 'creatives.componentsV2.autofill',
210
+ defaultMessage: 'Autofill',
211
+ },
204
212
  });
205
213
 
@@ -79,10 +79,12 @@ function capReducer(state = fromJS(initialState.cap), action) {
79
79
  .set('getUserDataCode', action.status);
80
80
  case types.GET_SCHEMA_FOR_ENTITY_REQUEST:
81
81
  return state
82
- .set('fetchingSchema', true);
82
+ .set('fetchingSchema', true)
83
+ .set('fetchingSchemaError', false);
83
84
  case types.GET_SCHEMA_FOR_ENTITY_FAILURE:
84
85
  return state
85
- .set('fetchingSchema', false);
86
+ .set('fetchingSchema', false)
87
+ .set('fetchingSchemaError', true);
86
88
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
87
89
  const stateMeta = state.get('metaEntities');
88
90
  return state
@@ -90,7 +92,8 @@ function capReducer(state = fromJS(initialState.cap), action) {
90
92
  .set('metaEntities', {
91
93
  layouts: action.data && action.entityType === 'LAYOUT' ? action.data.metaEntities : stateMeta.layouts,
92
94
  tags: action.data && action.entityType === 'TAG' ? action.data.metaEntities : stateMeta.tags,
93
- });
95
+ })
96
+ .set('fetchingSchemaError', false);
94
97
  }
95
98
  case types.CLEAR_META_ENTITIES:
96
99
  return state.set('metaEntities', {
@@ -124,6 +127,18 @@ function capReducer(state = fromJS(initialState.cap), action) {
124
127
  .set('tagsToDisable', action.tagsToDisable)
125
128
  .set('parentTagsToDisable', action.parentTagsToDisable);
126
129
  }
130
+ case types.GET_SUPPORT_VIDEOS_CONFIG_REQUEST:
131
+ return state
132
+ .set('demoVideoAndLinkJSONStatus', types.REQUEST)
133
+ .set('demoVideoAndLinkJSON', {});
134
+ case types.GET_SUPPORT_VIDEOS_CONFIG_SUCCESS:
135
+ return state
136
+ .set('demoVideoAndLinkJSONStatus', types.SUCCESS)
137
+ .set('demoVideoAndLinkJSON', action?.result);
138
+ case types.GET_SUPPORT_VIDEOS_CONFIG_FAILURE:
139
+ return state
140
+ .set('demoVideoAndLinkJSONStatus', types.FAILURE)
141
+ .set('demoVideoAndLinkJSONError', action?.error);
127
142
  default:
128
143
  return state;
129
144
  }