@capillarytech/creatives-library 2.0.70 → 2.0.72

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 (395) hide show
  1. package/app.js +1 -1
  2. package/components/Ckeditor/index.js +2 -1
  3. package/components/EmailMobilePreview/index.scss +0 -1
  4. package/components/EmailPreviewV2/_emailPreviewV2.scss +4 -1
  5. package/components/EmailPreviewV2/index.js +1 -1
  6. package/components/FormBuilder/index.js +25 -10
  7. package/components/Header/index.js +3 -1
  8. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +38 -3
  9. package/components/TemplatePreview/index.js +45 -51
  10. package/components/TemplatePreview/messages.js +1 -1
  11. package/config/app.js +1 -0
  12. package/containers/Cap/actions.js +0 -5
  13. package/containers/Cap/reducer.js +1 -1
  14. package/containers/Cap/selectors.js +0 -13
  15. package/containers/Ebill/index.js +1 -2
  16. package/containers/Email/_email.scss +1 -0
  17. package/containers/Email/actions.js +3 -8
  18. package/containers/Email/constants.js +0 -1
  19. package/containers/Email/index.js +947 -322
  20. package/containers/Email/reducer.js +0 -3
  21. package/containers/Email/sagas.js +6 -3
  22. package/containers/Email/selectors.js +1 -4
  23. package/containers/Line/Create/index.js +1 -2
  24. package/containers/Line/Edit/_lineEdit.scss +4 -0
  25. package/containers/Line/Edit/index.js +1 -3
  26. package/containers/MobilePush/Create/_mobilePushCreate.scss +3 -12
  27. package/containers/MobilePush/Create/actions.js +0 -6
  28. package/containers/MobilePush/Create/constants.js +0 -1
  29. package/containers/MobilePush/Create/index.js +1133 -628
  30. package/containers/MobilePush/Create/messages.js +1 -5
  31. package/containers/MobilePush/Create/reducer.js +0 -2
  32. package/containers/MobilePush/Create/selectors.js +3 -3
  33. package/containers/MobilePush/Edit/_mobilePushCreate.scss +3 -9
  34. package/containers/MobilePush/Edit/index.js +1127 -393
  35. package/containers/MobilePush/Edit/messages.js +0 -4
  36. package/containers/MobilePush/Edit/reducer.js +1 -2
  37. package/containers/MobilePush/Edit/selectors.js +3 -6
  38. package/containers/Sms/Create/_smsCreate.scss +2 -1
  39. package/containers/Sms/Create/actions.js +4 -4
  40. package/containers/Sms/Create/index.js +570 -102
  41. package/containers/Sms/Create/sagas.js +2 -1
  42. package/containers/Sms/Edit/actions.js +5 -10
  43. package/containers/Sms/Edit/constants.js +0 -1
  44. package/containers/Sms/Edit/index.js +548 -103
  45. package/containers/Sms/Edit/reducer.js +0 -2
  46. package/containers/Sms/Edit/sagas.js +3 -1
  47. package/containers/TagList/index.js +3 -3
  48. package/containers/Templates/actions.js +1 -3
  49. package/containers/Templates/index.js +299 -268
  50. package/containers/Templates/messages.js +90 -122
  51. package/containers/Templates/reducer.js +3 -3
  52. package/containers/Templates/sagas.js +1 -5
  53. package/containers/Templates/selectors.js +1 -41
  54. package/containers/WeChat/MapTemplates/index.js +3 -4
  55. package/containers/WeChat/RichmediaTemplates/Create/index.js +18 -4
  56. package/containers/WeChat/RichmediaTemplates/Create/messages.js +4 -0
  57. package/containers/WeChat/RichmediaTemplates/Edit/index.js +3 -1
  58. package/containers/WeChat/RichmediaTemplates/View/index.js +3 -1
  59. package/index.js +31 -31
  60. package/initialState.js +6 -0
  61. package/package.json +3 -3
  62. package/routes.js +24 -19
  63. package/services/api.js +6 -2
  64. package/services/getSchema.js +18 -0
  65. package/v2Containers/App/actions.js +7 -0
  66. package/v2Containers/App/constants.js +3 -0
  67. package/v2Containers/App/reducer.js +19 -0
  68. package/v2Containers/App/sagas.js +26 -0
  69. package/v2Containers/App/selectors.js +25 -0
  70. package/v2Containers/App/tests/actions.test.js +18 -0
  71. package/v2Containers/App/tests/reducer.test.js +9 -0
  72. package/v2Containers/App/tests/sagas.test.js +15 -0
  73. package/v2Containers/App/tests/selectors.test.js +10 -0
  74. package/v2Containers/Assets/Gallery/_gallery.scss +0 -0
  75. package/v2Containers/Assets/Gallery/actions.js +37 -0
  76. package/v2Containers/Assets/Gallery/constants.js +23 -0
  77. package/v2Containers/Assets/Gallery/index.js +479 -0
  78. package/v2Containers/Assets/Gallery/messages.js +97 -0
  79. package/v2Containers/Assets/Gallery/reducer.js +81 -0
  80. package/v2Containers/Assets/Gallery/sagas.js +84 -0
  81. package/v2Containers/Assets/Gallery/selectors.js +25 -0
  82. package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +7 -0
  83. package/v2Containers/Assets/Gallery/tests/actions.test.js +26 -0
  84. package/v2Containers/Assets/Gallery/tests/index.test.js +10 -0
  85. package/v2Containers/Assets/Gallery/tests/reducer.test.js +95 -0
  86. package/v2Containers/Assets/Gallery/tests/sagas.test.js +15 -0
  87. package/v2Containers/Assets/Gallery/tests/selectors.test.js +10 -0
  88. package/v2Containers/CallTask/_callTask.scss +5 -0
  89. package/v2Containers/CallTask/actions.js +15 -0
  90. package/v2Containers/CallTask/constants.js +7 -0
  91. package/v2Containers/CallTask/index.js +141 -0
  92. package/v2Containers/CallTask/messages.js +21 -0
  93. package/v2Containers/CallTask/reducer.js +23 -0
  94. package/v2Containers/CallTask/sagas.js +11 -0
  95. package/v2Containers/CallTask/selectors.js +25 -0
  96. package/v2Containers/CallTask/tests/actions.test.js +18 -0
  97. package/v2Containers/CallTask/tests/index.test.js +10 -0
  98. package/v2Containers/CallTask/tests/reducer.test.js +9 -0
  99. package/v2Containers/CallTask/tests/sagas.test.js +15 -0
  100. package/v2Containers/CallTask/tests/selectors.test.js +10 -0
  101. package/v2Containers/Cap/actions.js +64 -0
  102. package/v2Containers/Cap/constants.js +24 -0
  103. package/v2Containers/Cap/index.js +349 -0
  104. package/v2Containers/Cap/messsages.js +63 -0
  105. package/v2Containers/Cap/reducer.js +111 -0
  106. package/v2Containers/Cap/sagas.js +143 -0
  107. package/v2Containers/Cap/selectors.js +85 -0
  108. package/v2Containers/Cap/tests/index.test.js +16 -0
  109. package/v2Containers/Cap/tests/selectors.test.js +28 -0
  110. package/v2Containers/ChannelTemplates/actions.js +20 -0
  111. package/v2Containers/ChannelTemplates/constants.js +8 -0
  112. package/v2Containers/ChannelTemplates/index.js +48 -0
  113. package/v2Containers/ChannelTemplates/messages.js +13 -0
  114. package/v2Containers/ChannelTemplates/reducer.js +34 -0
  115. package/v2Containers/ChannelTemplates/sagas.js +32 -0
  116. package/v2Containers/ChannelTemplates/selectors.js +25 -0
  117. package/v2Containers/ChannelTemplates/tests/actions.test.js +18 -0
  118. package/v2Containers/ChannelTemplates/tests/index.test.js +10 -0
  119. package/v2Containers/ChannelTemplates/tests/reducer.test.js +9 -0
  120. package/v2Containers/ChannelTemplates/tests/sagas.test.js +15 -0
  121. package/v2Containers/ChannelTemplates/tests/selectors.test.js +10 -0
  122. package/v2Containers/CreativesContainer/SlideBoxContent.js +257 -0
  123. package/v2Containers/CreativesContainer/SlideBoxFooter.js +45 -0
  124. package/v2Containers/CreativesContainer/SlideBoxHeader.js +70 -0
  125. package/v2Containers/CreativesContainer/actions.js +27 -0
  126. package/v2Containers/CreativesContainer/constants.js +16 -0
  127. package/v2Containers/CreativesContainer/index.js +483 -0
  128. package/v2Containers/CreativesContainer/index.scss +27 -0
  129. package/v2Containers/CreativesContainer/messages.js +293 -0
  130. package/v2Containers/CreativesContainer/reducer.js +29 -0
  131. package/v2Containers/CreativesContainer/sagas.js +11 -0
  132. package/v2Containers/CreativesContainer/selectors.js +30 -0
  133. package/v2Containers/CreativesContainer/tests/actions.test.js +18 -0
  134. package/v2Containers/CreativesContainer/tests/index.test.js +10 -0
  135. package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -0
  136. package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -0
  137. package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -0
  138. package/v2Containers/Dashboard/actions.js +15 -0
  139. package/v2Containers/Dashboard/constants.js +7 -0
  140. package/v2Containers/Dashboard/index.js +54 -0
  141. package/v2Containers/Dashboard/messages.js +13 -0
  142. package/v2Containers/Dashboard/reducer.js +21 -0
  143. package/v2Containers/Dashboard/sagas.js +11 -0
  144. package/v2Containers/Dashboard/selectors.js +25 -0
  145. package/v2Containers/Dashboard/tests/actions.test.js +18 -0
  146. package/v2Containers/Dashboard/tests/index.test.js +10 -0
  147. package/v2Containers/Dashboard/tests/reducer.test.js +9 -0
  148. package/v2Containers/Dashboard/tests/sagas.test.js +15 -0
  149. package/v2Containers/Dashboard/tests/selectors.test.js +10 -0
  150. package/v2Containers/Ebill/_ebill.scss +5 -0
  151. package/v2Containers/Ebill/actions.js +43 -0
  152. package/v2Containers/Ebill/constants.js +20 -0
  153. package/v2Containers/Ebill/index.js +1261 -0
  154. package/v2Containers/Ebill/messages.js +73 -0
  155. package/v2Containers/Ebill/reducer.js +72 -0
  156. package/v2Containers/Ebill/sagas.js +65 -0
  157. package/v2Containers/Ebill/selectors.js +25 -0
  158. package/v2Containers/Ebill/tests/actions.test.js +18 -0
  159. package/v2Containers/Ebill/tests/index.test.js +10 -0
  160. package/v2Containers/Ebill/tests/reducer.test.js +9 -0
  161. package/v2Containers/Ebill/tests/sagas.test.js +15 -0
  162. package/v2Containers/Ebill/tests/selectors.test.js +10 -0
  163. package/v2Containers/Email/_email.scss +140 -0
  164. package/v2Containers/Email/actions.js +86 -0
  165. package/v2Containers/Email/constants.js +37 -0
  166. package/v2Containers/Email/index.js +2703 -0
  167. package/v2Containers/Email/initialSchema.js +540 -0
  168. package/v2Containers/Email/messages.js +237 -0
  169. package/v2Containers/Email/reducer.js +147 -0
  170. package/v2Containers/Email/sagas.js +133 -0
  171. package/v2Containers/Email/selectors.js +34 -0
  172. package/v2Containers/Email/tests/actions.test.js +18 -0
  173. package/v2Containers/Email/tests/index.test.js +10 -0
  174. package/v2Containers/Email/tests/reducer.test.js +9 -0
  175. package/v2Containers/Email/tests/sagas.test.js +15 -0
  176. package/v2Containers/Email/tests/selectors.test.js +10 -0
  177. package/v2Containers/EmailWrapper/actions.js +15 -0
  178. package/v2Containers/EmailWrapper/constants.js +7 -0
  179. package/v2Containers/EmailWrapper/index.js +258 -0
  180. package/v2Containers/EmailWrapper/messages.js +57 -0
  181. package/v2Containers/EmailWrapper/reducer.js +23 -0
  182. package/v2Containers/EmailWrapper/sagas.js +11 -0
  183. package/v2Containers/EmailWrapper/selectors.js +25 -0
  184. package/v2Containers/EmailWrapper/tests/actions.test.js +18 -0
  185. package/v2Containers/EmailWrapper/tests/index.test.js +10 -0
  186. package/v2Containers/EmailWrapper/tests/reducer.test.js +9 -0
  187. package/v2Containers/EmailWrapper/tests/sagas.test.js +15 -0
  188. package/v2Containers/EmailWrapper/tests/selectors.test.js +10 -0
  189. package/v2Containers/LanguageProvider/actions.js +17 -0
  190. package/v2Containers/LanguageProvider/constants.js +8 -0
  191. package/v2Containers/LanguageProvider/index.js +46 -0
  192. package/v2Containers/LanguageProvider/reducer.js +30 -0
  193. package/v2Containers/LanguageProvider/selectors.js +20 -0
  194. package/v2Containers/LanguageProvider/tests/actions.test.js +19 -0
  195. package/v2Containers/LanguageProvider/tests/index.test.js +49 -0
  196. package/v2Containers/LanguageProvider/tests/reducer.test.js +20 -0
  197. package/v2Containers/LanguageProvider/tests/selectors.test.js +15 -0
  198. package/v2Containers/Line/Create/_lineCreate.scss +43 -0
  199. package/v2Containers/Line/Create/actions.js +90 -0
  200. package/v2Containers/Line/Create/constants.js +39 -0
  201. package/v2Containers/Line/Create/index.js +822 -0
  202. package/v2Containers/Line/Create/messages.js +173 -0
  203. package/v2Containers/Line/Create/reducer.js +99 -0
  204. package/v2Containers/Line/Create/sagas.js +107 -0
  205. package/v2Containers/Line/Create/selectors.js +36 -0
  206. package/v2Containers/Line/Edit/_lineEdit.scss +21 -0
  207. package/v2Containers/Line/Edit/actions.js +79 -0
  208. package/v2Containers/Line/Edit/constants.js +27 -0
  209. package/v2Containers/Line/Edit/index.js +1050 -0
  210. package/v2Containers/Line/Edit/messages.js +157 -0
  211. package/v2Containers/Line/Edit/reducer.js +83 -0
  212. package/v2Containers/Line/Edit/sagas.js +81 -0
  213. package/v2Containers/Line/Edit/selectors.js +29 -0
  214. package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
  215. package/v2Containers/Line/Edit/tests/index.test.js +10 -0
  216. package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
  217. package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
  218. package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
  219. package/v2Containers/Login/assets/images/capillary_logo.png +0 -0
  220. package/v2Containers/Login/components/LoginForm/index.js +59 -0
  221. package/v2Containers/Login/components/LoginForm/messages.js +21 -0
  222. package/v2Containers/Login/components/LoginForm/tests/index.test.js +10 -0
  223. package/v2Containers/Login/index.js +106 -0
  224. package/v2Containers/Login/messages.js +21 -0
  225. package/v2Containers/Login/selectors.js +25 -0
  226. package/v2Containers/Login/tests/index.test.js +10 -0
  227. package/v2Containers/Login/tests/sagas.test.js +15 -0
  228. package/v2Containers/Login/tests/selectors.test.js +10 -0
  229. package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +41 -0
  230. package/v2Containers/MobilePush/Create/actions.js +52 -0
  231. package/v2Containers/MobilePush/Create/constants.js +24 -0
  232. package/v2Containers/MobilePush/Create/index.js +1759 -0
  233. package/v2Containers/MobilePush/Create/messages.js +237 -0
  234. package/v2Containers/MobilePush/Create/reducer.js +72 -0
  235. package/v2Containers/MobilePush/Create/sagas.js +60 -0
  236. package/v2Containers/MobilePush/Create/selectors.js +28 -0
  237. package/v2Containers/MobilePush/Create/tests/actions.test.js +18 -0
  238. package/v2Containers/MobilePush/Create/tests/index.test.js +10 -0
  239. package/v2Containers/MobilePush/Create/tests/reducer.test.js +9 -0
  240. package/v2Containers/MobilePush/Create/tests/sagas.test.js +15 -0
  241. package/v2Containers/MobilePush/Create/tests/selectors.test.js +10 -0
  242. package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +38 -0
  243. package/v2Containers/MobilePush/Edit/actions.js +91 -0
  244. package/v2Containers/MobilePush/Edit/constants.js +35 -0
  245. package/v2Containers/MobilePush/Edit/index.js +1851 -0
  246. package/v2Containers/MobilePush/Edit/messages.js +253 -0
  247. package/v2Containers/MobilePush/Edit/reducer.js +113 -0
  248. package/v2Containers/MobilePush/Edit/sagas.js +119 -0
  249. package/v2Containers/MobilePush/Edit/selectors.js +32 -0
  250. package/v2Containers/MobilePush/Edit/tests/actions.test.js +18 -0
  251. package/v2Containers/MobilePush/Edit/tests/index.test.js +10 -0
  252. package/v2Containers/MobilePush/Edit/tests/reducer.test.js +9 -0
  253. package/v2Containers/MobilePush/Edit/tests/sagas.test.js +15 -0
  254. package/v2Containers/MobilePush/Edit/tests/selectors.test.js +10 -0
  255. package/v2Containers/MobilePush/commonMethods.js +249 -0
  256. package/v2Containers/MobilePush/eventsMap.js +127 -0
  257. package/v2Containers/MobilePush/initialSchema.js +1739 -0
  258. package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
  259. package/v2Containers/MobilepushWrapper/index.js +136 -0
  260. package/v2Containers/MobilepushWrapper/messages.js +29 -0
  261. package/v2Containers/MobilepushWrapper/tests/index.test.js +10 -0
  262. package/v2Containers/NotFoundPage/index.js +25 -0
  263. package/v2Containers/NotFoundPage/messages.js +13 -0
  264. package/v2Containers/NotFoundPage/tests/index.test.js +17 -0
  265. package/v2Containers/Sms/Create/_smsCreate.scss +58 -0
  266. package/v2Containers/Sms/Create/actions.js +27 -0
  267. package/v2Containers/Sms/Create/constants.js +16 -0
  268. package/v2Containers/Sms/Create/index.js +1017 -0
  269. package/v2Containers/Sms/Create/messages.js +85 -0
  270. package/v2Containers/Sms/Create/reducer.js +41 -0
  271. package/v2Containers/Sms/Create/sagas.js +35 -0
  272. package/v2Containers/Sms/Create/selectors.js +28 -0
  273. package/v2Containers/Sms/Create/tests/actions.test.js +18 -0
  274. package/v2Containers/Sms/Create/tests/index.test.js +10 -0
  275. package/v2Containers/Sms/Create/tests/reducer.test.js +9 -0
  276. package/v2Containers/Sms/Create/tests/sagas.test.js +15 -0
  277. package/v2Containers/Sms/Create/tests/selectors.test.js +10 -0
  278. package/v2Containers/Sms/Edit/actions.js +45 -0
  279. package/v2Containers/Sms/Edit/constants.js +18 -0
  280. package/v2Containers/Sms/Edit/index.js +1018 -0
  281. package/v2Containers/Sms/Edit/messages.js +89 -0
  282. package/v2Containers/Sms/Edit/reducer.js +52 -0
  283. package/v2Containers/Sms/Edit/sagas.js +50 -0
  284. package/v2Containers/Sms/Edit/selectors.js +32 -0
  285. package/v2Containers/Sms/Edit/tests/actions.test.js +18 -0
  286. package/v2Containers/Sms/Edit/tests/index.test.js +10 -0
  287. package/v2Containers/Sms/Edit/tests/reducer.test.js +9 -0
  288. package/v2Containers/Sms/Edit/tests/sagas.test.js +15 -0
  289. package/v2Containers/Sms/Edit/tests/selectors.test.js +10 -0
  290. package/v2Containers/Sms/initialSchema.js +281 -0
  291. package/v2Containers/TagList/_tagList.scss +8 -0
  292. package/v2Containers/TagList/actions.js +15 -0
  293. package/v2Containers/TagList/constants.js +7 -0
  294. package/v2Containers/TagList/index.js +236 -0
  295. package/v2Containers/TagList/messages.js +13 -0
  296. package/v2Containers/TagList/reducer.js +23 -0
  297. package/v2Containers/TagList/sagas.js +11 -0
  298. package/v2Containers/TagList/selectors.js +25 -0
  299. package/v2Containers/TagList/tests/actions.test.js +18 -0
  300. package/v2Containers/TagList/tests/index.test.js +10 -0
  301. package/v2Containers/TagList/tests/reducer.test.js +9 -0
  302. package/v2Containers/TagList/tests/sagas.test.js +15 -0
  303. package/v2Containers/TagList/tests/selectors.test.js +10 -0
  304. package/v2Containers/Templates/_templates.scss +349 -0
  305. package/v2Containers/Templates/actions.js +110 -0
  306. package/v2Containers/Templates/constants.js +45 -0
  307. package/v2Containers/Templates/index.js +1725 -0
  308. package/v2Containers/Templates/messages.js +278 -0
  309. package/v2Containers/Templates/reducer.js +142 -0
  310. package/v2Containers/Templates/sagas.js +180 -0
  311. package/v2Containers/Templates/selectors.js +68 -0
  312. package/v2Containers/Templates/tests/actions.test.js +18 -0
  313. package/v2Containers/Templates/tests/index.test.js +10 -0
  314. package/v2Containers/Templates/tests/reducer.test.js +9 -0
  315. package/v2Containers/Templates/tests/sagas.test.js +15 -0
  316. package/v2Containers/Templates/tests/selectors.test.js +10 -0
  317. package/v2Containers/TemplatesV2/_templatesV2.scss +5 -0
  318. package/v2Containers/TemplatesV2/actions.js +16 -0
  319. package/v2Containers/TemplatesV2/constants.js +10 -0
  320. package/v2Containers/TemplatesV2/index.js +217 -0
  321. package/v2Containers/TemplatesV2/messages.js +29 -0
  322. package/v2Containers/TemplatesV2/selectors.js +25 -0
  323. package/v2Containers/TemplatesV2/tests/actions.test.js +18 -0
  324. package/v2Containers/TemplatesV2/tests/index.test.js +10 -0
  325. package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -0
  326. package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -0
  327. package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -0
  328. package/v2Containers/TestPage/constants.js +7 -0
  329. package/v2Containers/TestPage/index.js +31 -0
  330. package/v2Containers/TestPage/messages.js +13 -0
  331. package/v2Containers/TestPage/reducer.js +21 -0
  332. package/v2Containers/TestPage/sagas.js +11 -0
  333. package/v2Containers/Testv2/actions.js +15 -0
  334. package/v2Containers/Testv2/constants.js +7 -0
  335. package/v2Containers/Testv2/index.js +47 -0
  336. package/v2Containers/Testv2/messages.js +13 -0
  337. package/v2Containers/Testv2/reducer.js +23 -0
  338. package/v2Containers/Testv2/sagas.js +11 -0
  339. package/v2Containers/Testv2/selectors.js +25 -0
  340. package/v2Containers/Testv2/tests/actions.test.js +18 -0
  341. package/v2Containers/Testv2/tests/index.test.js +10 -0
  342. package/v2Containers/Testv2/tests/reducer.test.js +9 -0
  343. package/v2Containers/Testv2/tests/sagas.test.js +15 -0
  344. package/v2Containers/Testv2/tests/selectors.test.js +10 -0
  345. package/v2Containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
  346. package/v2Containers/WeChat/MapTemplates/actions.js +52 -0
  347. package/v2Containers/WeChat/MapTemplates/constants.js +28 -0
  348. package/v2Containers/WeChat/MapTemplates/index.js +1385 -0
  349. package/v2Containers/WeChat/MapTemplates/messages.js +73 -0
  350. package/v2Containers/WeChat/MapTemplates/reducer.js +74 -0
  351. package/v2Containers/WeChat/MapTemplates/sagas.js +86 -0
  352. package/v2Containers/WeChat/MapTemplates/selectors.js +25 -0
  353. package/v2Containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
  354. package/v2Containers/WeChat/MapTemplates/tests/index.test.js +10 -0
  355. package/v2Containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
  356. package/v2Containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
  357. package/v2Containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
  358. package/v2Containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
  359. package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
  360. package/v2Containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
  361. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +1053 -0
  362. package/v2Containers/WeChat/RichmediaTemplates/Create/messages.js +141 -0
  363. package/v2Containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
  364. package/v2Containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
  365. package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +48 -0
  366. package/v2Containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
  367. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
  368. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
  369. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
  370. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
  371. package/v2Containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
  372. package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
  373. package/v2Containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
  374. package/v2Containers/WeChat/RichmediaTemplates/Edit/index.js +116 -0
  375. package/v2Containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
  376. package/v2Containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
  377. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +32 -0
  378. package/v2Containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
  379. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
  380. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
  381. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
  382. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
  383. package/v2Containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -0
  384. package/v2Containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
  385. package/v2Containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
  386. package/v2Containers/WeChat/RichmediaTemplates/View/index.js +47 -0
  387. package/v2Containers/WeChat/RichmediaTemplates/View/messages.js +13 -0
  388. package/v2Containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
  389. package/v2Containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
  390. package/v2Containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
  391. package/v2Containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
  392. package/v2Containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
  393. package/v2Containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
  394. package/v2Containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
  395. package/v2Containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
@@ -15,7 +15,7 @@ import { createStructuredSelector } from 'reselect';
15
15
  import _ from 'lodash';
16
16
  import { bindActionCreators } from 'redux';
17
17
  import { makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
18
- import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../../Cap/selectors';
18
+ import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
19
19
  import { UserIsAuthenticated } from '../../../utils/authWrapper';
20
20
  import FormBuilder from '../../../components/FormBuilder';
21
21
  import * as actions from './actions';
@@ -24,14 +24,11 @@ import '../Create/_smsCreate.scss';
24
24
  import messages from './messages';
25
25
  import * as globalActions from '../../../containers/Cap/actions';
26
26
  import {getMessageObject} from '../../../utils/messageUtils';
27
- import * as creativesContainerActions from '../../CreativesContainer/actions';
28
- // import callNativeEvent from '../../../utils/callNativeEvent';
29
27
 
30
28
  export class Edit extends React.Component { // eslint-disable-line react/prefer-stateless-function
31
29
  constructor(props) {
32
30
  super(props);
33
31
  this.state = {
34
- loadingStatus: 0,
35
32
  formData: {},
36
33
  tabCount: 1,
37
34
  schema: {},
@@ -85,6 +82,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
85
82
  }
86
83
 
87
84
  componentWillMount() {
85
+ console.log('edit mounting');
88
86
  const query = {
89
87
  layout: 'SMS',
90
88
  type: 'LAYOUT',
@@ -128,7 +126,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
128
126
  this.setEditState(nextProps.templateDetails);
129
127
  }
130
128
  if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
131
- this.setState({schema: nextProps.metaEntities.layouts[0].definition, loadingStatus: this.state.loadingStatus + 1}, () => {
129
+ this.setState({schema: nextProps.metaEntities.layouts[0].definition}, () => {
132
130
  this.injectEvents(nextProps.metaEntities.layouts[0].definition);
133
131
  });
134
132
  if (this.props.location.query.module !== 'library' || (this.props.location.query.module === 'library' && this.props.getDefaultTags)) {
@@ -148,6 +146,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
148
146
  }
149
147
  }
150
148
  if (nextProps.Edit.editResponse && nextProps.Edit.editResponse.templateId) {
149
+ console.log('reseting schema');
151
150
  this.resetSchema();
152
151
  this.setState({
153
152
  formData: {},
@@ -173,66 +172,41 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
173
172
  }
174
173
 
175
174
  componentWillUnmount() {
176
- if (this.props.setIsLoadingContent) {
177
- this.props.setIsLoadingContent(true); // setting isLoading of CreativesContainer so that slidebox foot can be hidden till content is loaded
178
- }
179
- this.props.actions.resetEditTemplate();
180
175
  window.removeEventListener("message", this.handleFrameTasks);
181
176
  }
182
177
 
183
- onTemplateNameChange() {
184
-
178
+ onTemplateNameChange(name) {
179
+ console.log('Template name changed to ', name);
185
180
  }
186
181
 
187
- onTemplateContentChange() {
188
-
182
+ onTemplateContentChange(content) {
183
+ console.log('Template content changed to ', content);
189
184
  }
190
185
 
191
186
  onFormDataChange(formData, tabCount, currentTab) {
187
+ console.log('Form data changed is ', formData, tabCount, currentTab);
192
188
  this.setState({formData, tabCount, currentTab});
193
189
  if (currentTab) {
194
190
  this.setState({currentTab});
195
191
  }
196
192
  }
197
193
 
198
- onVersionNameChange() {
199
-
194
+ onVersionNameChange(data, versionIndex) {
195
+ console.log('version name changed to', data, versionIndex);
200
196
  }
201
197
 
202
198
  onTagSelect(data, currentTab) {
199
+ console.log('parent data tag', data, currentTab);
203
200
  const editorId = currentTab > 1 ? `sms-editor${currentTab}` : 'sms-editor';
204
- this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
201
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
205
202
  document.getElementById(editorId).focus();
206
203
  }
207
204
 
208
205
  onTabChange(data) {
206
+ console.log('inside parent ontabchange', data, this.state);
209
207
  this.setState({currentTab: data});
210
208
  }
211
- onUpdateTemplateComplete = (editResponse) => {
212
- if (editResponse.templateId) {
213
- this.resetSchema();
214
- this.setState({
215
- formData: {},
216
- tabCount: 1,
217
- currentTab: 1,
218
- editData: {},
219
- });
220
- const message = getMessageObject('success', 'SMS Template Edited Successfully', true);
221
- this.props.globalActions.addMessageToQueue(message);
222
- this.props.actions.clearEditResponse();
223
- const module = this.props.location.query.module ? this.props.location.query.module : 'default';
224
- const type = this.props.location.query.type;
225
- if (this.props.isFullMode) {
226
- const {versions, ...rest} = editResponse.templateId;
227
- this.props.getFormSubscriptionData({ value: versions, ...rest, validity: true});
228
- } else {
229
- this.props.router.push({
230
- pathname: `/sms/`,
231
- query: type === 'embedded' ? {type: 'embedded', module} : {module},
232
- });
233
- }
234
- }
235
- }
209
+
236
210
  setEditState(data) {
237
211
  const that = this;
238
212
  const tabCount = data.versions.history.length;
@@ -253,7 +227,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
253
227
  }
254
228
  if (type === 'embedded' || count > 0) {
255
229
  setTimeout( () => {
256
- if (type === 'embedded' && !_.isEmpty(that.state.formData)) {
230
+ console.log('removing standalone');
231
+ if (type === 'embedded') {
257
232
  that.removeStandAlone();
258
233
  } else {
259
234
  that.addVersion(count, tabCount);
@@ -268,7 +243,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
268
243
  formData[0].base = true;
269
244
  }
270
245
  formData.base = data.versions.base;
271
-
246
+ console.log('form data after discarding ', formData);
272
247
  this.setState({tabCount, formData, editData: data, currentTab}, () => {
273
248
  });
274
249
  }
@@ -278,10 +253,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
278
253
  }
279
254
 
280
255
  getFormData(e, value) {
256
+ console.log('posting final result', this.state.formData);
281
257
  const formData = _.cloneDeep(this.state.formData);
282
258
  let baseData = {};
283
259
  let versionIdx;
284
260
  _.forEach(formData, (val, idx) => {
261
+ console.log('val', val);
285
262
  if (val.base && idx !== 'base') {
286
263
  baseData = val;
287
264
  versionIdx = idx;
@@ -293,19 +270,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
293
270
  }
294
271
  const result = {};
295
272
  result.base = baseData;
296
- if (this.state.isFormValid) {
297
- const msgObj = updateCharCount(baseData['sms-editor']);
298
- result.base.msg_count = msgObj.msgCount;
299
- }
273
+ const msgObj = updateCharCount(baseData['sms-editor']);
274
+ result.base.msg_count = msgObj.msgCount;
275
+ console.log("Message Count", msgObj.msgCount);
300
276
  const response = {
301
277
  action: "getFormData",
302
278
  value: result,
303
279
  postAction: value || 'next',
304
280
  validity: this.state.isFormValid,
305
- type: 'SMS',
306
281
  };
307
282
  this.setState({checkValidation: true});
308
-
283
+ console.log('posting final result internal', response);
309
284
  if (e) {
310
285
  e.source.postMessage(JSON.stringify(response), e.origin);
311
286
  }
@@ -313,6 +288,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
313
288
  }
314
289
 
315
290
  getCurrentWindow(e) {
291
+ console.log('in sms create', e);
316
292
  const response = {
317
293
  action: e.action,
318
294
  value: 'edit',
@@ -373,6 +349,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
373
349
  }
374
350
 
375
351
  handleOnTagsContextChange = (data) => {
352
+ console.log('parent tags context', data);
376
353
  const query = {
377
354
  layout: 'SMS',
378
355
  type: 'TAG',
@@ -391,9 +368,10 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
391
368
  }
392
369
 
393
370
  startTemplateCreation(data) {
371
+ console.log('startTemplateCreation');
394
372
  if (data.edit) {
395
373
  const ifUnicode = checkUnicode(data.content);
396
-
374
+ console.log('smsDetails', ifUnicode, data.content);
397
375
  const content = data.content;
398
376
  const tempData = {
399
377
  'sms-editor': content,
@@ -411,12 +389,14 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
411
389
  }
412
390
 
413
391
  startLoading(ifEdit) {
392
+ console.log('startLoading', ifEdit);
414
393
  if (ifEdit) {
415
394
  this.setState({loading: true});
416
395
  }
417
396
  }
418
397
 
419
398
  moveToTemplates() {
399
+ console.log('in move to Templates');
420
400
  const modalContent = {
421
401
  title: "Alert",
422
402
  body: "Do you really want to go back? All your temporary changes will be lost!",
@@ -433,6 +413,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
433
413
  }
434
414
 
435
415
  discardValues() {
416
+ console.log('discarding', this.props.Edit);
436
417
  this.resetSchema();
437
418
  this.setState({
438
419
  formData: {},
@@ -445,6 +426,487 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
445
426
  }
446
427
 
447
428
  resetSchema() {
429
+ //const schema =
430
+ // {
431
+ // standalone: {
432
+ // sections: [
433
+ // {
434
+ // type: "multicols",
435
+ // inputFields: [
436
+ // {
437
+ // cols: [
438
+ // {
439
+ // id: "template-name",
440
+ // placeholder: "Enter template name",
441
+ // type: "input", //Resembles component to be used
442
+ // metaType: "text",
443
+ // datatype: "string",
444
+ // required: true,
445
+ // fluid: true,
446
+ // style: {
447
+ // fontSize: '20px',
448
+ // fontFamily: 'proxima-nova,sans-serif',
449
+ // fontStyle: 'normal',
450
+ // fontWeight: 600,
451
+ // marginBottom: '16px',
452
+ // },
453
+ // styling: "semantic",
454
+ // order: 1,
455
+ // width: 9,
456
+ // // offSet: 10,
457
+ // customComponent: false,
458
+ // standalone: true,
459
+ // supportedEvents: {
460
+ // onChange: this.onTemplateNameChange,
461
+ // },
462
+ // },
463
+ // {
464
+ // id: "discard-button",
465
+ // width: 3,
466
+ // offset: 8,
467
+ // metaType: "submit-button",
468
+ // colStyle: {
469
+ // // marginLeft: '47.833%',
470
+ // textAlign: 'right',
471
+ // paddingRight: '12px',
472
+ // },
473
+ // type: "button",
474
+ // buttonType: "cancel",
475
+ // value: "Discard",
476
+ // customComponent: false,
477
+ // standalone: true,
478
+ // styling: "semantic",
479
+ // order: 3,
480
+ // fluid: false,
481
+ // submitAction: "discardValues",
482
+ // supportedEvents: {
483
+ // discardValues: this.discardValues,
484
+ // },
485
+ // },
486
+ // {
487
+ // id: "cancel-button",
488
+ // width: 2,
489
+ // // offset: 11,
490
+ // metaType: "submit-button",
491
+ // colStyle: {
492
+ // textAlign: 'right',
493
+ // width: '9%',
494
+ // },
495
+ // type: "button",
496
+ // buttonType: "cancel",
497
+ // value: "Cancel",
498
+ // customComponent: false,
499
+ // standalone: true,
500
+ // styling: "semantic",
501
+ // order: 3,
502
+ // fluid: false,
503
+ // submitAction: "cancelTemplate",
504
+ // supportedEvents: {
505
+ // cancelTemplate: this.cancelTemplate,
506
+ // },
507
+ // },
508
+ // {
509
+ // id: "save-button",
510
+ // width: 2,
511
+ // metaType: "submit-button",
512
+ // colStyle: {
513
+ // textAlign: 'right',
514
+ // width: '7%',
515
+ // },
516
+ // type: "button",
517
+ // buttonType: "primary",
518
+ // value: "Save",
519
+ // customComponent: false,
520
+ // styling: "semantic",
521
+ // order: 3,
522
+ // fluid: false,
523
+ // standalone: true,
524
+ // submitAction: "saveFormData",
525
+ // supportedEvents: {
526
+ // saveFormData: this.saveFormData,
527
+ // },
528
+ // },
529
+ // ],
530
+ // },
531
+ // ],
532
+ // actionFields: [],
533
+ // },
534
+ // ],
535
+ // },
536
+ // containers: [
537
+ // {
538
+ // panes: [
539
+ // {
540
+ // sections: [
541
+ // {
542
+ // type: "parent",
543
+ // width: 16,
544
+ // rowStyle: {
545
+ // height: '100%',
546
+ // },
547
+ // childSections: [
548
+ // {
549
+ // colStyle: {
550
+ // paddingTop: '16px',
551
+ // borderRight: '1px solid #d9d9d9',
552
+ // height: '100%',
553
+ // },
554
+ // width: 16,
555
+ // type: "parent",
556
+ // childSections: [
557
+ // {
558
+ // type: "col-label",
559
+ // inputFields: [
560
+ // {
561
+ // id: "sms-editor",
562
+ // label: "Message",
563
+ // labelStyle: {
564
+ // backgroundColor: 'white',
565
+ // textAlign: 'left',
566
+ // color: '#333333',
567
+ // lineHeight: '24px',
568
+ // fontSize: '16px',
569
+ // fontWeight: '600',
570
+ // fontFamily: 'proxima-nova, sans-serif',
571
+ // fontStyle: 'normal',
572
+ // },
573
+ // style: {
574
+ // textAlign: 'left',
575
+ // color: '#333333',
576
+ // fontFamily: 'Open-Sans',
577
+ // lineHeight: '24px',
578
+ // fontSize: '14px',
579
+ // },
580
+ // type: "textarea",
581
+ // metaType: "text",
582
+ // datatype: "string",
583
+ // required: true,
584
+ // placeholder: "Please input sms template content.",
585
+ // fluid: false,
586
+ // styling: "semantic",
587
+ // onlyDisplay: false,
588
+ // width: 18,
589
+ // autosize: true,
590
+ // autosizeParams: {
591
+ // minRows: 3,
592
+ // },
593
+ // order: 2,
594
+ // customComponent: true,
595
+ // supportedEvents: {
596
+ // onChange: this.onTemplateContentChange,
597
+ // },
598
+ // },
599
+ // ],
600
+ // actionFields: [
601
+ // ],
602
+ // },
603
+ // {
604
+ // type: "multicols",
605
+ // inputFields: [
606
+ // {
607
+ // cols: [
608
+ // {
609
+ // offset: 19,
610
+ // id: "tagList",
611
+ // label: "Tags",
612
+ // type: "tag-list", //Resembles component to be used
613
+ // metaType: "List",
614
+ // datatype: "select",
615
+ // required: true,
616
+ // fluid: true,
617
+ // onlyDisplay: true,
618
+ // styling: "semantic",
619
+ // order: 1,
620
+ // customComponent: true,
621
+ // supportedEvents: {
622
+ // onTagSelect: this.onTagSelect,
623
+ // },
624
+ // },
625
+ // ],
626
+ // },
627
+ // {
628
+ // cols: [
629
+ // {
630
+ // id: "unicode-validity",
631
+ // label: "Allow Unicode characters?",
632
+ // labelStyle: {
633
+ // backgroundColor: "white",
634
+ // },
635
+ // style: {
636
+ // textAlign: 'left',
637
+ // color: '#262626',
638
+ // fontFamily: 'Open-Sans',
639
+ // lineHeight: '24px',
640
+ // fontSize: '14px',
641
+ // },
642
+ // type: "checkbox", //Resembles component to be used
643
+ // metaType: "text",
644
+ // datatype: "boolean",
645
+ // required: true,
646
+ // fluid: true,
647
+ // styling: "semantic",
648
+ // order: 1,
649
+ // width: 10,
650
+ // offset: 4,
651
+ // onlyDisplay: false,
652
+ // customComponent: false,
653
+ // supportedEvents: {
654
+ // onChange: this.onTemplateNameChange,
655
+ // },
656
+ // },
657
+ // ],
658
+ // },
659
+ // ],
660
+ // actionFields: [],
661
+ // },
662
+ // ],
663
+ // },
664
+ // {
665
+ // width: 6,
666
+ // type: "multicols",
667
+ // offset: 1,
668
+ // colStyle: {
669
+ // paddingTop: '16px',
670
+ // },
671
+ // inputFields: [
672
+ // {
673
+ // cols: [
674
+ // {
675
+ // id: "sms-preview",
676
+ // type: "sms-preview", //Resembles component to be used
677
+ // customComponent: true,
678
+ // customStyling: { padding: '0' },
679
+ // metaType: "preview",
680
+ // required: true,
681
+ // fluid: true,
682
+ // styling: "semantic",
683
+ // order: 1,
684
+ // width: 5,
685
+ // onlyDisplay: true,
686
+ // offset: 7,
687
+ // channel: 'SMS',
688
+ // supportedEvents: {
689
+ // onChange: this.onTemplateNameChange,
690
+ // },
691
+ // },
692
+ // ],
693
+ // },
694
+ // ],
695
+ // },
696
+ // ],
697
+ // },
698
+ // ],
699
+ // },
700
+ // ],
701
+ // type: "tabs",
702
+ // defaultPanes: 1,
703
+ // additionalPanes: 0,
704
+ // id: "pane",
705
+ // tabBarExtraContent: {
706
+ // sections: [
707
+ // {
708
+ // type: "multicols",
709
+ // actionFields: [
710
+ // {
711
+ // cols: [
712
+ // {
713
+ // id: "add-version-button",
714
+ // metaType: "submit-button",
715
+ // type: "button",
716
+ // buttonType: "cancel",
717
+ // icon: "plus-circle-o",
718
+ // value: "New Version",
719
+ // customComponent: false,
720
+ // onlyDisplay: true,
721
+ // styling: "semantic",
722
+ // order: 3,
723
+ // fluid: false,
724
+ // submitAction: "addVersion",
725
+ // supportedEvents: {
726
+ // addVersion: this.addVersion,
727
+ // },
728
+ // },
729
+ // ],
730
+ // },
731
+ // ],
732
+ // inputFields: [],
733
+ // },
734
+ // ],
735
+ // },
736
+ // tabContent: {
737
+ // sections: [
738
+ // {
739
+ // type: "multicols",
740
+ // inputFields: [
741
+ // {
742
+ // rowStyle: {
743
+ // display: "flex",
744
+ // flex: 1,
745
+ // },
746
+ // cols: [
747
+ // {
748
+ // id: "tab-header",
749
+ // metaType: "label",
750
+ // value: "Version",
751
+ // primitive: true,
752
+ // dynamicTab: true,
753
+ // type: "div",
754
+ // width: 5,
755
+ // offset: 0,
756
+ // onlyDisplay: true,
757
+ // colStyle: {
758
+ // flex: 1,
759
+ // },
760
+ // supportedEvents: {
761
+ // onChange: this.onVersionNameChange,
762
+ // },
763
+ // },
764
+ // {
765
+ // id: "tab-options-popover",
766
+ // metaType: "display",
767
+ // colStyle: {
768
+ // flex: 0,
769
+ // },
770
+ // type: "popover",
771
+ // customComponent: false,
772
+ // styling: "semantic",
773
+ // order: 3,
774
+ // fluid: false,
775
+ // onlyDisplay: true,
776
+ // submitAction: "onTabOptionSelect",
777
+ // supportedEvents: {
778
+ // onTabOptionSelect: this.onTabOptionSelect,
779
+ // },
780
+ // content: {
781
+ // sections: [
782
+ // {
783
+ // type: "multicols",
784
+ // inputFields: [
785
+ // {
786
+ // cols: [
787
+ // {
788
+ // id: "mark-final-version-label",
789
+ // metaType: "label",
790
+ // type: "div",
791
+ // primitive: true,
792
+ // value: "Mark as Final",
793
+ // onlyDisplay: true,
794
+ // customComponent: false,
795
+ // order: 3,
796
+ // fluid: false,
797
+ // submitAction: "markFinalVersion",
798
+ // supportedEvents: {
799
+ // markFinalVersion: this.markFinalVersion,
800
+ // },
801
+ // },
802
+ // ],
803
+ // },
804
+ // {
805
+ // cols: [
806
+ // {
807
+ // id: "duplicate-version-label",
808
+ // metaType: "label",
809
+ // type: "div",
810
+ // primitive: true,
811
+ // value: "Duplicate",
812
+ // onlyDisplay: true,
813
+ // customComponent: false,
814
+ // order: 3,
815
+ // fluid: false,
816
+ // submitAction: "duplicateVersion",
817
+ // supportedEvents: {
818
+ // duplicateVersion: this.duplicateVersion,
819
+ // },
820
+ // },
821
+ // ],
822
+ // },
823
+ // {
824
+ // cols: [
825
+ // {
826
+ // id: "rename-version-label",
827
+ // metaType: "label",
828
+ // type: "div",
829
+ // primitive: true,
830
+ // value: "Rename",
831
+ // onlyDisplay: true,
832
+ // customComponent: false,
833
+ // order: 3,
834
+ // fluid: false,
835
+ // submitAction: "renameVersion",
836
+ // supportedEvents: {
837
+ // renameVersion: this.renameVersion,
838
+ // },
839
+ // },
840
+ // ],
841
+ // },
842
+ // {
843
+ // cols: [
844
+ // {
845
+ // id: "delete-version-label",
846
+ // metaType: "label",
847
+ // type: "div",
848
+ // primitive: true,
849
+ // value: "Delete",
850
+ // onlyDisplay: true,
851
+ // customComponent: false,
852
+ // order: 3,
853
+ // fluid: false,
854
+ // submitAction: "deleteVersion",
855
+ // supportedEvents: {
856
+ // deleteVersion: this.deleteVersion,
857
+ // },
858
+ // },
859
+ // ],
860
+ // },
861
+ // ],
862
+ // actionFields: [],
863
+ // },
864
+ // ],
865
+ // },
866
+ // value: {
867
+ // sections: [
868
+ // {
869
+ // type: "multicols",
870
+ // inputFields: [
871
+ // {
872
+ // cols: [
873
+ // {
874
+ // id: "tab-option-icon",
875
+ // metaType: "display",
876
+ // type: "icon",
877
+ // onlyDisplay: true,
878
+ // primitive: false,
879
+ // value: "",
880
+ // customComponent: false,
881
+ // order: 3,
882
+ // fluid: false,
883
+ // },
884
+ // ],
885
+ // },
886
+ // ],
887
+ // actionFields: [],
888
+ // },
889
+ // ],
890
+ // },
891
+ // trigger: "click",
892
+ // placement: "bottomRight",
893
+ // },
894
+ // ],
895
+ // },
896
+ // ],
897
+ // actionFields: [],
898
+ // },
899
+ // ],
900
+ // },
901
+ // label: "Version",
902
+ // supportedEvents: {
903
+ // onTabChange: this.onTabChange,
904
+ // },
905
+ // },
906
+ // ],
907
+ // channel: "SMS",
908
+ // module: "Campaigns",
909
+ // };
448
910
  this.setState({ schema: this.props.metaEntities.layouts[0].definition });
449
911
  }
450
912
 
@@ -461,13 +923,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
461
923
  }
462
924
  }
463
925
  if (isValid) {
926
+ console.log('isValid');
464
927
  return true;
465
928
  }
466
-
929
+ console.log('not valid');
467
930
  return false;
468
931
  }
469
932
 
470
933
  injectEvents(schema) {
934
+ console.log('now injecting events in edit');
471
935
  const temp = schema;
472
936
  temp.standalone.sections = this.injectSections(temp.standalone.sections);
473
937
  _.forEach(temp.containers, (container) => {
@@ -475,7 +939,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
475
939
  tempContainer = this.injectContainer(tempContainer);
476
940
  return tempContainer;
477
941
  });
478
- this.setState({schema, loadingStatus: this.state.loadingStatus + 1});
942
+ this.setState({schema});
479
943
  return schema;
480
944
  }
481
945
 
@@ -510,7 +974,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
510
974
  _.forEach(col.supportedEvents, (event) => {
511
975
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
512
976
  });
513
-
977
+ console.log('should translate multicol', temp);
514
978
  temp = this.injectMessages(temp);
515
979
  return true;
516
980
  });
@@ -527,7 +991,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
527
991
  _.forEach(col.supportedEvents, (event) => {
528
992
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
529
993
  });
530
-
994
+ console.log('should translate multicol action', temp);
531
995
  temp = this.injectMessages(temp);
532
996
  return true;
533
997
  });
@@ -547,7 +1011,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
547
1011
  _.forEach(inputField.supportedEvents, (event) => {
548
1012
  temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
549
1013
  });
550
-
1014
+ console.log('should translate collabel', temp);
551
1015
  temp = this.injectMessages(temp);
552
1016
  return true;
553
1017
  });
@@ -562,7 +1026,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
562
1026
  _.forEach(actionField.supportedEvents, (event) => {
563
1027
  temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
564
1028
  });
565
-
1029
+ console.log('should translate collabel action', temp);
566
1030
  temp = this.injectMessages(temp);
567
1031
  return true;
568
1032
  });
@@ -671,16 +1135,18 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
671
1135
  this.setState({schema, tabCount: this.state.tabCount - 1});
672
1136
  }
673
1137
 
674
- renameVersion() {
675
-
1138
+ renameVersion(data, currentTab) {
1139
+ console.log('renaming version', data, currentTab);
676
1140
  }
677
1141
 
678
- markFinalVersion() {
1142
+ markFinalVersion(data, currentTab) {
679
1143
  const message = getMessageObject('success', 'Template Marked as Final Successfully', true);
680
1144
  this.props.globalActions.addMessageToQueue(message);
1145
+ console.log('markFinal version', data, currentTab);
681
1146
  }
682
1147
 
683
- duplicateVersion() {
1148
+ duplicateVersion(data, currentTab) {
1149
+ console.log('duplicate version', data, currentTab);
684
1150
  this.addVersion(this.state.tabCount);
685
1151
  }
686
1152
 
@@ -694,6 +1160,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
694
1160
  }
695
1161
 
696
1162
  addVersion(data, addNow) {
1163
+ console.log('adding version', data);
697
1164
  let tabIndex = data + 1;
698
1165
  const schema = _.cloneDeep(this.state.schema);
699
1166
  const containers = schema.containers.slice();
@@ -717,7 +1184,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
717
1184
  });
718
1185
  firstPane.sections = sections;
719
1186
  schema.containers[0].panes.push(firstPane);
720
-
1187
+ console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
721
1188
  if (tabIndex === 5) {
722
1189
  schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
723
1190
  }
@@ -742,7 +1209,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
742
1209
  });
743
1210
  firstPane.sections = sections;
744
1211
  schema.containers[0].panes.push(firstPane);
745
-
1212
+ console.log('adding version tabIndex', tabIndex, tabIndex === 5, schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols);
746
1213
  if (tabIndex === 5) {
747
1214
  schema.containers[0].tabBarExtraContent.sections[0].actionFields[0].cols[0].disabled = true;
748
1215
  }
@@ -751,7 +1218,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
751
1218
  }
752
1219
  }
753
1220
  }
754
- insertAtCursor(field, myValue, currentTab) {
1221
+
1222
+ insertAtCursor(field, myValue) {
755
1223
  //IE support
756
1224
  const myField = field;
757
1225
  if (document.selection) {
@@ -769,16 +1237,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
769
1237
  } else {
770
1238
  myField.value += myValue;
771
1239
  }
772
- const formData = _.cloneDeep(this.state.formData);
773
- formData[currentTab - 1][field.id] = myField.value;
774
- this.setState({formData});
775
- // const event = new Event('input', { bubbles: true });
776
- // callNativeEvent({field, value: myField.value, event});
1240
+ const event = new Event('input', { bubbles: true });
1241
+ myField.dispatchEvent(event);
777
1242
  }
778
1243
 
779
1244
  handleFrameTasks = (e) => {
1245
+ console.log('data listened to is', e.data);
780
1246
  const type = e.data;
781
1247
  if (typeof type === 'object') {
1248
+ console.log('received something', type);
782
1249
  const action = type.action;
783
1250
  switch (action) {
784
1251
  case "startTemplateCreation":
@@ -802,15 +1269,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
802
1269
  this.getFormData(e);
803
1270
  break;
804
1271
  case "startTemplateCreation":
805
-
1272
+ console.log('Starting to create template');
806
1273
  //this.getFormData(e);
807
1274
  break;
808
1275
  case "moveToTemplates":
809
-
1276
+ console.log('moving to templates');
810
1277
  this.moveToTemplates();
811
1278
  break;
812
1279
  case "validateContent":
813
-
1280
+ console.log('validating Content');
814
1281
  this.validateContent(e);
815
1282
  break;
816
1283
  default:
@@ -820,7 +1287,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
820
1287
 
821
1288
  removeStandAlone() {
822
1289
  let formData = _.cloneDeep(this.state.formData);
823
-
1290
+ console.log('removing standalone 2', formData);
824
1291
  let baseFormData = {};
825
1292
  const oldBaseKeys = formData[0];
826
1293
  let baseIndex = -1;
@@ -863,11 +1330,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
863
1330
  temp.panes.push(basePane);
864
1331
  }
865
1332
  });
866
-
867
- this.setState({ schema, loadingStatus: this.state.loadingStatus + 1, formData, tabCount: 1, tabKey: formData.base.tabKey, currentTab: 1 });
1333
+ console.log('final data after removing', formData);
1334
+ this.setState({ schema, formData, tabCount: 1, tabKey: formData.base.tabKey, currentTab: 1 });
868
1335
  }
869
1336
 
870
1337
  validateContent = (e) => {
1338
+ console.log('posting final validation result', this.state.isFormValid);
871
1339
  const response = {
872
1340
  action: "validateContent",
873
1341
  value: this.state.isFormValid,
@@ -887,7 +1355,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
887
1355
 
888
1356
  saveFormData(formData) {
889
1357
  //Logic to save in db etc
890
-
1358
+ console.log('Saving form data', formData, this.state.tabCount);
891
1359
  const obj = _.cloneDeep(this.state.editData);
892
1360
  obj.versions = {
893
1361
  base: {},
@@ -898,35 +1366,20 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
898
1366
  }
899
1367
  obj.name = formData['template-name'];
900
1368
  obj.versions.base = formData.base;
901
-
902
- this.props.actions.editTemplate(obj, this.onUpdateTemplateComplete);
903
- }
904
- isSmsLoading = () => {
905
- //let {isLoading} = this.props;
906
- let isLoading = this.props.isLoadingMetaEntities || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
907
-
908
- if (!isLoading) {
909
- isLoading = this.props.isFullMode ? this.state.loadingStatus < 2 : this.state.loadingStatus < 3;
910
- }
911
- // if (isLoading && this.state.loadingStatus >= 3) {
912
- // this.props.creativesContainerActions.hideCreativesContanerLoader();
913
- // }
914
- if (!isLoading && this.props.setIsLoadingContent) {
915
- this.props.setIsLoadingContent(isLoading);
916
- }
917
- return isLoading;
1369
+ console.log('edit obj', obj);
1370
+ this.props.actions.editTemplate(obj);
918
1371
  }
919
1372
  render() {
920
1373
  const schema = this.state.schema;
921
1374
  let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? this.props.intl.formatMessage(messages.getTemplateDetailsLoader) : '';
922
1375
  tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? this.props.intl.formatMessage(messages.saveTemplateLoader) : '';
923
- const spinning = this.isSmsLoading();
924
- let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
1376
+ const spinning = this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
1377
+ let tags = this.props.metaEntities && this.props.metaEntities.tags && this.props.metaEntities.tags.standard ? this.props.metaEntities.tags.standard : [];
925
1378
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
926
1379
  tags = this.props.supportedTags;
927
1380
  }
928
1381
  return (
929
- <div className="sms-email-container">
1382
+ <div>
930
1383
  <Spin tip={tipText} spinning={spinning}>
931
1384
  {/*<Row style={{marginBottom: '16px', marginLeft: '-40px'}}>
932
1385
  <Col offset={1}>
@@ -940,7 +1393,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
940
1393
  <Row>
941
1394
  <Col>
942
1395
  <FormBuilder
943
- isFullMode={this.props.isFullMode}
944
1396
  schema={schema}
945
1397
  onSubmit={this.saveFormData}
946
1398
  onChange={this.onFormDataChange}
@@ -983,11 +1435,6 @@ Edit.propTypes = {
983
1435
  templateData: PropTypes.object,
984
1436
  supportedTags: PropTypes.array,
985
1437
  getDefaultTags: PropTypes.string,
986
- isLoadingMetaEntities: PropTypes.bool,
987
- // creativesContainerActions: PropTypes.object,
988
- isFullMode: PropTypes.bool,
989
- getFormSubscriptionData: PropTypes.func,
990
- setIsLoadingContent: PropTypes.func,
991
1438
  // route: PropTypes.object,
992
1439
  injectedTags: PropTypes.object,
993
1440
  };
@@ -998,14 +1445,12 @@ const mapStateToProps = createStructuredSelector({
998
1445
  templateDetails: makeSelectTemplateDetailsResponse(),
999
1446
  metaEntities: makeSelectMetaEntities(),
1000
1447
  injectedTags: setInjectedTags(),
1001
- isLoadingMetaEntities: isLoadingMetaEntities(),
1002
1448
  });
1003
1449
 
1004
1450
  function mapDispatchToProps(dispatch) {
1005
1451
  return {
1006
1452
  actions: bindActionCreators(actions, dispatch),
1007
1453
  globalActions: bindActionCreators(globalActions, dispatch),
1008
- creativesContainerActions: bindActionCreators(creativesContainerActions, dispatch),
1009
1454
  };
1010
1455
  }
1011
1456