@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
@@ -0,0 +1,1261 @@
1
+ /*
2
+ *
3
+ * Ebill
4
+ *
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+
9
+ import React from 'react';
10
+ import { connect } from 'react-redux';
11
+ import { bindActionCreators } from 'redux';
12
+ import { Spin, Row, Col, Breadcrumb } from 'antd';
13
+ import Helmet from 'react-helmet';
14
+ import { injectIntl, intlShape } from 'react-intl';
15
+ import _ from 'lodash';
16
+ import { createStructuredSelector } from 'reselect';
17
+ import * as actions from './actions';
18
+ import FormBuilder from '../../components/FormBuilder';
19
+ import { makeSelectMetaEntities, makeSelectAuthenticated, setInjectedTags } from '../Cap/selectors';
20
+ import * as globalActions from '../../containers/Cap/actions';
21
+ import { UserIsAuthenticated } from '../../utils/authWrapper';
22
+ import { makeSelectTemplates } from '../Templates/selectors';
23
+ import {getMessageObject} from '../../utils/messageUtils';
24
+ import makeSelectEbill from './selectors';
25
+ import messages from './messages';
26
+ import EmailPreview from '../../components/EmailPreview';
27
+ import './_ebill.scss';
28
+ import callNativeEvent from '../../utils/callNativeEvent';
29
+ const BreadcrumbItem = Breadcrumb.Item;
30
+
31
+ export class Ebill extends React.Component { // eslint-disable-line react/prefer-stateless-function
32
+ constructor(props) {
33
+ super(props);
34
+ this.state = {
35
+ formData: {},
36
+ tabCount: 1,
37
+ currentTab: 1,
38
+ isEdit: false,
39
+ loading: false,
40
+ isFormValid: true,
41
+ injectedTags: {},
42
+ checkValidation: false,
43
+ tabKey: '',
44
+ showEbillPreview: false,
45
+ device: 'desktop',
46
+ schema: {},
47
+ // schema: {
48
+ // standalone: {
49
+ // sections: [
50
+ // {
51
+ // type: "multicols",
52
+ // inputFields: [
53
+ // {
54
+ // cols: [
55
+ // {
56
+ // id: "template-name",
57
+ // placeholder: "Enter template name",
58
+ // type: "input",
59
+ // metaType: "text",
60
+ // datatype: "string",
61
+ // required: true,
62
+ // style: {
63
+ // fontSize: "20px",
64
+ // fontFamily: "proxima-nova,sans-serif",
65
+ // fontStyle: "normal",
66
+ // fontWeight: 600,
67
+ // },
68
+ // styling: "semantic",
69
+ // order: 1,
70
+ // width: 9,
71
+ // customComponent: false,
72
+ // standalone: true,
73
+ // onlyDisplay: false,
74
+ // errorMessage: "Template name cannot be empty.",
75
+ // supportedEvents: [
76
+ // "onChange",
77
+ // ],
78
+ // },
79
+ // // {
80
+ // // id: "template-version",
81
+ // // type: "select", //Resembles component to be used
82
+ // // options: [],
83
+ // // metaType: "text",
84
+ // // datatype: "string",
85
+ // // required: true,
86
+ // // fluid: true,
87
+ // // style: {
88
+ // // fontSize: '14px',
89
+ // // fontFamily: 'open-sans',
90
+ // // fontStyle: 'normal',
91
+ // // marginBottom: '16px',
92
+ // // },
93
+ // // styling: "semantic",
94
+ // // order: 1,
95
+ // // width: 5,
96
+ // // customComponent: false,
97
+ // // standalone: true,
98
+ // // supportedEvents: [
99
+ // // 'onSelect',
100
+ // // 'addVersion',
101
+ // // ],
102
+ // // },
103
+ // {
104
+ // id: "preview-button",
105
+ // width: 3,
106
+ // offset: 8,
107
+ // metaType: "submit-button",
108
+ // colStyle: {
109
+ // textAlign: "right",
110
+ // paddingRight: "12px",
111
+ // },
112
+ // type: "button",
113
+ // buttonType: "cancel",
114
+ // value: "Preview",
115
+ // customComponent: false,
116
+ // standalone: true,
117
+ // styling: "semantic",
118
+ // order: 3,
119
+ // fluid: false,
120
+ // submitAction: "previewTemplate",
121
+ // onlyDisplay: true,
122
+ // supportedEvents: [
123
+ // "previewTemplate",
124
+ // ],
125
+ // },
126
+ // {
127
+ // id: "cancel-button",
128
+ // width: 2,
129
+ // metaType: "submit-button",
130
+ // colStyle: {
131
+ // textAlign: "right",
132
+ // width: "9%",
133
+ // },
134
+ // type: "button",
135
+ // buttonType: "cancel",
136
+ // value: "Cancel",
137
+ // customComponent: false,
138
+ // standalone: true,
139
+ // styling: "semantic",
140
+ // order: 3,
141
+ // fluid: false,
142
+ // onlyDisplay: true,
143
+ // submitAction: "cancelTemplate",
144
+ // supportedEvents: [
145
+ // "cancelTemplate",
146
+ // ],
147
+ // },
148
+ // {
149
+ // id: "save-button",
150
+ // width: 2,
151
+ // metaType: "submit-button",
152
+ // colStyle: {
153
+ // textAlign: "right",
154
+ // width: "7%",
155
+ // },
156
+ // type: "button",
157
+ // buttonType: "primary",
158
+ // value: "Save",
159
+ // customComponent: false,
160
+ // styling: "semantic",
161
+ // order: 3,
162
+ // fluid: false,
163
+ // standalone: true,
164
+ // onlyDisplay: true,
165
+ // submitAction: "saveFormData",
166
+ // supportedEvents: [
167
+ // "saveFormData",
168
+ // ],
169
+ // },
170
+ // ],
171
+ // },
172
+ // ],
173
+ // actionFields: [],
174
+ // },
175
+ // ],
176
+ // },
177
+ // containers: [
178
+ // {
179
+ // panes: [
180
+ // {
181
+ // sections: [
182
+ // {
183
+ // type: "parent",
184
+ // width: 24,
185
+ // rowStyle: {
186
+ // height: "calc(100vh - 142px)",
187
+ // },
188
+ // childSections: [
189
+ // {
190
+ // colStyle: {
191
+ // paddingBottom: "16px",
192
+ // height: "100%",
193
+ // },
194
+ // width: 24,
195
+ // type: "parent",
196
+ // childSections: [
197
+ // {
198
+ // type: "multicols",
199
+ // inputFields: [
200
+ // {
201
+ // cols: [
202
+ // {
203
+ // id: "ebill-editor",
204
+ // style: {
205
+ // background: '#efefef',
206
+ // resize: 'none',
207
+ // float: 'left',
208
+ // border: '1px solid #efefef',
209
+ // width: "100%",
210
+ // height: '100%',
211
+ // },
212
+ // type: "textarea",
213
+ // metaType: "text",
214
+ // datatype: "string",
215
+ // required: true,
216
+ // errorMessage: "Template content has unsupported/missing tags!",
217
+ // fluid: false,
218
+ // styling: "semantic",
219
+ // onlyDisplay: false,
220
+ // width: 24,
221
+ // // autosize: true,
222
+ // // autosizeParams: {
223
+ // // maxRows: 18,
224
+ // // minRows: 3,
225
+ // // },
226
+ // order: 2,
227
+ // customComponent: true,
228
+ // supportedEvents: [
229
+ // "onChange",
230
+ // ],
231
+ // },
232
+ // ],
233
+ // },
234
+
235
+ // ],
236
+ // actionFields: [],
237
+ // },
238
+ // // {
239
+ // // type: "multicols",
240
+ // // inputFields: [
241
+ // // {
242
+ // // cols: [
243
+ // // {
244
+ // // offset: 19,
245
+ // // id: "tagList",
246
+ // // label: "Tags",
247
+ // // type: "tag-list",
248
+ // // metaType: "List",
249
+ // // datatype: "select",
250
+ // // required: true,
251
+ // // fluid: true,
252
+ // // onlyDisplay: true,
253
+ // // styling: "semantic",
254
+ // // order: 1,
255
+ // // customComponent: true,
256
+ // // supportedEvents: [
257
+ // // "onTagSelect",
258
+ // // ],
259
+ // // },
260
+ // // ],
261
+ // // },
262
+ // // ],
263
+ // // actionFields: [],
264
+ // // },
265
+ // ],
266
+ // },
267
+ // ],
268
+ // },
269
+ // ],
270
+ // },
271
+ // ],
272
+ // type: "tabs",
273
+ // defaultPanes: 1,
274
+ // additionalPanes: 0,
275
+ // id: "pane",
276
+ // tabBarExtraContent: {
277
+ // sections: [
278
+ // {
279
+ // type: "multicols",
280
+ // actionFields: [
281
+ // {
282
+ // cols: [
283
+ // // {
284
+ // // id: "add-version-button",
285
+ // // metaType: "submit-button",
286
+ // // type: "button",
287
+ // // buttonType: "cancel",
288
+ // // icon: "plus-circle-o",
289
+ // // value: "New Version",
290
+ // // customComponent: false,
291
+ // // onlyDisplay: true,
292
+ // // styling: "semantic",
293
+ // // order: 3,
294
+ // // fluid: false,
295
+ // // submitAction: "addVersion",
296
+ // // supportedEvents: [
297
+ // // "addVersion",
298
+ // // ],
299
+ // // },
300
+ // {
301
+ // offset: 6,
302
+ // id: "tagList",
303
+ // label: "Tags",
304
+ // type: "tag-list",
305
+ // metaType: "List",
306
+ // datatype: "select",
307
+ // required: true,
308
+ // fluid: true,
309
+ // onlyDisplay: true,
310
+ // styling: "semantic",
311
+ // order: 1,
312
+ // customComponent: true,
313
+ // supportedEvents: [
314
+ // "onTagSelect",
315
+ // ],
316
+ // },
317
+ // ],
318
+ // },
319
+ // ],
320
+ // inputFields: [],
321
+ // },
322
+ // ],
323
+ // },
324
+ // tabContent: {
325
+ // sections: [
326
+ // {
327
+ // type: "multicols",
328
+ // inputFields: [
329
+ // {
330
+ // rowStyle: {
331
+ // display: "flex",
332
+ // flex: 1,
333
+ // },
334
+ // cols: [
335
+ // {
336
+ // id: "base-version-icon",
337
+ // metaType: "display",
338
+ // type: "icon",
339
+ // onlyDisplay: true,
340
+ // primitive: false,
341
+ // value: "chat",
342
+ // customComponent: false,
343
+ // order: 3,
344
+ // fluid: false,
345
+ // style: {
346
+ // color: "#2E89DF",
347
+ // },
348
+ // },
349
+ // {
350
+ // id: "tab-header",
351
+ // metaType: "label",
352
+ // value: "English",
353
+ // primitive: true,
354
+ // dynamicTab: false,
355
+ // type: "div",
356
+ // width: 5,
357
+ // offset: 0,
358
+ // onlyDisplay: true,
359
+ // colStyle: {
360
+ // flex: 1,
361
+ // },
362
+ // supportedEvents: [
363
+ // "onChange",
364
+ // ],
365
+ // },
366
+ // {
367
+ // id: "tab-options-popover",
368
+ // metaType: "display",
369
+ // colStyle: {
370
+ // flex: 0,
371
+ // display: 'none',
372
+ // },
373
+ // type: "popover",
374
+ // customComponent: false,
375
+ // styling: "semantic",
376
+ // order: 3,
377
+ // fluid: false,
378
+ // onlyDisplay: true,
379
+ // submitAction: "onTabOptionSelect",
380
+ // supportedEvents: [
381
+ // "onTabOptionSelect",
382
+ // ],
383
+ // content: {
384
+ // sections: [
385
+ // {
386
+ // type: "multicols",
387
+ // inputFields: [
388
+ // {
389
+ // cols: [
390
+ // {
391
+ // id: "mark-final-version-label",
392
+ // metaType: "label",
393
+ // type: "div",
394
+ // primitive: true,
395
+ // value: "Mark as Final",
396
+ // onlyDisplay: true,
397
+ // customComponent: false,
398
+ // order: 3,
399
+ // fluid: false,
400
+ // className: "version-popover",
401
+ // submitAction: "markFinalVersion",
402
+ // supportedEvents: [
403
+ // "markFinalVersion",
404
+ // ],
405
+ // },
406
+ // ],
407
+ // },
408
+ // {
409
+ // cols: [
410
+ // {
411
+ // id: "duplicate-version-label",
412
+ // metaType: "label",
413
+ // type: "div",
414
+ // primitive: true,
415
+ // value: "Duplicate",
416
+ // onlyDisplay: true,
417
+ // customComponent: false,
418
+ // order: 3,
419
+ // fluid: false,
420
+ // className: "version-popover",
421
+ // submitAction: "duplicateVersion",
422
+ // supportedEvents: [
423
+ // "duplicateVersion",
424
+ // ],
425
+ // },
426
+ // ],
427
+ // },
428
+ // {
429
+ // cols: [
430
+ // {
431
+ // id: "rename-version-label",
432
+ // metaType: "label",
433
+ // type: "div",
434
+ // primitive: true,
435
+ // value: "Rename",
436
+ // onlyDisplay: true,
437
+ // customComponent: false,
438
+ // order: 3,
439
+ // fluid: false,
440
+ // className: "version-popover",
441
+ // submitAction: "renameVersion",
442
+ // supportedEvents: [
443
+ // "renameVersion",
444
+ // ],
445
+ // },
446
+ // ],
447
+ // },
448
+ // {
449
+ // cols: [
450
+ // {
451
+ // id: "delete-version-label",
452
+ // metaType: "label",
453
+ // type: "div",
454
+ // primitive: true,
455
+ // value: "Delete",
456
+ // onlyDisplay: true,
457
+ // customComponent: false,
458
+ // order: 3,
459
+ // fluid: false,
460
+ // className: "version-popover",
461
+ // submitAction: "deleteVersion",
462
+ // supportedEvents: [
463
+ // "deleteVersion",
464
+ // ],
465
+ // },
466
+ // ],
467
+ // },
468
+ // ],
469
+ // actionFields: [],
470
+ // },
471
+ // ],
472
+ // },
473
+ // value: {
474
+ // sections: [
475
+ // {
476
+ // type: "multicols",
477
+ // inputFields: [
478
+ // {
479
+ // cols: [
480
+ // {
481
+ // id: "tab-option-icon",
482
+ // metaType: "display",
483
+ // type: "icon",
484
+ // onlyDisplay: true,
485
+ // primitive: false,
486
+ // value: "",
487
+ // customComponent: false,
488
+ // order: 3,
489
+ // fluid: false,
490
+ // },
491
+ // ],
492
+ // },
493
+ // ],
494
+ // actionFields: [],
495
+ // },
496
+ // ],
497
+ // },
498
+ // trigger: "click",
499
+ // placement: "bottomRight",
500
+ // },
501
+ // ],
502
+ // },
503
+ // ],
504
+ // actionFields: [],
505
+ // },
506
+ // ],
507
+ // },
508
+ // label: "Version",
509
+ // onlyDisplay: true,
510
+ // supportedEvents: [
511
+ // "onTabChange",
512
+ // ],
513
+ // },
514
+ // ],
515
+ // channel: "EBILL",
516
+ // },
517
+ };
518
+
519
+ this.map = {
520
+ "template-name": {
521
+ onChange: this.onTemplateNameChange,
522
+ },
523
+ "template-version": {
524
+ onSelect: this.handleVersionSelect,
525
+ addVersion: this.addVersion,
526
+ },
527
+ "preview-button": {
528
+ previewTemplate: this.toggleEmailPreview,
529
+ },
530
+ "cancel-button": {
531
+ cancelTemplate: this.cancelTemplate,
532
+ },
533
+ "save-button": {
534
+ saveFormData: this.saveFormData,
535
+ },
536
+ "ebill-editor": {
537
+ onChange: this.onTemplateContentChange,
538
+ },
539
+ "tagList": {
540
+ onTagSelect: this.onTagSelect,
541
+ },
542
+ "add-language-button": {
543
+ addLanguage: this.addLanguage,
544
+ },
545
+ "tab-header": {
546
+ onChange: this.onVersionNameChange,
547
+ },
548
+ "tab-options-popover": {
549
+ onTabOptionSelect: this.onTabOptionSelect,
550
+ },
551
+ "mark-final-version-label": {
552
+ markFinalVersion: this.markFinalVersion,
553
+ },
554
+ "duplicate-version-label": {
555
+ duplicateVersion: this.duplicateVersion,
556
+ },
557
+ "rename-version-label": {
558
+ renameVersion: this.renameVersion,
559
+ },
560
+ "delete-version-label": {
561
+ deleteVersion: this.deleteVersion,
562
+ },
563
+ "pane": {
564
+ onTabChange: this.onTabChange,
565
+ },
566
+ "delete-language-label": {
567
+ deleteLanguage: this.deleteLanguage,
568
+ },
569
+ };
570
+ this.isTagLoaded = false;
571
+ }
572
+
573
+ componentWillMount() {
574
+ if (this.props.params.id) {
575
+ this.props.actions.getTemplateDetails(this.props.params.id, 'ebill');
576
+ this.setState({isEdit: true});
577
+ }
578
+
579
+ if (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.is_drag_drop) {
580
+ this.props.actions.getCmsData('edm', this.props.Templates.edmTemplate.versions.base.drag_drop_id);
581
+ }
582
+ }
583
+
584
+ componentDidMount() {
585
+ const query = {
586
+ layout: 'EBILL',
587
+ type: 'LAYOUT',
588
+ };
589
+ this.props.globalActions.fetchSchemaForEntity(query);
590
+ console.log('Form Data After 2', this.state.formData, this.props.Ebill.cmsData);
591
+ }
592
+
593
+ componentWillReceiveProps(nextProps) {
594
+ if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
595
+ this.injectEvents(nextProps.metaEntities.layouts[0].definition);
596
+ console.log('isTagLoaded', this.isTagLoaded);
597
+ const query = {
598
+ layout: 'EBILL',
599
+ type: 'TAG',
600
+ context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
601
+ embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
602
+ };
603
+ this.props.globalActions.fetchSchemaForEntity(query);
604
+ }
605
+
606
+ if (this.state.isEdit && !_.isEmpty(nextProps.Ebill.templateDetails) && !_.isEqual(nextProps.Ebill.templateDetails, this.props.Ebill.templateDetails)) {
607
+ this.setEditState(nextProps.Ebill.templateDetails);
608
+ }
609
+
610
+ if (nextProps.Ebill.createResponse && nextProps.Ebill.createResponse.templateId) {
611
+ let message;
612
+ if (this.state.isEdit) {
613
+ message = getMessageObject('success', this.props.intl.formatMessage(messages.ebillEditSuccess), true);
614
+ } else {
615
+ message = getMessageObject('success', this.props.intl.formatMessage(messages.ebillCreateSuccess), true);
616
+ }
617
+ this.props.globalActions.addMessageToQueue(message);
618
+ this.props.actions.clearCRUDResponse();
619
+ const module = this.props.location.query.module ? this.props.location.query.module : 'default';
620
+ const type = this.props.location.query.type;
621
+ this.props.router.push({
622
+ pathname: `/ebill`,
623
+ query: type === 'embedded' ? {type: 'embedded', module} : {module},
624
+ });
625
+ }
626
+
627
+ if (nextProps.Ebill.createTemplateError && !_.isEqual(nextProps.Ebill.createTemplateError, this.props.Ebill.createTemplateError)) {
628
+ const message = getMessageObject('error', (nextProps.Ebill.createTemplateErrorMessage && nextProps.Ebill.createTemplateErrorMessage !== '') ? nextProps.Ebill.createTemplateErrorMessage : this.props.intl.formatMessage(messages.somethingWentWrong), true);
629
+ this.props.globalActions.addMessageToQueue(message);
630
+ }
631
+
632
+ console.log('Form Data After ', nextProps.Ebill.cmsData, this.props.Ebill.cmsData);
633
+ if (nextProps.Ebill.cmsData !== '' && !_.isEqual(nextProps.Ebill.cmsData, this.props.Ebill.cmsData)) {
634
+ const formData = _.cloneDeep(this.state.formData);
635
+ formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] = nextProps.Ebill.cmsData.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/\\&quot;/g, "\"");
636
+ console.log('Manoj Form Data After 21', formData);
637
+ this.setState({formData});
638
+ }
639
+
640
+ if (nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && this.state.formData[this.state.currentTab - 1] && this.state.formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] !== '') {
641
+ const formData = _.cloneDeep(this.state.formData);
642
+ formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] = nextProps.Templates.selectedEmailLayout;
643
+ console.log('Manoj Form Data After 01', formData);
644
+ this.setState({formData});
645
+ }
646
+
647
+ if (nextProps.Templates.selectedEmailLayout && !_.isEqual(nextProps.Templates.selectedEmailLayout, this.props.Templates.selectedEmailLayout) && !_.isEmpty(this.state.schema)) {
648
+ this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : '')}, () => {
649
+ // this.injectEvents(this.state.schema);
650
+ });
651
+ }
652
+ }
653
+
654
+ componentWillUnmount() {
655
+ this.props.actions.clearStoreValues();
656
+ }
657
+
658
+ onTagSelect = (data, currentTab, value) => {
659
+ console.log('On Tag selection ', data, currentTab, value);
660
+ if (this.state.isDragDrop) {
661
+ const msg = {
662
+ action: "InsertToCursor",
663
+ content: `{{${data}}}`,
664
+ };
665
+ const msgString = JSON.stringify(msg);
666
+ const win = document.getElementById(`edmeditor${this.state.currentTab > 1 ? this.state.currentTab : ''}`).contentWindow;
667
+ win.postMessage(msgString, '*');
668
+ } else {
669
+ this.state.editorInstanse.insertHtml(`{{${data}}}`);
670
+ }
671
+ };
672
+
673
+ onTabChange = (data, formData) => {
674
+ console.log('inside parent ontabchange', data, this.state);
675
+ this.setState({currentTab: data, formData});
676
+ };
677
+
678
+ onFormDataChange = (formData, tabCount, currentTab) => {
679
+ console.log('Form data changed is ', formData, tabCount, currentTab);
680
+ const tmpFormData = _.cloneDeep(formData);
681
+ if (this.props.Templates.selectedEmailLayout !== '' && tmpFormData['0']['ebill-editor'] === '') {
682
+ tmpFormData['0']['ebill-editor'] = this.props.Templates.selectedEmailLayout;
683
+ tmpFormData.base['ebill-editor'] = this.props.Templates.selectedEmailLayout;
684
+ }
685
+ this.setState({formData: tmpFormData, tabCount});
686
+ if (currentTab) {
687
+ this.setState({currentTab});
688
+ }
689
+ };
690
+
691
+ onTagSelect = (data, currentTab) => {
692
+ console.log('parent data tag', data, currentTab);
693
+ const editorId = currentTab > 1 ? `ebill-editor${currentTab}` : 'ebill-editor';
694
+ this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`);
695
+ document.getElementById(editorId).focus();
696
+ };
697
+
698
+ onTemplateNameChange = (name) => {
699
+ console.log('Template name changed to ', name);
700
+ };
701
+
702
+ onTemplateContentChange = (content) => {
703
+ console.log('Template content changed to ', content);
704
+ };
705
+
706
+ setEditState = (data) => {
707
+ const that = this;
708
+ const tabCount = data.versions.history.length;
709
+ const formData = {};
710
+ formData['template-name'] = data.name;
711
+ const type = this.props.location.query.type;
712
+ let ifBase = false;
713
+ for (let count = 0; count < tabCount; count += 1) {
714
+ formData[count] = _.cloneDeep(data.versions.history[count]);
715
+ if (data.versions && data.versions.history && data.versions.history[count] && data.versions.history[count].base) {
716
+ if (!formData[count]) {
717
+ formData[count] = {};
718
+ }
719
+ formData[count].base = true;
720
+ ifBase = true;
721
+ }
722
+ if (type === 'embedded' || count > 0) {
723
+ setTimeout( () => {
724
+ console.log('removing standalone');
725
+ if (type === 'embedded') {
726
+ that.removeStandAlone();
727
+ } else {
728
+ that.addVersion(count, tabCount);
729
+ }
730
+ }, 0 );
731
+ }
732
+ }
733
+ if (!ifBase) {
734
+ if (!formData[0]) {
735
+ formData[0] = {};
736
+ }
737
+ formData[0].base = true;
738
+ }
739
+ formData.base = data.versions.base;
740
+ console.log('form data after discarding ', formData);
741
+ this.setState({tabCount, formData, editData: data, currentTab: 1}, () => {
742
+ });
743
+ };
744
+
745
+ getMappedEvent = (id, event) => {
746
+ console.log('Map ', this.map, id, event);
747
+ return this.map[id][event];
748
+ };
749
+
750
+ setFormValidity = (isFormValid) => {
751
+ this.setState({isFormValid});
752
+ };
753
+
754
+ changePreviewDevice = (device) => {
755
+ this.setState({ device });
756
+ };
757
+
758
+ toggleEmailPreview = () => {
759
+ this.setState({ showEbillPreview: !this.state.showEbillPreview });
760
+ };
761
+
762
+ cancelTemplate = () => {
763
+ const type = this.props.location.query.type;
764
+ const module = this.props.location.query.module ? this.props.location.query.module : 'default';
765
+ this.props.router.push({
766
+ pathname: `/ebill/`,
767
+ query: type === 'embedded' ? {type: 'embedded', module} : {module},
768
+ });
769
+ };
770
+
771
+ saveFormData = (formData) => {
772
+ //Logic to save in db etc
773
+ // const isValidated = this.validateFormData(formData);
774
+ // console.log('whyyyy');
775
+ // if (!isValidated) {
776
+ // return;
777
+ // }
778
+ console.log('Saving form data', formData, this.state.tabCount);
779
+ const obj = {};
780
+ obj.versions = {
781
+ base: {},
782
+ history: [],
783
+ };
784
+ if (this.state.isEdit) {
785
+ obj._id = this.props.Ebill.templateDetails._id;
786
+ }
787
+ obj.type = 'EBILL';
788
+ _.forEach(formData, (data, index) => {
789
+ if (!isNaN(index) && data) {
790
+ obj.versions.history.push(data);
791
+ }
792
+ });
793
+ obj.name = formData['template-name'];
794
+ obj.versions.base = formData.base;
795
+ console.log('HTML file ', obj.versions.history);
796
+ _.forEach(obj.versions.history, (index, version) => {
797
+ console.log('Encoding ', index, version);
798
+ });
799
+ console.log('obj', obj);
800
+ this.props.actions.createTemplate(obj);
801
+ };
802
+
803
+ validateFormData = (formData) => {
804
+ const tabCount = this.state.tabCount;
805
+ let isValid = true;
806
+ for (let cnt = 0; cnt < tabCount; cnt += 1) {
807
+ const index = cnt + 1;
808
+ if (formData[cnt]) {
809
+ const text = formData[cnt][`sms-editor${index > 1 ? index : ''}`];
810
+ if (text.indexOf('{{optout}}') === -1) {
811
+ isValid = false;
812
+ }
813
+ }
814
+ }
815
+ if (isValid) {
816
+ console.log('isValid');
817
+ return true;
818
+ }
819
+ const message = getMessageObject('error', 'Template data is not valid', true);
820
+ this.props.globalActions.addMessageToQueue(message);
821
+ console.log('not valid');
822
+ return false;
823
+ };
824
+
825
+ handleOnTagsContextChange = (data) => {
826
+ console.log('parent tags context', data);
827
+ const query = {
828
+ layout: 'EBILL',
829
+ type: 'TAG',
830
+ context: data.toLowerCase() === 'all' ? 'default' : data.toLowerCase(),
831
+ embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
832
+ };
833
+ this.props.globalActions.fetchSchemaForEntity(query);
834
+ };
835
+
836
+ removeStandAlone = () => {
837
+ const schema = _.cloneDeep(this.state.schema);
838
+ delete schema.standalone;
839
+ schema.standalone = {};
840
+ schema.standalone.sections = [];
841
+ _.forEach(schema.containers, (container) => {
842
+ const temp = container;
843
+ if (temp.type === 'tabs') {
844
+ temp.tabBarExtraContent = {};
845
+ temp.tabBarExtraContent.sections = [];
846
+ const basePane = _.cloneDeep(temp.panes[0]);
847
+ temp.tabContent = {};
848
+ temp.tabContent.sections = [];
849
+ temp.panes = [];
850
+ temp.panes.push(basePane);
851
+ }
852
+ });
853
+ this.setState({ schema });
854
+ };
855
+
856
+ resetState = () => {
857
+ this.setState({
858
+ formData: {},
859
+ tabCount: 1,
860
+ currentTab: 1,
861
+ });
862
+ };
863
+
864
+ resetSchema = () => {
865
+
866
+ };
867
+
868
+ insertAtCursor = (field, myValue) => {
869
+ //IE support
870
+ const myField = field;
871
+ if (document.selection) {
872
+ myField.focus();
873
+ const sel = document.selection.createRange();
874
+ sel.text = myValue;
875
+ } else if (myField.selectionStart || myField.selectionStart === '0') { //MOZILLA and others
876
+ const startPos = myField.selectionStart;
877
+ const endPos = myField.selectionEnd;
878
+ myField.value = myField.value.substring(0, startPos)
879
+ + myValue
880
+ + myField.value.substring(endPos, myField.value.length);
881
+ myField.selectionStart = startPos + myValue.length;
882
+ myField.selectionEnd = startPos + myValue.length;
883
+ } else {
884
+ myField.value += myValue;
885
+ }
886
+ const event = new Event('input', { bubbles: true });
887
+ callNativeEvent({field, value: myField.value, event});
888
+ };
889
+
890
+ injectMessages(elem) {
891
+ const temp = elem;
892
+ if (temp.value && messages[temp.value]) {
893
+ temp.value = this.props.intl.formatMessage(messages[temp.value]);
894
+ }
895
+ if (temp.label && messages[temp.label]) {
896
+ temp.label = this.props.intl.formatMessage(messages[temp.label]);
897
+ }
898
+ if (temp.errorMessage && messages[temp.errorMessage]) {
899
+ temp.errorMessage = this.props.intl.formatMessage(messages[temp.errorMessage]);
900
+ }
901
+ if (temp.placeholder && messages[temp.placeholder]) {
902
+ temp.placeholder = this.props.intl.formatMessage(messages[temp.placeholder]);
903
+ }
904
+ return temp;
905
+ }
906
+
907
+
908
+ injectEvents(schema) {
909
+ console.log('now injecting events', schema);
910
+ const temp = schema;
911
+ temp.standalone.sections = this.injectSections(temp.standalone.sections);
912
+ _.forEach(temp.containers, (container) => {
913
+ let tempContainer = container;
914
+ tempContainer = this.injectContainer(tempContainer);
915
+ return tempContainer;
916
+ });
917
+ console.log('final injected schema', schema);
918
+ this.setState({schema}, () => {
919
+ const type = this.props.location.query.type;
920
+ if (type === 'embedded') {
921
+ this.removeStandAlone();
922
+ }
923
+ });
924
+ return schema;
925
+ }
926
+
927
+ injectContainer(container) {
928
+ const temp = container;
929
+ if (temp.type === 'tabs') {
930
+ temp.tabContent.sections = this.injectSections(temp.tabContent.sections);
931
+ temp.tabBarExtraContent.sections = this.injectSections(temp.tabBarExtraContent.sections);
932
+ temp.tabContent.sections = this.injectSections(temp.tabContent.sections);
933
+ temp.injectedEvents = {};
934
+ _.forEach(temp.supportedEvents, (event) => {
935
+ temp.injectedEvents[event] = this.getMappedEvent(temp.id, event);
936
+ });
937
+ _.forEach(temp.panes, (pane) => {
938
+ const tempPane = pane;
939
+ tempPane.sections = this.injectSections(tempPane.sections);
940
+ });
941
+ }
942
+ return temp;
943
+ }
944
+
945
+ injectMultiColSection(section) {
946
+ _.forEach(section.inputFields, (inputField) => {
947
+ _.forEach(inputField.cols, (col) => {
948
+ const temp = col;
949
+ if (temp.type === 'popover') {
950
+ temp.content.sections = this.injectSections(temp.content.sections);
951
+ temp.value.sections = this.injectSections(temp.value.sections);
952
+ return true;
953
+ }
954
+ temp.injectedEvents = {};
955
+ _.forEach(col.supportedEvents, (event) => {
956
+ console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
957
+ temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
958
+ });
959
+ console.log('should translate multicol', temp);
960
+ if (temp.type === 'icon') {
961
+ return true;
962
+ }
963
+ if (temp.value && messages[temp.value]) {
964
+ temp.value = this.props.intl.formatMessage(messages[temp.value]);
965
+ }
966
+ if (temp.label && messages[temp.label]) {
967
+ temp.label = this.props.intl.formatMessage(messages[temp.label]);
968
+ }
969
+ if (temp.errorMessage && messages[temp.errorMessage]) {
970
+ temp.errorMessage = this.props.intl.formatMessage(messages[temp.errorMessage]);
971
+ }
972
+ if (temp.placeholder && messages[temp.placeholder]) {
973
+ temp.placeholder = this.props.intl.formatMessage(messages[temp.placeholder]);
974
+ }
975
+ return true;
976
+ });
977
+ });
978
+ _.forEach(section.actionFields, (actionField) => {
979
+ _.forEach(actionField.cols, (col) => {
980
+ const temp = col;
981
+ if (temp.type === 'popover') {
982
+ temp.content.sections = this.injectSections(temp.content.sections);
983
+ temp.value.sections = this.injectSections(temp.value.sections);
984
+ return true;
985
+ }
986
+ temp.injectedEvents = {};
987
+ _.forEach(col.supportedEvents, (event) => {
988
+ temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
989
+ });
990
+ console.log('should translate multicol action', temp);
991
+ if (temp.type === 'icon') {
992
+ return true;
993
+ }
994
+ if (temp.value && messages[temp.value]) {
995
+ temp.value = this.props.intl.formatMessage(messages[temp.value]);
996
+ }
997
+ if (temp.label && messages[temp.label]) {
998
+ temp.label = this.props.intl.formatMessage(messages[temp.label]);
999
+ }
1000
+ if (temp.errorMessage && messages[temp.errorMessage]) {
1001
+ temp.errorMessage = this.props.intl.formatMessage(messages[temp.errorMessage]);
1002
+ }
1003
+ if (temp.placeholder && messages[temp.placeholder]) {
1004
+ temp.placeholder = this.props.intl.formatMessage(messages[temp.placeholder]);
1005
+ }
1006
+ return true;
1007
+ });
1008
+ });
1009
+ return section;
1010
+ }
1011
+
1012
+ injectColLabelSection(section) {
1013
+ _.forEach(section.inputFields, (inputField) => {
1014
+ const temp = inputField;
1015
+ if (temp.type === 'popover') {
1016
+ temp.content.sections = this.injectSections(temp.content.sections);
1017
+ temp.value.sections = this.injectSections(temp.value.sections);
1018
+ return true;
1019
+ }
1020
+ temp.injectedEvents = {};
1021
+ _.forEach(inputField.supportedEvents, (event) => {
1022
+ temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
1023
+ });
1024
+ console.log('should translate collabel', temp);
1025
+ if (temp.type === 'icon') {
1026
+ return true;
1027
+ }
1028
+ if (temp.value && messages[temp.value]) {
1029
+ temp.value = this.props.intl.formatMessage(messages[temp.value]);
1030
+ }
1031
+ if (temp.label && messages[temp.label]) {
1032
+ temp.label = this.props.intl.formatMessage(messages[temp.label]);
1033
+ }
1034
+ if (temp.errorMessage && messages[temp.errorMessage]) {
1035
+ temp.errorMessage = this.props.intl.formatMessage(messages[temp.errorMessage]);
1036
+ }
1037
+ if (temp.placeholder && messages[temp.placeholder]) {
1038
+ temp.placeholder = this.props.intl.formatMessage(messages[temp.placeholder]);
1039
+ }
1040
+ return true;
1041
+ });
1042
+ _.forEach(section.actionFields, (actionField) => {
1043
+ const temp = actionField;
1044
+ if (temp.type === 'popover') {
1045
+ temp.content.sections = this.injectSections(temp.content.sections);
1046
+ temp.value.sections = this.injectSections(temp.value.sections);
1047
+ return true;
1048
+ }
1049
+ temp.injectedEvents = {};
1050
+ _.forEach(actionField.supportedEvents, (event) => {
1051
+ temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
1052
+ });
1053
+ console.log('should translate collabel action', temp);
1054
+ if (temp.type === 'icon') {
1055
+ return true;
1056
+ }
1057
+ if (temp.value && messages[temp.value]) {
1058
+ temp.value = this.props.intl.formatMessage(messages[temp.value]);
1059
+ }
1060
+ if (temp.label && messages[temp.label]) {
1061
+ temp.label = this.props.intl.formatMessage(messages[temp.label]);
1062
+ }
1063
+ if (temp.errorMessage && messages[temp.errorMessage]) {
1064
+ temp.errorMessage = this.props.intl.formatMessage(messages[temp.errorMessage]);
1065
+ }
1066
+ if (temp.placeholder && messages[temp.placeholder]) {
1067
+ temp.placeholder = this.props.intl.formatMessage(messages[temp.placeholder]);
1068
+ }
1069
+ return true;
1070
+ });
1071
+ return section;
1072
+ }
1073
+
1074
+ injectSections(sections) {
1075
+ _.forEach(sections, (section) => {
1076
+ let temp = section;
1077
+ if (temp.type === 'col-label') {
1078
+ temp = this.injectColLabelSection(temp);
1079
+ } else if (section.type === 'multicols') {
1080
+ temp = this.injectMultiColSection(temp);
1081
+ } else if (section.type === 'parent') {
1082
+ temp = this.injectSections(temp.childSections);
1083
+ }
1084
+ });
1085
+ return sections;
1086
+ }
1087
+
1088
+ injectParentSection(section) {
1089
+ _.forEach(section.childSections, (childSection) => {
1090
+ let temp = childSection;
1091
+ if (temp.type === 'col-label') {
1092
+ temp = this.injectColLabelSection(temp);
1093
+ } else if (section.type === 'multicols') {
1094
+ temp = this.injectMultiColSection(temp);
1095
+ } else if (section.type === 'parent') {
1096
+ temp = this.injectParentSection(temp);
1097
+ }
1098
+ });
1099
+ return section;
1100
+ }
1101
+
1102
+ cloneColLabel(sectionObj, tabIndex) {
1103
+ console.log('cloning cloneColLabel', sectionObj, tabIndex);
1104
+ const section = _.cloneDeep(sectionObj);
1105
+ const inputFields = _.forEach(section.inputFields, (inputField) => {
1106
+ const inputF = inputField;
1107
+ inputF.id = `${inputField.id}${tabIndex}`;
1108
+ inputF.paneIndex = tabIndex;
1109
+ return inputF;
1110
+ });
1111
+ section.inputFields = inputFields;
1112
+ console.log('cloned ifs are', section);
1113
+ return section;
1114
+ }
1115
+
1116
+ cloneMultiCol(sectionObj, tabIndex) {
1117
+ console.log('cloning multicol ', sectionObj, tabIndex);
1118
+ const section = _.cloneDeep(sectionObj);
1119
+ const inputFields = _.forEach(section.inputFields, (inputField) => {
1120
+ const inputF = inputField;
1121
+ const cols = _.forEach(inputF.cols, (col) => {
1122
+ const colTemp = col;
1123
+ colTemp.id = `${col.id}${tabIndex}`;
1124
+ colTemp.paneIndex = tabIndex;
1125
+ return colTemp;
1126
+ });
1127
+ inputF.cols = cols;
1128
+ return inputF;
1129
+ });
1130
+ section.inputFields = inputFields;
1131
+ console.log('cloned cols are', section);
1132
+ return section;
1133
+ }
1134
+
1135
+ cloneParent(section, tabIndex) {
1136
+ console.log('trying to clone', JSON.stringify(section), tabIndex);
1137
+ const parentsect = section;
1138
+ const childSectionsBeforeCloning = parentsect.childSections.slice();
1139
+ const childSections = [];
1140
+ _.forEach(childSectionsBeforeCloning, (childSection) => {
1141
+ let sect = {};
1142
+ if (childSection.type === 'col-label') {
1143
+ sect = this.cloneColLabel(childSection, tabIndex);
1144
+ } else if (childSection.type === 'multicols') {
1145
+ sect = this.cloneMultiCol(childSection, tabIndex);
1146
+ } else if (childSection.type === 'parent') {
1147
+ sect = this.cloneParent(childSection, tabIndex);
1148
+ }
1149
+ console.log('returning cloned parent section', sect);
1150
+ childSections.push(sect);
1151
+ return true;
1152
+ });
1153
+ console.log('returning cloned parent section final 1', JSON.stringify(childSections));
1154
+ parentsect.childSections = childSections;
1155
+ console.log('returning cloned parent section final', parentsect);
1156
+ return _.cloneDeep(parentsect);
1157
+ }
1158
+
1159
+ render() {
1160
+ const previewHeader = (<h3>{this.props.intl.formatMessage(messages.ebillPreview)}</h3>);
1161
+ const loaderText = this.props.intl.formatMessage(messages.loading);
1162
+ const spinning = false;
1163
+ const schema = this.state.schema;
1164
+ return (
1165
+ <div className="ebill-container">
1166
+ <Helmet
1167
+ title="Ebill"
1168
+ />
1169
+ <Spin tip={loaderText} spinning={spinning}>
1170
+ {this.props.location.query.type !== 'embedded' && <Row>
1171
+ <Col span={24}>
1172
+ {this.props.location.query.type !== "embedded" &&
1173
+ <Breadcrumb>
1174
+ <BreadcrumbItem>{this.props.intl.formatMessage(messages.campaigns)}</BreadcrumbItem>
1175
+ <BreadcrumbItem>{this.props.intl.formatMessage(messages.creatives)}</BreadcrumbItem>
1176
+ <BreadcrumbItem>{this.props.intl.formatMessage(messages.ebill)}</BreadcrumbItem>
1177
+ </Breadcrumb>
1178
+ }
1179
+ </Col>
1180
+ </Row>}
1181
+ <Row>
1182
+ <Col>
1183
+ <FormBuilder
1184
+ schema={schema}
1185
+ onSubmit={this.saveFormData}
1186
+ onChange={this.onFormDataChange}
1187
+ currentTab={this.state.currentTab}
1188
+ parent={this}
1189
+ formData={_.cloneDeep(this.state.formData)}
1190
+ location={this.props.location}
1191
+ tabKey={this.state.tabKey}
1192
+ tags={this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : []}
1193
+ injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
1194
+ onFormValidityChange={this.setFormValidity}
1195
+ handleCancelModal={this.handleCancelModal}
1196
+ usingTabContainer
1197
+ checkValidation={this.state.checkValidation}
1198
+ onContextChange={this.handleOnTagsContextChange}
1199
+ tabCount={this.state.tabCount}
1200
+ // isNewVersionFlow
1201
+ modal={this.state.modalContent}
1202
+ showModal={this.state.showModal}
1203
+ isEdit={this.state.isEdit}
1204
+ iframeParent={parent}
1205
+ router={this.props.router}
1206
+ // baseLanguage={this.props.Global.currentOrgDetails.basic_details.base_language}
1207
+ // supportedLanguages={this.props.Global.currentOrgDetails.basic_details.supported_languages}
1208
+ // isSchemaChanged={this.state.isSchemaChanged}
1209
+ />
1210
+ </Col>
1211
+ </Row>
1212
+ </Spin>
1213
+ {/* <div style={{display: 'inline-block', verticalAlign: 'top', width: '100%', height: '450px', borderLeft: '1px solid #b7b7b7'}}>
1214
+ <div style={{width: "100%", height: '100%'}}>
1215
+ <textarea style={{background: '#efefef', resize: 'none', float: 'left', border: '1px solid #efefef', width: "100%", height: '100%'}} value={this.props.Templates.selectedEmailLayout}>
1216
+ </textarea>
1217
+ </div>
1218
+ </div> */}
1219
+ {this.state.formData[this.state.currentTab - 1] && <EmailPreview
1220
+ header={previewHeader}
1221
+ content={this.state.formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`]}
1222
+ show={this.state.showEbillPreview}
1223
+ device={this.state.device}
1224
+ handleClose={this.toggleEmailPreview}
1225
+ changePreviewDevice={this.changePreviewDevice}
1226
+ />}
1227
+ </div>
1228
+ );
1229
+ }
1230
+ }
1231
+
1232
+ Ebill.propTypes = {
1233
+ Ebill: PropTypes.object.isRequired,
1234
+ actions: PropTypes.object.isRequired,
1235
+ params: PropTypes.object,
1236
+ router: PropTypes.object,
1237
+ Templates: PropTypes.object,
1238
+ globalActions: PropTypes.object,
1239
+ location: PropTypes.object,
1240
+ intl: intlShape.isRequired,
1241
+ metaEntities: PropTypes.object,
1242
+ // Global: PropTypes.object,
1243
+ injectedTags: PropTypes.object,
1244
+ };
1245
+
1246
+ const mapStateToProps = createStructuredSelector({
1247
+ Ebill: makeSelectEbill(),
1248
+ Templates: makeSelectTemplates(),
1249
+ metaEntities: makeSelectMetaEntities(),
1250
+ Global: makeSelectAuthenticated(),
1251
+ injectedTags: setInjectedTags(),
1252
+ });
1253
+
1254
+ function mapDispatchToProps(dispatch) {
1255
+ return {
1256
+ actions: bindActionCreators(actions, dispatch),
1257
+ globalActions: bindActionCreators(globalActions, dispatch),
1258
+ };
1259
+ }
1260
+
1261
+ export default UserIsAuthenticated(connect(mapStateToProps, mapDispatchToProps)(injectIntl(Ebill)));