@capillarytech/creatives-library 2.0.69 → 2.0.71

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 (391) hide show
  1. package/app.js +1 -1
  2. package/components/Ckeditor/index.js +2 -1
  3. package/components/FormBuilder/index.js +25 -10
  4. package/components/Header/index.js +3 -1
  5. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +38 -3
  6. package/components/TemplatePreview/index.js +45 -51
  7. package/components/TemplatePreview/messages.js +1 -1
  8. package/containers/Cap/actions.js +0 -5
  9. package/containers/Cap/reducer.js +1 -1
  10. package/containers/Cap/selectors.js +0 -13
  11. package/containers/Ebill/index.js +1 -2
  12. package/containers/Email/_email.scss +1 -0
  13. package/containers/Email/actions.js +3 -8
  14. package/containers/Email/constants.js +0 -1
  15. package/containers/Email/index.js +947 -322
  16. package/containers/Email/reducer.js +0 -3
  17. package/containers/Email/sagas.js +6 -3
  18. package/containers/Email/selectors.js +1 -4
  19. package/containers/Line/Create/index.js +1 -2
  20. package/containers/Line/Edit/_lineEdit.scss +4 -0
  21. package/containers/Line/Edit/index.js +1 -3
  22. package/containers/MobilePush/Create/_mobilePushCreate.scss +3 -12
  23. package/containers/MobilePush/Create/actions.js +0 -6
  24. package/containers/MobilePush/Create/constants.js +0 -1
  25. package/containers/MobilePush/Create/index.js +1133 -628
  26. package/containers/MobilePush/Create/messages.js +1 -5
  27. package/containers/MobilePush/Create/reducer.js +0 -2
  28. package/containers/MobilePush/Create/selectors.js +3 -3
  29. package/containers/MobilePush/Edit/_mobilePushCreate.scss +3 -9
  30. package/containers/MobilePush/Edit/index.js +1127 -393
  31. package/containers/MobilePush/Edit/messages.js +0 -4
  32. package/containers/MobilePush/Edit/reducer.js +1 -2
  33. package/containers/MobilePush/Edit/selectors.js +3 -6
  34. package/containers/Sms/Create/_smsCreate.scss +2 -1
  35. package/containers/Sms/Create/actions.js +4 -4
  36. package/containers/Sms/Create/index.js +570 -102
  37. package/containers/Sms/Create/sagas.js +2 -1
  38. package/containers/Sms/Edit/actions.js +5 -10
  39. package/containers/Sms/Edit/constants.js +0 -1
  40. package/containers/Sms/Edit/index.js +548 -103
  41. package/containers/Sms/Edit/reducer.js +0 -2
  42. package/containers/Sms/Edit/sagas.js +3 -1
  43. package/containers/TagList/index.js +3 -3
  44. package/containers/Templates/actions.js +1 -3
  45. package/containers/Templates/index.js +299 -268
  46. package/containers/Templates/messages.js +90 -122
  47. package/containers/Templates/reducer.js +3 -3
  48. package/containers/Templates/sagas.js +1 -5
  49. package/containers/Templates/selectors.js +1 -41
  50. package/containers/WeChat/MapTemplates/index.js +3 -4
  51. package/containers/WeChat/RichmediaTemplates/Create/index.js +18 -4
  52. package/containers/WeChat/RichmediaTemplates/Create/messages.js +4 -0
  53. package/containers/WeChat/RichmediaTemplates/Edit/index.js +3 -1
  54. package/containers/WeChat/RichmediaTemplates/View/index.js +3 -1
  55. package/index.js +31 -31
  56. package/initialState.js +6 -0
  57. package/package.json +3 -3
  58. package/routes.js +24 -19
  59. package/services/api.js +6 -2
  60. package/services/getSchema.js +18 -0
  61. package/v2Containers/App/actions.js +7 -0
  62. package/v2Containers/App/constants.js +3 -0
  63. package/v2Containers/App/reducer.js +19 -0
  64. package/v2Containers/App/sagas.js +26 -0
  65. package/v2Containers/App/selectors.js +25 -0
  66. package/v2Containers/App/tests/actions.test.js +18 -0
  67. package/v2Containers/App/tests/reducer.test.js +9 -0
  68. package/v2Containers/App/tests/sagas.test.js +15 -0
  69. package/v2Containers/App/tests/selectors.test.js +10 -0
  70. package/v2Containers/Assets/Gallery/_gallery.scss +0 -0
  71. package/v2Containers/Assets/Gallery/actions.js +37 -0
  72. package/v2Containers/Assets/Gallery/constants.js +23 -0
  73. package/v2Containers/Assets/Gallery/index.js +479 -0
  74. package/v2Containers/Assets/Gallery/messages.js +97 -0
  75. package/v2Containers/Assets/Gallery/reducer.js +81 -0
  76. package/v2Containers/Assets/Gallery/sagas.js +84 -0
  77. package/v2Containers/Assets/Gallery/selectors.js +25 -0
  78. package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +7 -0
  79. package/v2Containers/Assets/Gallery/tests/actions.test.js +26 -0
  80. package/v2Containers/Assets/Gallery/tests/index.test.js +10 -0
  81. package/v2Containers/Assets/Gallery/tests/reducer.test.js +95 -0
  82. package/v2Containers/Assets/Gallery/tests/sagas.test.js +15 -0
  83. package/v2Containers/Assets/Gallery/tests/selectors.test.js +10 -0
  84. package/v2Containers/CallTask/_callTask.scss +5 -0
  85. package/v2Containers/CallTask/actions.js +15 -0
  86. package/v2Containers/CallTask/constants.js +7 -0
  87. package/v2Containers/CallTask/index.js +141 -0
  88. package/v2Containers/CallTask/messages.js +21 -0
  89. package/v2Containers/CallTask/reducer.js +23 -0
  90. package/v2Containers/CallTask/sagas.js +11 -0
  91. package/v2Containers/CallTask/selectors.js +25 -0
  92. package/v2Containers/CallTask/tests/actions.test.js +18 -0
  93. package/v2Containers/CallTask/tests/index.test.js +10 -0
  94. package/v2Containers/CallTask/tests/reducer.test.js +9 -0
  95. package/v2Containers/CallTask/tests/sagas.test.js +15 -0
  96. package/v2Containers/CallTask/tests/selectors.test.js +10 -0
  97. package/v2Containers/Cap/actions.js +64 -0
  98. package/v2Containers/Cap/constants.js +24 -0
  99. package/v2Containers/Cap/index.js +349 -0
  100. package/v2Containers/Cap/messsages.js +63 -0
  101. package/v2Containers/Cap/reducer.js +111 -0
  102. package/v2Containers/Cap/sagas.js +143 -0
  103. package/v2Containers/Cap/selectors.js +85 -0
  104. package/v2Containers/Cap/tests/index.test.js +16 -0
  105. package/v2Containers/Cap/tests/selectors.test.js +28 -0
  106. package/v2Containers/ChannelTemplates/actions.js +20 -0
  107. package/v2Containers/ChannelTemplates/constants.js +8 -0
  108. package/v2Containers/ChannelTemplates/index.js +48 -0
  109. package/v2Containers/ChannelTemplates/messages.js +13 -0
  110. package/v2Containers/ChannelTemplates/reducer.js +34 -0
  111. package/v2Containers/ChannelTemplates/sagas.js +32 -0
  112. package/v2Containers/ChannelTemplates/selectors.js +25 -0
  113. package/v2Containers/ChannelTemplates/tests/actions.test.js +18 -0
  114. package/v2Containers/ChannelTemplates/tests/index.test.js +10 -0
  115. package/v2Containers/ChannelTemplates/tests/reducer.test.js +9 -0
  116. package/v2Containers/ChannelTemplates/tests/sagas.test.js +15 -0
  117. package/v2Containers/ChannelTemplates/tests/selectors.test.js +10 -0
  118. package/v2Containers/CreativesContainer/SlideBoxContent.js +257 -0
  119. package/v2Containers/CreativesContainer/SlideBoxFooter.js +45 -0
  120. package/v2Containers/CreativesContainer/SlideBoxHeader.js +70 -0
  121. package/v2Containers/CreativesContainer/actions.js +27 -0
  122. package/v2Containers/CreativesContainer/constants.js +16 -0
  123. package/v2Containers/CreativesContainer/index.js +483 -0
  124. package/v2Containers/CreativesContainer/index.scss +27 -0
  125. package/v2Containers/CreativesContainer/messages.js +293 -0
  126. package/v2Containers/CreativesContainer/reducer.js +29 -0
  127. package/v2Containers/CreativesContainer/sagas.js +11 -0
  128. package/v2Containers/CreativesContainer/selectors.js +30 -0
  129. package/v2Containers/CreativesContainer/tests/actions.test.js +18 -0
  130. package/v2Containers/CreativesContainer/tests/index.test.js +10 -0
  131. package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -0
  132. package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -0
  133. package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -0
  134. package/v2Containers/Dashboard/actions.js +15 -0
  135. package/v2Containers/Dashboard/constants.js +7 -0
  136. package/v2Containers/Dashboard/index.js +54 -0
  137. package/v2Containers/Dashboard/messages.js +13 -0
  138. package/v2Containers/Dashboard/reducer.js +21 -0
  139. package/v2Containers/Dashboard/sagas.js +11 -0
  140. package/v2Containers/Dashboard/selectors.js +25 -0
  141. package/v2Containers/Dashboard/tests/actions.test.js +18 -0
  142. package/v2Containers/Dashboard/tests/index.test.js +10 -0
  143. package/v2Containers/Dashboard/tests/reducer.test.js +9 -0
  144. package/v2Containers/Dashboard/tests/sagas.test.js +15 -0
  145. package/v2Containers/Dashboard/tests/selectors.test.js +10 -0
  146. package/v2Containers/Ebill/_ebill.scss +5 -0
  147. package/v2Containers/Ebill/actions.js +43 -0
  148. package/v2Containers/Ebill/constants.js +20 -0
  149. package/v2Containers/Ebill/index.js +1261 -0
  150. package/v2Containers/Ebill/messages.js +73 -0
  151. package/v2Containers/Ebill/reducer.js +72 -0
  152. package/v2Containers/Ebill/sagas.js +65 -0
  153. package/v2Containers/Ebill/selectors.js +25 -0
  154. package/v2Containers/Ebill/tests/actions.test.js +18 -0
  155. package/v2Containers/Ebill/tests/index.test.js +10 -0
  156. package/v2Containers/Ebill/tests/reducer.test.js +9 -0
  157. package/v2Containers/Ebill/tests/sagas.test.js +15 -0
  158. package/v2Containers/Ebill/tests/selectors.test.js +10 -0
  159. package/v2Containers/Email/_email.scss +140 -0
  160. package/v2Containers/Email/actions.js +86 -0
  161. package/v2Containers/Email/constants.js +37 -0
  162. package/v2Containers/Email/index.js +2703 -0
  163. package/v2Containers/Email/initialSchema.js +540 -0
  164. package/v2Containers/Email/messages.js +237 -0
  165. package/v2Containers/Email/reducer.js +147 -0
  166. package/v2Containers/Email/sagas.js +133 -0
  167. package/v2Containers/Email/selectors.js +34 -0
  168. package/v2Containers/Email/tests/actions.test.js +18 -0
  169. package/v2Containers/Email/tests/index.test.js +10 -0
  170. package/v2Containers/Email/tests/reducer.test.js +9 -0
  171. package/v2Containers/Email/tests/sagas.test.js +15 -0
  172. package/v2Containers/Email/tests/selectors.test.js +10 -0
  173. package/v2Containers/EmailWrapper/actions.js +15 -0
  174. package/v2Containers/EmailWrapper/constants.js +7 -0
  175. package/v2Containers/EmailWrapper/index.js +258 -0
  176. package/v2Containers/EmailWrapper/messages.js +57 -0
  177. package/v2Containers/EmailWrapper/reducer.js +23 -0
  178. package/v2Containers/EmailWrapper/sagas.js +11 -0
  179. package/v2Containers/EmailWrapper/selectors.js +25 -0
  180. package/v2Containers/EmailWrapper/tests/actions.test.js +18 -0
  181. package/v2Containers/EmailWrapper/tests/index.test.js +10 -0
  182. package/v2Containers/EmailWrapper/tests/reducer.test.js +9 -0
  183. package/v2Containers/EmailWrapper/tests/sagas.test.js +15 -0
  184. package/v2Containers/EmailWrapper/tests/selectors.test.js +10 -0
  185. package/v2Containers/LanguageProvider/actions.js +17 -0
  186. package/v2Containers/LanguageProvider/constants.js +8 -0
  187. package/v2Containers/LanguageProvider/index.js +46 -0
  188. package/v2Containers/LanguageProvider/reducer.js +30 -0
  189. package/v2Containers/LanguageProvider/selectors.js +20 -0
  190. package/v2Containers/LanguageProvider/tests/actions.test.js +19 -0
  191. package/v2Containers/LanguageProvider/tests/index.test.js +49 -0
  192. package/v2Containers/LanguageProvider/tests/reducer.test.js +20 -0
  193. package/v2Containers/LanguageProvider/tests/selectors.test.js +15 -0
  194. package/v2Containers/Line/Create/_lineCreate.scss +43 -0
  195. package/v2Containers/Line/Create/actions.js +90 -0
  196. package/v2Containers/Line/Create/constants.js +39 -0
  197. package/v2Containers/Line/Create/index.js +822 -0
  198. package/v2Containers/Line/Create/messages.js +173 -0
  199. package/v2Containers/Line/Create/reducer.js +99 -0
  200. package/v2Containers/Line/Create/sagas.js +107 -0
  201. package/v2Containers/Line/Create/selectors.js +36 -0
  202. package/v2Containers/Line/Edit/_lineEdit.scss +21 -0
  203. package/v2Containers/Line/Edit/actions.js +79 -0
  204. package/v2Containers/Line/Edit/constants.js +27 -0
  205. package/v2Containers/Line/Edit/index.js +1050 -0
  206. package/v2Containers/Line/Edit/messages.js +157 -0
  207. package/v2Containers/Line/Edit/reducer.js +83 -0
  208. package/v2Containers/Line/Edit/sagas.js +81 -0
  209. package/v2Containers/Line/Edit/selectors.js +29 -0
  210. package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
  211. package/v2Containers/Line/Edit/tests/index.test.js +10 -0
  212. package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
  213. package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
  214. package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
  215. package/v2Containers/Login/assets/images/capillary_logo.png +0 -0
  216. package/v2Containers/Login/components/LoginForm/index.js +59 -0
  217. package/v2Containers/Login/components/LoginForm/messages.js +21 -0
  218. package/v2Containers/Login/components/LoginForm/tests/index.test.js +10 -0
  219. package/v2Containers/Login/index.js +106 -0
  220. package/v2Containers/Login/messages.js +21 -0
  221. package/v2Containers/Login/selectors.js +25 -0
  222. package/v2Containers/Login/tests/index.test.js +10 -0
  223. package/v2Containers/Login/tests/sagas.test.js +15 -0
  224. package/v2Containers/Login/tests/selectors.test.js +10 -0
  225. package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +41 -0
  226. package/v2Containers/MobilePush/Create/actions.js +52 -0
  227. package/v2Containers/MobilePush/Create/constants.js +24 -0
  228. package/v2Containers/MobilePush/Create/index.js +1759 -0
  229. package/v2Containers/MobilePush/Create/messages.js +237 -0
  230. package/v2Containers/MobilePush/Create/reducer.js +72 -0
  231. package/v2Containers/MobilePush/Create/sagas.js +60 -0
  232. package/v2Containers/MobilePush/Create/selectors.js +28 -0
  233. package/v2Containers/MobilePush/Create/tests/actions.test.js +18 -0
  234. package/v2Containers/MobilePush/Create/tests/index.test.js +10 -0
  235. package/v2Containers/MobilePush/Create/tests/reducer.test.js +9 -0
  236. package/v2Containers/MobilePush/Create/tests/sagas.test.js +15 -0
  237. package/v2Containers/MobilePush/Create/tests/selectors.test.js +10 -0
  238. package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +38 -0
  239. package/v2Containers/MobilePush/Edit/actions.js +91 -0
  240. package/v2Containers/MobilePush/Edit/constants.js +35 -0
  241. package/v2Containers/MobilePush/Edit/index.js +1846 -0
  242. package/v2Containers/MobilePush/Edit/messages.js +253 -0
  243. package/v2Containers/MobilePush/Edit/reducer.js +113 -0
  244. package/v2Containers/MobilePush/Edit/sagas.js +119 -0
  245. package/v2Containers/MobilePush/Edit/selectors.js +32 -0
  246. package/v2Containers/MobilePush/Edit/tests/actions.test.js +18 -0
  247. package/v2Containers/MobilePush/Edit/tests/index.test.js +10 -0
  248. package/v2Containers/MobilePush/Edit/tests/reducer.test.js +9 -0
  249. package/v2Containers/MobilePush/Edit/tests/sagas.test.js +15 -0
  250. package/v2Containers/MobilePush/Edit/tests/selectors.test.js +10 -0
  251. package/v2Containers/MobilePush/commonMethods.js +249 -0
  252. package/v2Containers/MobilePush/eventsMap.js +127 -0
  253. package/v2Containers/MobilePush/initialSchema.js +1739 -0
  254. package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
  255. package/v2Containers/MobilepushWrapper/index.js +136 -0
  256. package/v2Containers/MobilepushWrapper/messages.js +29 -0
  257. package/v2Containers/MobilepushWrapper/tests/index.test.js +10 -0
  258. package/v2Containers/NotFoundPage/index.js +25 -0
  259. package/v2Containers/NotFoundPage/messages.js +13 -0
  260. package/v2Containers/NotFoundPage/tests/index.test.js +17 -0
  261. package/v2Containers/Sms/Create/_smsCreate.scss +58 -0
  262. package/v2Containers/Sms/Create/actions.js +27 -0
  263. package/v2Containers/Sms/Create/constants.js +16 -0
  264. package/v2Containers/Sms/Create/index.js +1017 -0
  265. package/v2Containers/Sms/Create/messages.js +85 -0
  266. package/v2Containers/Sms/Create/reducer.js +41 -0
  267. package/v2Containers/Sms/Create/sagas.js +35 -0
  268. package/v2Containers/Sms/Create/selectors.js +28 -0
  269. package/v2Containers/Sms/Create/tests/actions.test.js +18 -0
  270. package/v2Containers/Sms/Create/tests/index.test.js +10 -0
  271. package/v2Containers/Sms/Create/tests/reducer.test.js +9 -0
  272. package/v2Containers/Sms/Create/tests/sagas.test.js +15 -0
  273. package/v2Containers/Sms/Create/tests/selectors.test.js +10 -0
  274. package/v2Containers/Sms/Edit/actions.js +45 -0
  275. package/v2Containers/Sms/Edit/constants.js +18 -0
  276. package/v2Containers/Sms/Edit/index.js +1018 -0
  277. package/v2Containers/Sms/Edit/messages.js +89 -0
  278. package/v2Containers/Sms/Edit/reducer.js +52 -0
  279. package/v2Containers/Sms/Edit/sagas.js +50 -0
  280. package/v2Containers/Sms/Edit/selectors.js +32 -0
  281. package/v2Containers/Sms/Edit/tests/actions.test.js +18 -0
  282. package/v2Containers/Sms/Edit/tests/index.test.js +10 -0
  283. package/v2Containers/Sms/Edit/tests/reducer.test.js +9 -0
  284. package/v2Containers/Sms/Edit/tests/sagas.test.js +15 -0
  285. package/v2Containers/Sms/Edit/tests/selectors.test.js +10 -0
  286. package/v2Containers/Sms/initialSchema.js +281 -0
  287. package/v2Containers/TagList/_tagList.scss +8 -0
  288. package/v2Containers/TagList/actions.js +15 -0
  289. package/v2Containers/TagList/constants.js +7 -0
  290. package/v2Containers/TagList/index.js +236 -0
  291. package/v2Containers/TagList/messages.js +13 -0
  292. package/v2Containers/TagList/reducer.js +23 -0
  293. package/v2Containers/TagList/sagas.js +11 -0
  294. package/v2Containers/TagList/selectors.js +25 -0
  295. package/v2Containers/TagList/tests/actions.test.js +18 -0
  296. package/v2Containers/TagList/tests/index.test.js +10 -0
  297. package/v2Containers/TagList/tests/reducer.test.js +9 -0
  298. package/v2Containers/TagList/tests/sagas.test.js +15 -0
  299. package/v2Containers/TagList/tests/selectors.test.js +10 -0
  300. package/v2Containers/Templates/_templates.scss +349 -0
  301. package/v2Containers/Templates/actions.js +110 -0
  302. package/v2Containers/Templates/constants.js +45 -0
  303. package/v2Containers/Templates/index.js +1682 -0
  304. package/v2Containers/Templates/messages.js +273 -0
  305. package/v2Containers/Templates/reducer.js +142 -0
  306. package/v2Containers/Templates/sagas.js +180 -0
  307. package/v2Containers/Templates/selectors.js +68 -0
  308. package/v2Containers/Templates/tests/actions.test.js +18 -0
  309. package/v2Containers/Templates/tests/index.test.js +10 -0
  310. package/v2Containers/Templates/tests/reducer.test.js +9 -0
  311. package/v2Containers/Templates/tests/sagas.test.js +15 -0
  312. package/v2Containers/Templates/tests/selectors.test.js +10 -0
  313. package/v2Containers/TemplatesV2/_templatesV2.scss +5 -0
  314. package/v2Containers/TemplatesV2/actions.js +16 -0
  315. package/v2Containers/TemplatesV2/constants.js +10 -0
  316. package/v2Containers/TemplatesV2/index.js +217 -0
  317. package/v2Containers/TemplatesV2/messages.js +29 -0
  318. package/v2Containers/TemplatesV2/selectors.js +25 -0
  319. package/v2Containers/TemplatesV2/tests/actions.test.js +18 -0
  320. package/v2Containers/TemplatesV2/tests/index.test.js +10 -0
  321. package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -0
  322. package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -0
  323. package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -0
  324. package/v2Containers/TestPage/constants.js +7 -0
  325. package/v2Containers/TestPage/index.js +31 -0
  326. package/v2Containers/TestPage/messages.js +13 -0
  327. package/v2Containers/TestPage/reducer.js +21 -0
  328. package/v2Containers/TestPage/sagas.js +11 -0
  329. package/v2Containers/Testv2/actions.js +15 -0
  330. package/v2Containers/Testv2/constants.js +7 -0
  331. package/v2Containers/Testv2/index.js +47 -0
  332. package/v2Containers/Testv2/messages.js +13 -0
  333. package/v2Containers/Testv2/reducer.js +23 -0
  334. package/v2Containers/Testv2/sagas.js +11 -0
  335. package/v2Containers/Testv2/selectors.js +25 -0
  336. package/v2Containers/Testv2/tests/actions.test.js +18 -0
  337. package/v2Containers/Testv2/tests/index.test.js +10 -0
  338. package/v2Containers/Testv2/tests/reducer.test.js +9 -0
  339. package/v2Containers/Testv2/tests/sagas.test.js +15 -0
  340. package/v2Containers/Testv2/tests/selectors.test.js +10 -0
  341. package/v2Containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
  342. package/v2Containers/WeChat/MapTemplates/actions.js +52 -0
  343. package/v2Containers/WeChat/MapTemplates/constants.js +28 -0
  344. package/v2Containers/WeChat/MapTemplates/index.js +1385 -0
  345. package/v2Containers/WeChat/MapTemplates/messages.js +73 -0
  346. package/v2Containers/WeChat/MapTemplates/reducer.js +74 -0
  347. package/v2Containers/WeChat/MapTemplates/sagas.js +86 -0
  348. package/v2Containers/WeChat/MapTemplates/selectors.js +25 -0
  349. package/v2Containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
  350. package/v2Containers/WeChat/MapTemplates/tests/index.test.js +10 -0
  351. package/v2Containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
  352. package/v2Containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
  353. package/v2Containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
  354. package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
  355. package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
  356. package/v2Containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
  357. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +1053 -0
  358. package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +141 -0
  359. package/v2Containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
  360. package/v2Containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
  361. package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +48 -0
  362. package/v2Containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
  363. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
  364. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
  365. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
  366. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
  367. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
  368. package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
  369. package/v2Containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
  370. package/v2Containers/WeChat/RichmediaTemplates/Edit/index.js +116 -0
  371. package/v2Containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
  372. package/v2Containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
  373. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +32 -0
  374. package/v2Containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
  375. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
  376. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
  377. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
  378. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
  379. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -0
  380. package/v2Containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
  381. package/v2Containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
  382. package/v2Containers/WeChat/RichmediaTemplates/View/index.js +47 -0
  383. package/v2Containers/WeChat/RichmediaTemplates/View/messages.js +13 -0
  384. package/v2Containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
  385. package/v2Containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
  386. package/v2Containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
  387. package/v2Containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
  388. package/v2Containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
  389. package/v2Containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
  390. package/v2Containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
  391. package/v2Containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Test sagas
3
+ */
4
+
5
+ /* eslint-disable redux-saga/yield-effects */
6
+ // import { take, call, put, select } from 'redux-saga/effects';
7
+ // import { defaultSaga } from '../sagas';
8
+
9
+ // const generator = defaultSaga();
10
+
11
+ describe('defaultSaga Saga', () => {
12
+ it('Expect to have unit tests specified', () => {
13
+ expect(true).toEqual(false);
14
+ });
15
+ });
@@ -0,0 +1,10 @@
1
+ // import { fromJS } from 'immutable';
2
+ // import { makeSelectTemplatesDomain } from '../selectors';
3
+
4
+ // const selector = makeSelectTemplatesDomain();
5
+
6
+ describe('makeSelectTemplatesDomain', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -0,0 +1,5 @@
1
+ .cap-tab-v2-wrapper{
2
+ .ant-tabs-tabpane {
3
+ border: none;
4
+ }
5
+ }
@@ -0,0 +1,16 @@
1
+
2
+ import * as types from './constants';
3
+
4
+ export function defaultAction() {
5
+ return {
6
+ type: types.DEFAULT_ACTION,
7
+ };
8
+ }
9
+
10
+ export function getTemplates({channel, query}) {
11
+ return {
12
+ type: types.GET_TEMPLATES_REQUEST,
13
+ channel,
14
+ query,
15
+ };
16
+ }
@@ -0,0 +1,10 @@
1
+ /*
2
+ *
3
+ * TemplatesV2 constants
4
+ *
5
+ */
6
+
7
+ export const DEFAULT_ACTION = 'app/TemplatesV2/DEFAULT_ACTION';
8
+ export const GET_TEMPLATES_REQUEST = 'app/TemplatesV2/GET_TEMPLATES_REQUEST';
9
+ export const GET_TEMPLATES_SUCESS = 'app/TemplatesV2/GET_TEMPLATES_SUCESS';
10
+ export const GET_TEMPLATES_FAILURE = 'app/TemplatesV2/GET_TEMPLATES_FAILURE';
@@ -0,0 +1,217 @@
1
+ /*
2
+ *
3
+ * TemplatesV2
4
+ *
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+
9
+ import React from 'react';
10
+ import { connect } from 'react-redux';
11
+ import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
12
+ import { createStructuredSelector } from 'reselect';
13
+ import { bindActionCreators } from 'redux';
14
+ import styled from 'styled-components';
15
+ import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon } from '@capillarytech/cap-ui-library';
16
+ import { find, get } from 'lodash';
17
+ import Helmet from 'react-helmet';
18
+
19
+ import {CAP_SPACE_24, CAP_SPACE_16} from '@capillarytech/cap-ui-library/styled/variables';
20
+ import { UserIsAuthenticated } from '../../utils/authWrapper';
21
+ import { makeSelectTemplates, makeSelectTemplatesResponse } from '../Templates/selectors';
22
+ import messages from './messages';
23
+ import * as actions from './actions';
24
+ import Templates from '../Templates';
25
+ import CallTask from '../CallTask';
26
+ import Gallery from '../Assets/Gallery';
27
+ import './_templatesV2.scss';
28
+
29
+ const {CapCustomCardList} = CapCustomCard;
30
+
31
+ const ComponentWrapper = styled.div`
32
+ ${(props) => props.isFullMode ? `
33
+ max-width: 1140px;
34
+ margin: 0 auto;
35
+ width: 100%;
36
+ padding: ${CAP_SPACE_24} 0;
37
+ .ant-tabs-content{
38
+ margin-top: ${CAP_SPACE_16}
39
+ }
40
+ ` : `.cap-tab-v2 {
41
+ height: calc(100vh - 118px);
42
+ } `}
43
+
44
+
45
+ `;
46
+ const MarginTop = styled.div`
47
+ ${(props) => props.isFullMode ? `margin-top: ${CAP_SPACE_24}` : ``
48
+ }
49
+ `;
50
+ export class TemplatesV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
51
+ constructor(props) {
52
+ super(props);
53
+ const defaultChannel = get(this, 'props.channel') || get(this, 'props.params.channel') || 'sms';
54
+ const defaultPanes = [
55
+ {content: <div></div>, tab: 'Sms', key: 'sms'},
56
+ {content: <div></div>, tab: 'Email', key: 'email'},
57
+ // {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
58
+ {content: <div></div>, tab: 'Push notification', key: 'mobilepush'},
59
+ ];
60
+ if (props.isFullMode) {
61
+ defaultPanes.push({content: <div></div>, tab: 'Gallery', key: 'assets'});
62
+ }
63
+ if (!props.isFullMode) {
64
+ defaultPanes.push({content: <div></div>, tab: 'Call Task', key: 'call_task'});
65
+ }
66
+ const panes = this.setChannelContent(defaultChannel, defaultPanes);
67
+ this.state = {
68
+ selectedChannel: defaultChannel,
69
+ panes,
70
+ };
71
+ }
72
+ componentWillReceiveProps(nextProps) {
73
+ if (this.props.channel !== nextProps.channel) {
74
+ const panes = this.setChannelContent(nextProps.channel, this.state.panes);
75
+ this.setState({selectedChannel: nextProps.channel, panes });
76
+ }
77
+ }
78
+ getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
79
+ const currentChannel = channel.toUpperCase();
80
+ const cardDataList = templates.map((template) => {
81
+ const templateData =
82
+ {
83
+ key: `${currentChannel}-card-${template.name}`,
84
+ title: <span title={template.name} >{template.name}</span>,
85
+ extra: [<CapIcon type="eye" onClick={() => { if (this.props.isFullMode) { handlers.handlePreviewClick(template); } else { this.props.handlePeviewTemplate(template); } }} />],
86
+ hoverOption: <CapButton onClick={(e) => handlers.handleEditClick(e, template._id)}>{this.props.intl.formatMessage(this.props.isFullMode ? messages.edit : messages.select)}</CapButton>,
87
+ };
88
+ if (currentChannel === "SMS") {
89
+ templateData.content = template.versions.base['sms-editor'];
90
+ } else if (currentChannel === "EMAIL") {
91
+ templateData.url = template.versions.base.preview_http_url;
92
+ }
93
+ return templateData;
94
+ });
95
+ return (<div>
96
+ {filterContent}
97
+ <CapSpin spinning={isLoading} tip={loadingTip}>
98
+ <div className="pagination-container">
99
+ <CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
100
+ </div>
101
+ </CapSpin>
102
+
103
+ </div>);
104
+ }
105
+ getGalleryComponent = (location) => <Gallery location={location} isFullMode={this.props.isFullMode}/>
106
+ getCallTaskComponent = () => <CallTask onCreateNew={this.props.createNew} onCallTaskSubmit={this.props.onCallTaskSubmit}/>
107
+
108
+ getTemplatesComponent(channel) {
109
+ // const templates = this.props.Templates[`${channel}Templates`];
110
+ let query = {};
111
+ if (!this.props.isFullMode) {
112
+ query = {type: 'embedded', module: 'library'};
113
+ }
114
+ const location = {pathname: `/${channel}`, search: '', query};
115
+ switch (channel) {
116
+ case 'call_task':
117
+ return this.getCallTaskComponent();
118
+ case 'assets':
119
+ return this.getGalleryComponent(location);
120
+ default:
121
+ return (<Templates
122
+ key={channel}
123
+ location={location}
124
+ route={{name: channel}}
125
+ router={this.props.router}
126
+ isFullMode={this.props.isFullMode}
127
+ createNew={this.props.createNew}
128
+ onSelectTemplate={(id) => this.props.onSelectTemplate(this.selectTemplate(id))}
129
+ renderNewCardGrid={this.getTemplateDataForGrid}
130
+ handlePeviewTemplate={this.props.handlePeviewTemplate}
131
+ />);
132
+ }
133
+ }
134
+
135
+ setChannelContent = (selectedChannel, argsPanes) => {
136
+ const panes = argsPanes.map((p) => {
137
+ const pane = p;
138
+ if (pane.key === selectedChannel) {
139
+ let channel = selectedChannel;
140
+ if (channel === "mpush") {
141
+ channel = "mobilepush";
142
+ }
143
+ pane.content = this.getTemplatesComponent(channel);
144
+ return pane;
145
+ }
146
+ return {...pane, content: <div></div>};
147
+ });
148
+ return panes;
149
+ }
150
+ channelChange = (selectedChannel) => {
151
+ const panes = this.setChannelContent(selectedChannel, this.state.panes);
152
+ this.setState({panes, selectedChannel}, () => { if (!this.props.isFullMode) this.props.onChannelChange(selectedChannel); });
153
+ }
154
+ selectTemplate = (id) => find(this.props.TemplatesList, {_id: id})
155
+
156
+ isLoading() {
157
+ return this.props.Templates.loadingTemplates;
158
+ }
159
+ render() {
160
+ const {isFullMode} = this.props;
161
+ return (
162
+ <div className={`creatives-templates-container ${isFullMode ? 'fullmode' : 'library-mode'}`}>
163
+ {isFullMode && <Helmet
164
+ title={this.props.intl.formatMessage(messages.creatives)}
165
+ meta={[
166
+ { name: 'description', content: this.props.intl.formatMessage(messages.creativesDesc) },
167
+ ]}
168
+ />}
169
+ <ComponentWrapper isFullMode={isFullMode}>
170
+
171
+ {isFullMode && <CapHeader title={<FormattedMessage {...messages.creatives}/>} description={<FormattedMessage {...messages.creativesDesc}/>}/>}
172
+ <MarginTop isFullMode={isFullMode}>
173
+ <CapTab
174
+ panes={this.state.panes}
175
+ onChange={this.channelChange}
176
+ activeKey={this.state.selectedChannel}
177
+ defaultActiveKey={this.state.selectedChannel}/>
178
+ </MarginTop>
179
+
180
+
181
+ </ComponentWrapper>
182
+ </div>
183
+
184
+ );
185
+ }
186
+ }
187
+
188
+ TemplatesV2.propTypes = {
189
+ router: PropTypes.object,
190
+ isFullMode: PropTypes.bool,
191
+ onSelectTemplate: PropTypes.func,
192
+ createNew: PropTypes.func,
193
+ channel: PropTypes.string,
194
+ Templates: PropTypes.object,
195
+ TemplatesList: PropTypes.arrayOf(PropTypes.object),
196
+ handlePeviewTemplate: PropTypes.func,
197
+ onCallTaskSubmit: PropTypes.func,
198
+ intl: intlShape,
199
+ onChannelChange: PropTypes.func,
200
+ };
201
+
202
+ TemplatesV2.defaultProps = {
203
+ isFullMode: true,
204
+ };
205
+
206
+ const mapStateToProps = createStructuredSelector({
207
+ Templates: makeSelectTemplates(),
208
+ TemplatesList: makeSelectTemplatesResponse(),
209
+ });
210
+
211
+ function mapDispatchToProps(dispatch) {
212
+ return {
213
+ actions: bindActionCreators(actions, dispatch),
214
+ };
215
+ }
216
+
217
+ export default UserIsAuthenticated(connect(mapStateToProps, mapDispatchToProps)(injectIntl(TemplatesV2)));
@@ -0,0 +1,29 @@
1
+ /*
2
+ * TemplatesV2 Messages
3
+ *
4
+ * This contains all the text for the TemplatesV2 component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+
8
+ export default defineMessages({
9
+ header: {
10
+ id: 'app.containers.TemplatesV2.header',
11
+ defaultMessage: 'This is TemplatesV2 container !',
12
+ },
13
+ select: {
14
+ id: 'app.containers.TemplatesV2.select',
15
+ defaultMessage: 'Select',
16
+ },
17
+ edit: {
18
+ id: 'app.containers.TemplatesV2.edit',
19
+ defaultMessage: 'Edit',
20
+ },
21
+ creatives: {
22
+ id: 'app.containers.TemplatesV2.creatives',
23
+ defaultMessage: 'Creatives',
24
+ },
25
+ creativesDesc: {
26
+ id: 'app.containers.TemplatesV2.creativesDesc',
27
+ defaultMessage: 'These are pre-built templates which you could use to customize your message content.',
28
+ },
29
+ });
@@ -0,0 +1,25 @@
1
+ import { createSelector } from 'reselect';
2
+
3
+ /**
4
+ * Direct selector to the templatesV2 state domain
5
+ */
6
+ const selectTemplatesV2Domain = () => (state) => state.get('templatesV2');
7
+
8
+ /**
9
+ * Other specific selectors
10
+ */
11
+
12
+
13
+ /**
14
+ * Default selector used by TemplatesV2
15
+ */
16
+
17
+ const makeSelectTemplatesV2 = () => createSelector(
18
+ selectTemplatesV2Domain(),
19
+ (substate) => substate.toJS()
20
+ );
21
+
22
+ export default makeSelectTemplatesV2;
23
+ export {
24
+ selectTemplatesV2Domain,
25
+ };
@@ -0,0 +1,18 @@
1
+
2
+ import {
3
+ defaultAction,
4
+ } from '../actions';
5
+ import {
6
+ DEFAULT_ACTION,
7
+ } from '../constants';
8
+
9
+ describe('TemplatesV2 actions', () => {
10
+ describe('Default Action', () => {
11
+ it('has a type of DEFAULT_ACTION', () => {
12
+ const expected = {
13
+ type: DEFAULT_ACTION,
14
+ };
15
+ expect(defaultAction()).toEqual(expected);
16
+ });
17
+ });
18
+ });
@@ -0,0 +1,10 @@
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import { TemplatesV2 } from '../index';
5
+
6
+ describe('<TemplatesV2 />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -0,0 +1,9 @@
1
+
2
+ import { fromJS } from 'immutable';
3
+ import templatesV2Reducer from '../reducer';
4
+
5
+ describe('templatesV2Reducer', () => {
6
+ it('returns the initial state', () => {
7
+ expect(templatesV2Reducer(undefined, {})).toEqual(fromJS({}));
8
+ });
9
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Test sagas
3
+ */
4
+
5
+ /* eslint-disable redux-saga/yield-effects */
6
+ // import { take, call, put, select } from 'redux-saga/effects';
7
+ // import { defaultSaga } from '../sagas';
8
+
9
+ // const generator = defaultSaga();
10
+
11
+ describe('defaultSaga Saga', () => {
12
+ it('Expect to have unit tests specified', () => {
13
+ expect(true).toEqual(false);
14
+ });
15
+ });
@@ -0,0 +1,10 @@
1
+ // import { fromJS } from 'immutable';
2
+ // import { makeSelectTemplatesV2Domain } from '../selectors';
3
+
4
+ // const selector = makeSelectTemplatesV2Domain();
5
+
6
+ describe('makeSelectTemplatesV2Domain', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -0,0 +1,7 @@
1
+ /*
2
+ *
3
+ * Dashboard constants
4
+ *
5
+ */
6
+
7
+ export const DEFAULT_ACTION = 'app/containers/TestPage/DEFAULT_ACTION';
@@ -0,0 +1,31 @@
1
+
2
+ import React from "react";
3
+ import SmsTest from '../../components/SmsTest';
4
+
5
+ export default class TestPage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
6
+ render() {
7
+ return (
8
+ <SmsTest />
9
+ );
10
+ }
11
+ }
12
+
13
+ // const schema = {
14
+ // title: "Todo",
15
+ // type: "object",
16
+ // required: ["title"],
17
+ // properties: {
18
+ // title: {type: "string", title: "Title", default: "A new task"},
19
+ // done: {type: "boolean", title: "Done?", default: false},
20
+ // },
21
+ // };
22
+
23
+ // const log = (type) => console.log.bind(console, type);
24
+
25
+ // render((
26
+ // <div>
27
+ // <SmsTest
28
+ // />
29
+ // </div>
30
+ // ), document.getElementById("app"));
31
+ //export default TestPage;
@@ -0,0 +1,13 @@
1
+ /*
2
+ * NotFoundPage Messages
3
+ *
4
+ * This contains all the text for the NotFoundPage component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+
8
+ export default defineMessages({
9
+ header: {
10
+ id: 'app.components.TestPage.header',
11
+ defaultMessage: 'Looks like youas are lost!',
12
+ },
13
+ });
@@ -0,0 +1,21 @@
1
+ /*
2
+ *
3
+ * Dashboard reducer
4
+ *
5
+ */
6
+
7
+ import { fromJS } from 'immutable';
8
+ import { DEFAULT_ACTION } from './constants';
9
+
10
+ const initialState = fromJS({});
11
+
12
+ function TestPageReducer(state = initialState, action) {
13
+ switch (action.type) {
14
+ case DEFAULT_ACTION:
15
+ return state;
16
+ default:
17
+ return state;
18
+ }
19
+ }
20
+
21
+ export default TestPageReducer;
@@ -0,0 +1,11 @@
1
+ // import { take, call, put, select } from 'redux-saga/effects';
2
+
3
+ // Individual exports for testing
4
+ export function* defaultSaga() {
5
+ // See example in containers/HomePage/sagas.js
6
+ }
7
+
8
+ // All sagas to be loaded
9
+ export default [
10
+ defaultSaga,
11
+ ];
@@ -0,0 +1,15 @@
1
+ /*
2
+ *
3
+ * Testv2 actions
4
+ *
5
+ */
6
+
7
+ import {
8
+ DEFAULT_ACTION,
9
+ } from './constants';
10
+
11
+ export function defaultAction() {
12
+ return {
13
+ type: DEFAULT_ACTION,
14
+ };
15
+ }
@@ -0,0 +1,7 @@
1
+ /*
2
+ *
3
+ * Testv2 constants
4
+ *
5
+ */
6
+
7
+ export const DEFAULT_ACTION = 'app/Testv2/DEFAULT_ACTION';
@@ -0,0 +1,47 @@
1
+ /*
2
+ *
3
+ * Testv2
4
+ *
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+
9
+ import React from 'react';
10
+ import { connect } from 'react-redux';
11
+ import Helmet from 'react-helmet';
12
+ import { FormattedMessage } from 'react-intl';
13
+ import { createStructuredSelector } from 'reselect';
14
+ import makeSelectTestv2 from './selectors';
15
+ import messages from './messages';
16
+
17
+ export class Testv2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
18
+ render() {
19
+ return (
20
+ <div>
21
+ <Helmet
22
+ title="Testv2"
23
+ meta={[
24
+ { name: 'description', content: 'Description of Testv2' },
25
+ ]}
26
+ />
27
+ <FormattedMessage {...messages.header} />
28
+ </div>
29
+ );
30
+ }
31
+ }
32
+
33
+ Testv2.propTypes = {
34
+ dispatch: PropTypes.func.isRequired,
35
+ };
36
+
37
+ const mapStateToProps = createStructuredSelector({
38
+ Testv2: makeSelectTestv2(),
39
+ });
40
+
41
+ function mapDispatchToProps(dispatch) {
42
+ return {
43
+ dispatch,
44
+ };
45
+ }
46
+
47
+ export default connect(mapStateToProps, mapDispatchToProps)(Testv2);
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Testv2 Messages
3
+ *
4
+ * This contains all the text for the Testv2 component.
5
+ */
6
+ import { defineMessages } from 'react-intl';
7
+
8
+ export default defineMessages({
9
+ header: {
10
+ id: 'app.containers.Testv2.header',
11
+ defaultMessage: 'This is Testv2 container !',
12
+ },
13
+ });
@@ -0,0 +1,23 @@
1
+ /*
2
+ *
3
+ * Testv2 reducer
4
+ *
5
+ */
6
+
7
+ import { fromJS } from 'immutable';
8
+ import {
9
+ DEFAULT_ACTION,
10
+ } from './constants';
11
+
12
+ const initialState = fromJS({});
13
+
14
+ function testv2Reducer(state = initialState, action) {
15
+ switch (action.type) {
16
+ case DEFAULT_ACTION:
17
+ return state;
18
+ default:
19
+ return state;
20
+ }
21
+ }
22
+
23
+ export default testv2Reducer;
@@ -0,0 +1,11 @@
1
+ // import { take, call, put, select } from 'redux-saga/effects';
2
+
3
+ // Individual exports for testing
4
+ export function* defaultSaga() {
5
+ // See example in containers/HomePage/sagas.js
6
+ }
7
+
8
+ // All sagas to be loaded
9
+ export default [
10
+ defaultSaga,
11
+ ];
@@ -0,0 +1,25 @@
1
+ import { createSelector } from 'reselect';
2
+
3
+ /**
4
+ * Direct selector to the testv2 state domain
5
+ */
6
+ const selectTestv2Domain = () => (state) => state.get('testv2');
7
+
8
+ /**
9
+ * Other specific selectors
10
+ */
11
+
12
+
13
+ /**
14
+ * Default selector used by Testv2
15
+ */
16
+
17
+ const makeSelectTestv2 = () => createSelector(
18
+ selectTestv2Domain(),
19
+ (substate) => substate.toJS()
20
+ );
21
+
22
+ export default makeSelectTestv2;
23
+ export {
24
+ selectTestv2Domain,
25
+ };
@@ -0,0 +1,18 @@
1
+
2
+ import {
3
+ defaultAction,
4
+ } from '../actions';
5
+ import {
6
+ DEFAULT_ACTION,
7
+ } from '../constants';
8
+
9
+ describe('Testv2 actions', () => {
10
+ describe('Default Action', () => {
11
+ it('has a type of DEFAULT_ACTION', () => {
12
+ const expected = {
13
+ type: DEFAULT_ACTION,
14
+ };
15
+ expect(defaultAction()).toEqual(expected);
16
+ });
17
+ });
18
+ });
@@ -0,0 +1,10 @@
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import { Testv2 } from '../index';
5
+
6
+ describe('<Testv2 />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });