@capillarytech/creatives-library 8.0.159 → 8.0.160

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 (308) hide show
  1. package/components/BreadCrumbs/index.js +65 -0
  2. package/components/BreadCrumbs/messages.js +13 -0
  3. package/components/CapTagList/index.js +235 -0
  4. package/components/CapTagList/messages.js +45 -0
  5. package/components/Card/_customCard.scss +40 -0
  6. package/components/Card/index.js +78 -0
  7. package/components/Card/tests/__snapshots__/index.test.js.snap +22 -0
  8. package/components/Card/tests/index.test.js +20 -0
  9. package/components/CardGrid/index.js +71 -0
  10. package/components/Ckeditor/index.js +238 -0
  11. package/components/Ckeditor/messages.js +13 -0
  12. package/components/Ckeditor/style.scss +3 -0
  13. package/components/Component/index.js +29 -0
  14. package/components/CustomPopOver/index.js +81 -0
  15. package/components/CustomPopOver/messages.js +17 -0
  16. package/components/DateFilter/index.js +349 -0
  17. package/components/DateFilter/messages.js +57 -0
  18. package/components/DateRange/index.js +114 -0
  19. package/components/DateRange/messages.js +25 -0
  20. package/components/Edmeditor/index.js +65 -0
  21. package/components/Edmeditor/messages.js +13 -0
  22. package/components/EmailPreview/_emailPreview.scss +119 -0
  23. package/components/EmailPreview/assets/images/iPad.svg +10 -0
  24. package/components/EmailPreview/assets/images/mobile.png +0 -0
  25. package/components/EmailPreview/index.js +107 -0
  26. package/components/EmailPreview/messages.js +33 -0
  27. package/components/Footer/index.js +27 -0
  28. package/components/Footer/messages.js +13 -0
  29. package/components/FormBuilder/_formBuilder.scss +83 -0
  30. package/components/FormBuilder/index.js +3279 -0
  31. package/components/FormBuilder/messages.js +61 -0
  32. package/components/Header/index.js +44 -0
  33. package/components/Header/messages.js +29 -0
  34. package/components/ImagePreview/_imagePreview.scss +63 -0
  35. package/components/ImagePreview/index.js +52 -0
  36. package/components/ImagePreview/messages.js +17 -0
  37. package/components/PageHeader/_pageHeader.scss +22 -0
  38. package/components/PageHeader/index.js +37 -0
  39. package/components/PageHeader/messages.js +13 -0
  40. package/components/Pagination/_pagination.scss +5 -0
  41. package/components/Pagination/index.js +49 -0
  42. package/components/PreviewSideBar/_previewsidebar.scss +28 -0
  43. package/components/PreviewSideBar/index.js +152 -0
  44. package/components/PreviewSideBar/messages.js +41 -0
  45. package/components/Sidebar/_sidebar.scss +115 -0
  46. package/components/Sidebar/index.js +214 -0
  47. package/components/Sidebar/messages.js +21 -0
  48. package/components/SlideBox/_slideBox.scss +63 -0
  49. package/components/SlideBox/index.js +47 -0
  50. package/components/SlideBox/tests/index.test.js +103 -0
  51. package/components/SmsEditor/index.js +55 -0
  52. package/components/SmsTest/index.js +117 -0
  53. package/components/SmsTest/messages.js +21 -0
  54. package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
  55. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +141 -0
  56. package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
  57. package/components/TemplatePreview/_templatePreview.scss +642 -0
  58. package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
  59. package/components/TemplatePreview/assets/images/androidPushMessage.svg +45 -0
  60. package/components/TemplatePreview/assets/images/home-screen-android.svg +21 -0
  61. package/components/TemplatePreview/assets/images/home-screen-ios.svg +16 -0
  62. package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +135 -0
  63. package/components/TemplatePreview/assets/images/mobile.svg +24 -0
  64. package/components/TemplatePreview/assets/images/sms-body.png +0 -0
  65. package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
  66. package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
  67. package/components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -0
  68. package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +16 -0
  69. package/components/TemplatePreview/assets/images/user-icon.svg +19 -0
  70. package/components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
  71. package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -0
  72. package/components/TemplatePreview/index.js +617 -0
  73. package/components/TemplatePreview/messages.js +78 -0
  74. package/components/Toastr/index.js +60 -0
  75. package/components/Toastr/messages.js +13 -0
  76. package/components/ToastrMessage/index.js +113 -0
  77. package/components/ToastrMessage/messages.js +17 -0
  78. package/components/TopBar/_topbar.scss +46 -0
  79. package/components/TopBar/assets/images/capillary_logo.png +0 -0
  80. package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
  81. package/components/TopBar/index.js +113 -0
  82. package/components/TopBar/messages.js +29 -0
  83. package/containers/App/actions.js +7 -0
  84. package/containers/App/constants.js +114 -0
  85. package/containers/App/index.js +52 -0
  86. package/containers/App/reducer.js +19 -0
  87. package/containers/App/sagas.js +31 -0
  88. package/containers/App/selectors.js +25 -0
  89. package/containers/App/test/saga.test.js +11 -0
  90. package/containers/Assets/Gallery/_gallery.scss +126 -0
  91. package/containers/Assets/Gallery/actions.js +37 -0
  92. package/containers/Assets/Gallery/constants.js +23 -0
  93. package/containers/Assets/Gallery/index.js +473 -0
  94. package/containers/Assets/Gallery/messages.js +93 -0
  95. package/containers/Assets/Gallery/reducer.js +81 -0
  96. package/containers/Assets/Gallery/sagas.js +80 -0
  97. package/containers/Assets/Gallery/selectors.js +25 -0
  98. package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +9 -0
  99. package/containers/Assets/Gallery/tests/actions.test.js +25 -0
  100. package/containers/Assets/Gallery/tests/reducer.test.js +96 -0
  101. package/containers/Assets/Gallery/tests/saga.test.js +157 -0
  102. package/containers/Cap/actions.js +66 -0
  103. package/containers/Cap/constants.js +25 -0
  104. package/containers/Cap/index.js +402 -0
  105. package/containers/Cap/messages.js +75 -0
  106. package/containers/Cap/reducer.js +113 -0
  107. package/containers/Cap/sagas.js +159 -0
  108. package/containers/Cap/selectors.js +75 -0
  109. package/containers/Cap/tests/__snapshots__/index.test.js.snap +2270 -0
  110. package/containers/Cap/tests/index.test.js +22 -0
  111. package/containers/Cap/tests/saga.test.js +284 -0
  112. package/containers/Dashboard/actions.js +15 -0
  113. package/containers/Dashboard/constants.js +7 -0
  114. package/containers/Dashboard/index.js +76 -0
  115. package/containers/Dashboard/messages.js +13 -0
  116. package/containers/Dashboard/reducer.js +21 -0
  117. package/containers/Dashboard/sagas.js +17 -0
  118. package/containers/Dashboard/selectors.js +25 -0
  119. package/containers/Dashboard/test/saga.test.js +9 -0
  120. package/containers/Ebill/_ebill.scss +5 -0
  121. package/containers/Ebill/actions.js +43 -0
  122. package/containers/Ebill/constants.js +20 -0
  123. package/containers/Ebill/index.js +1278 -0
  124. package/containers/Ebill/messages.js +77 -0
  125. package/containers/Ebill/reducer.js +72 -0
  126. package/containers/Ebill/sagas.js +74 -0
  127. package/containers/Ebill/selectors.js +25 -0
  128. package/containers/Ebill/test/saga.test.js +11 -0
  129. package/containers/Email/_email.scss +141 -0
  130. package/containers/Email/actions.js +81 -0
  131. package/containers/Email/constants.js +36 -0
  132. package/containers/Email/index.js +3325 -0
  133. package/containers/Email/messages.js +289 -0
  134. package/containers/Email/reducer.js +142 -0
  135. package/containers/Email/sagas.js +135 -0
  136. package/containers/Email/selectors.js +31 -0
  137. package/containers/Email/test/saga.test.js +671 -0
  138. package/containers/LanguageProvider/actions.js +17 -0
  139. package/containers/LanguageProvider/constants.js +8 -0
  140. package/containers/LanguageProvider/index.js +80 -0
  141. package/containers/LanguageProvider/reducer.js +30 -0
  142. package/containers/LanguageProvider/selectors.js +20 -0
  143. package/containers/LanguageProvider/tests/actions.test.js +19 -0
  144. package/containers/LanguageProvider/tests/index.test.js +78 -0
  145. package/containers/LanguageProvider/tests/reducer.test.js +20 -0
  146. package/containers/LanguageProvider/tests/selectors.test.js +15 -0
  147. package/containers/Line/Create/_lineCreate.scss +54 -0
  148. package/containers/Line/Create/actions.js +90 -0
  149. package/containers/Line/Create/constants.js +39 -0
  150. package/containers/Line/Create/index.js +836 -0
  151. package/containers/Line/Create/messages.js +189 -0
  152. package/containers/Line/Create/reducer.js +99 -0
  153. package/containers/Line/Create/sagas.js +121 -0
  154. package/containers/Line/Create/selectors.js +36 -0
  155. package/containers/Line/Create/tests/saga.test.js +202 -0
  156. package/containers/Line/Edit/_lineEdit.scss +35 -0
  157. package/containers/Line/Edit/actions.js +79 -0
  158. package/containers/Line/Edit/constants.js +27 -0
  159. package/containers/Line/Edit/index.js +1050 -0
  160. package/containers/Line/Edit/messages.js +177 -0
  161. package/containers/Line/Edit/reducer.js +83 -0
  162. package/containers/Line/Edit/sagas.js +80 -0
  163. package/containers/Line/Edit/selectors.js +29 -0
  164. package/containers/Line/Edit/test/saga.test.js +160 -0
  165. package/containers/Login/assets/images/capillary_logo.png +0 -0
  166. package/containers/Login/components/LoginForm/index.js +62 -0
  167. package/containers/Login/components/LoginForm/messages.js +33 -0
  168. package/containers/Login/index.js +130 -0
  169. package/containers/Login/messages.js +25 -0
  170. package/containers/Login/selectors.js +25 -0
  171. package/containers/MobilePush/Create/_mobilePushCreate.scss +39 -0
  172. package/containers/MobilePush/Create/actions.js +46 -0
  173. package/containers/MobilePush/Create/constants.js +23 -0
  174. package/containers/MobilePush/Create/index.js +2303 -0
  175. package/containers/MobilePush/Create/messages.js +269 -0
  176. package/containers/MobilePush/Create/reducer.js +70 -0
  177. package/containers/MobilePush/Create/sagas.js +74 -0
  178. package/containers/MobilePush/Create/selectors.js +28 -0
  179. package/containers/MobilePush/Create/test/saga.test.js +19 -0
  180. package/containers/MobilePush/Edit/_mobilePushCreate.scss +39 -0
  181. package/containers/MobilePush/Edit/actions.js +91 -0
  182. package/containers/MobilePush/Edit/constants.js +35 -0
  183. package/containers/MobilePush/Edit/index.js +2601 -0
  184. package/containers/MobilePush/Edit/messages.js +266 -0
  185. package/containers/MobilePush/Edit/reducer.js +112 -0
  186. package/containers/MobilePush/Edit/sagas.js +126 -0
  187. package/containers/MobilePush/Edit/selectors.js +29 -0
  188. package/containers/MobilePush/Edit/tests/saga.test.js +255 -0
  189. package/containers/NotFoundPage/index.js +25 -0
  190. package/containers/NotFoundPage/messages.js +13 -0
  191. package/containers/NotFoundPage/tests/index.test.js +17 -0
  192. package/containers/Sms/Create/_smsCreate.scss +42 -0
  193. package/containers/Sms/Create/actions.js +27 -0
  194. package/containers/Sms/Create/constants.js +16 -0
  195. package/containers/Sms/Create/index.js +1488 -0
  196. package/containers/Sms/Create/messages.js +109 -0
  197. package/containers/Sms/Create/reducer.js +41 -0
  198. package/containers/Sms/Create/sagas.js +40 -0
  199. package/containers/Sms/Create/selectors.js +28 -0
  200. package/containers/Sms/Create/test/saga.test.js +11 -0
  201. package/containers/Sms/Edit/actions.js +40 -0
  202. package/containers/Sms/Edit/constants.js +17 -0
  203. package/containers/Sms/Edit/index.js +1472 -0
  204. package/containers/Sms/Edit/messages.js +105 -0
  205. package/containers/Sms/Edit/reducer.js +50 -0
  206. package/containers/Sms/Edit/sagas.js +60 -0
  207. package/containers/Sms/Edit/selectors.js +32 -0
  208. package/containers/Sms/Edit/test/saga.test.js +13 -0
  209. package/containers/TagList/_tagList.scss +8 -0
  210. package/containers/TagList/actions.js +15 -0
  211. package/containers/TagList/constants.js +32 -0
  212. package/containers/TagList/index.js +236 -0
  213. package/containers/TagList/messages.js +13 -0
  214. package/containers/TagList/reducer.js +23 -0
  215. package/containers/TagList/sagas.js +11 -0
  216. package/containers/TagList/selectors.js +25 -0
  217. package/containers/Templates/_templates.scss +333 -0
  218. package/containers/Templates/actions.js +103 -0
  219. package/containers/Templates/constants.js +60 -0
  220. package/containers/Templates/index.js +1756 -0
  221. package/containers/Templates/messages.js +337 -0
  222. package/containers/Templates/reducer.js +142 -0
  223. package/containers/Templates/sagas.js +163 -0
  224. package/containers/Templates/selectors.js +28 -0
  225. package/containers/Templates/test/saga.test.js +241 -0
  226. package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
  227. package/containers/WeChat/MapTemplates/actions.js +52 -0
  228. package/containers/WeChat/MapTemplates/constants.js +28 -0
  229. package/containers/WeChat/MapTemplates/index.js +1610 -0
  230. package/containers/WeChat/MapTemplates/messages.js +157 -0
  231. package/containers/WeChat/MapTemplates/reducer.js +74 -0
  232. package/containers/WeChat/MapTemplates/sagas.js +84 -0
  233. package/containers/WeChat/MapTemplates/selectors.js +25 -0
  234. package/containers/WeChat/MapTemplates/test/saga.test.js +155 -0
  235. package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
  236. package/containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
  237. package/containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
  238. package/containers/WeChat/RichmediaTemplates/Create/index.js +1071 -0
  239. package/containers/WeChat/RichmediaTemplates/Create/messages.js +165 -0
  240. package/containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
  241. package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
  242. package/containers/WeChat/RichmediaTemplates/Create/sagas.js +51 -0
  243. package/containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
  244. package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +13 -0
  245. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
  246. package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
  247. package/containers/WeChat/RichmediaTemplates/Edit/index.js +136 -0
  248. package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
  249. package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
  250. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +36 -0
  251. package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
  252. package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +12 -0
  253. package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
  254. package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
  255. package/containers/WeChat/RichmediaTemplates/View/index.js +47 -0
  256. package/containers/WeChat/RichmediaTemplates/View/messages.js +21 -0
  257. package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
  258. package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
  259. package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
  260. package/index.js +2 -4
  261. package/package.json +1 -1
  262. package/routes.js +202 -136
  263. package/services/getSchema.js +1 -1
  264. package/services/localStorageApi.js +0 -1
  265. package/tests/i18n.test.js +1 -1
  266. package/utils/asyncInjectors.js +78 -0
  267. package/utils/authWrapper.js +1 -1
  268. package/utils/callNativeEvent.js +16 -0
  269. package/utils/checkStore.js +21 -0
  270. package/utils/common.js +2 -2
  271. package/utils/customAuthWrapper.js +62 -0
  272. package/utils/customConnectedAuthWrapper.js +26 -0
  273. package/utils/tagValidations.js +1 -1
  274. package/utils/tests/authWrapper.test.js +1 -1
  275. package/utils/tests/checkStore.test.js +1 -1
  276. package/utils/tests/customAuth.test.js +1 -1
  277. package/utils/transformerUtils.js +1 -1
  278. package/v2Components/CapTagList/index.js +14 -9
  279. package/v2Components/Carousel/style.scss +1 -1
  280. package/v2Components/CustomerSearchSection/index.js +83 -79
  281. package/v2Components/EmailMobilePreview/index.js +2 -2
  282. package/v2Components/EmailPreview/_emailPreview.scss +1 -0
  283. package/v2Components/EmailPreviewV2/_emailPreviewV2.scss +1 -0
  284. package/v2Components/FormBuilder/index.js +80 -55
  285. package/v2Components/TemplatePreview/index.js +1 -2
  286. package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +1 -1
  287. package/v2Components/TestAndPreviewSlidebox/SendTestMessage.js +1 -1
  288. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +2 -1
  289. package/v2Components/TestAndPreviewSlidebox/index.js +231 -22
  290. package/v2Components/TestAndPreviewSlidebox/tests/PreviewSection.test.js +1 -1
  291. package/v2Containers/Cap/tests/saga.test.js +1 -1
  292. package/v2Containers/CreativesContainer/SlideBoxContent.js +9 -3
  293. package/v2Containers/CreativesContainer/index.js +22 -15
  294. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +599 -1
  295. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +1941 -0
  296. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
  297. package/v2Containers/Email/index.js +116 -32
  298. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +3 -0
  299. package/v2Containers/EmailWrapper/index.js +6 -0
  300. package/v2Containers/FTP/index.js +1 -1
  301. package/v2Containers/Line/Container/Text/index.js +1 -1
  302. package/v2Containers/Sms/Create/index.js +1 -1
  303. package/v2Containers/Sms/Edit/index.js +1 -1
  304. package/v2Containers/TagList/index.js +1 -1
  305. package/v2Containers/TagList/utils.js +1 -1
  306. package/v2Containers/Templates/index.js +1 -1
  307. package/v2Containers/Templates/sagas.js +1 -1
  308. package/constants/unified.js +0 -189
@@ -17,6 +17,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
17
17
  handleCloseTestAndPreview={[Function]}
18
18
  handleTestAndPreview={[Function]}
19
19
  hostName=""
20
+ isTestAndPreviewMode={false}
20
21
  loyaltyMetaData={
21
22
  Object {
22
23
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -102,6 +103,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
102
103
  handleCloseTestAndPreview={[Function]}
103
104
  handleTestAndPreview={[Function]}
104
105
  hostName=""
106
+ isTestAndPreviewMode={false}
105
107
  loyaltyMetaData={
106
108
  Object {
107
109
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -187,6 +189,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
187
189
  handleCloseTestAndPreview={[Function]}
188
190
  handleTestAndPreview={[Function]}
189
191
  hostName=""
192
+ isTestAndPreviewMode={false}
190
193
  loyaltyMetaData={
191
194
  Object {
192
195
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -284,6 +287,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
284
287
  handleCloseTestAndPreview={[Function]}
285
288
  handleTestAndPreview={[Function]}
286
289
  hostName=""
290
+ isTestAndPreviewMode={false}
287
291
  loyaltyMetaData={
288
292
  Object {
289
293
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -381,6 +385,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
381
385
  handleCloseTestAndPreview={[Function]}
382
386
  handleTestAndPreview={[Function]}
383
387
  hostName=""
388
+ isTestAndPreviewMode={false}
384
389
  loyaltyMetaData={
385
390
  Object {
386
391
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -37,9 +37,9 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
37
37
  import { gtmPush } from '../../utils/gtmTrackers';
38
38
  const {CapCustomCardList} = CapCustomCard;
39
39
  import {storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
40
- import { CUSTOMER_BARCODE_TAG } from '../../constants/unified';
41
40
 
42
41
  import { containsBase64Images } from '../../utils/content';
42
+ import { CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
43
43
  import injectReducer from '../../utils/injectReducer';
44
44
  import v2EmailReducer from './reducer';
45
45
  import { v2EmailSagas } from './sagas';
@@ -89,6 +89,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
89
89
  addLanguageType: '',
90
90
  startValidation: false,
91
91
  saveForm: false,
92
+ showTestAndPreviewSlidebox: false,
93
+ isTestAndPreviewMode: false, // Add flag to prevent validation during Test & Preview
92
94
  };
93
95
 
94
96
  this.isTagLoaded = false;
@@ -246,7 +248,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
246
248
  if (isFullMode && isGetFormData && !_.isEqual(isGetFormData, this.props.isGetFormData) && !this.state.isDragDrop) {
247
249
  //only for ck editor
248
250
  //when create button is clicked in full mode
249
- this.startValidation(true);
251
+ // Don't start validation if we're in Test & Preview mode
252
+ if (!nextProps.isTestAndPreviewMode) {
253
+ this.startValidation(true);
254
+ }
250
255
  }
251
256
  if (this.state.languageDataSet && nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && !_.isEqual(this.props.Templates.selectedEmailLayout, nextProps.Templates.selectedEmailLayout )) {
252
257
  this.setNewLanguageContent(nextProps.Templates.selectedEmailLayout);
@@ -592,27 +597,24 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
592
597
  onChange = (evt) => {
593
598
  const {isFullMode, showTemplateName} = this.props;
594
599
  const formData = _.cloneDeep(this.state.formData);
600
+ const currentTabData = formData[this.state.currentTab - 1];
601
+ const activeTab = currentTabData?.activeTab;
595
602
 
596
- //if (evt.editor.name.indexOf('editor') === -1) {
597
- // _.forEach(window.CKEDITOR.instances, (winInstance) => {
598
- // const temp = winInstance;
599
- // if (winInstance.name === evt.editor.name) {
600
- //
601
- // setTimeout(() => {
602
- // //temp.name = id;
603
- // }, 1000);
604
- // //temp.name = id;
605
- //
606
- // }
607
- // });
608
- //}
609
- if (!formData[this.state.currentTab - 1][formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop) {
610
- formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = _.cloneDeep(evt.editor.getData());
611
- if (formData[`${this.state.currentTab - 1}`].tabKey === formData.base.tabKey) {
612
- formData.base[formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = _.cloneDeep(evt.editor.getData());
603
+ // Only handle CKEditor changes
604
+ if (currentTabData && activeTab && !currentTabData[activeTab]?.is_drag_drop) {
605
+ const newContent = evt.editor.getData();
606
+
607
+ // Update formData with new content
608
+ currentTabData[activeTab]['template-content'] = _.cloneDeep(newContent);
609
+ if (currentTabData.tabKey === formData.base.tabKey) {
610
+ formData.base[activeTab]['template-content'] = _.cloneDeep(newContent);
613
611
  }
614
612
 
615
- this.setState({formData, content: evt.editor.getData()}, () => {
613
+ // Update state with new content
614
+ this.setState({
615
+ formData,
616
+ content: newContent // Keep latest content in state
617
+ }, () => {
616
618
  if (isFullMode && showTemplateName) {
617
619
  showTemplateName({formData, onFormDataChange: this.onFormDataChange});
618
620
  }
@@ -804,6 +806,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
804
806
  }
805
807
 
806
808
  getFormData = (e, value) => {
809
+ // Don't run validation if we're in Test & Preview mode
810
+ if (this.props.isTestAndPreviewMode) {
811
+ return;
812
+ }
813
+
807
814
  this.setState({getFormDataValue: value, gettingFormData: true}, () => {
808
815
  this.saveValidationData();
809
816
  });
@@ -827,8 +834,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
827
834
  const currentTabData = formData[currentTab - 1];
828
835
  const activeTab = currentTabData?.activeTab;
829
836
 
837
+ // Get content from formData
830
838
  if (currentTabData && activeTab && currentTabData[activeTab]) {
831
- return currentTabData[activeTab]['template-content'] || '';
839
+ const isDragDrop = currentTabData[activeTab].is_drag_drop;
840
+ const templateContent = currentTabData[activeTab]['template-content'];
841
+ return templateContent || '';
832
842
  }
833
843
 
834
844
  return '';
@@ -1017,6 +1027,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1017
1027
  });
1018
1028
  }
1019
1029
  startValidation = (shouldSave) => {
1030
+ // Don't start validation if we're in Test & Preview mode
1031
+ if (this.props.isTestAndPreviewMode) {
1032
+ return;
1033
+ }
1034
+
1020
1035
  if (!this.state.startValidation && shouldSave) {
1021
1036
  this.setState({startValidation: true});
1022
1037
  }
@@ -1025,6 +1040,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1025
1040
  this.setState({startValidation: false}, this.props.onValidationFail);
1026
1041
  }
1027
1042
  saveValidationData = () => {
1043
+ // Don't run validation if we're in Test & Preview mode
1044
+ if (this.props.isTestAndPreviewMode) {
1045
+ return;
1046
+ }
1047
+
1028
1048
  let saveCount = 0;
1029
1049
  const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
1030
1050
  this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
@@ -2106,9 +2126,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2106
2126
  }
2107
2127
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
2108
2128
 
2109
- //const data = {"base":{"subject":"deded","html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":false,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}],"edit":true,"tags":[]};
2110
- // const data = {edit: true, "base":{"subject":"testsubject","html_content":"<html> <head> \t<meta charset=\"utf-8\" /> \t<title>Aster Secure</title> \t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":0,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<html>\r\n<head>\r\n\t<meta charset=\"utf-8\" />\r\n\t<title>Aster Secure</title>\r\n\t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t}\r\n\t</style>\r\n</head>\r\n<body>\r\n<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t<tbody>\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</tbody>\r\n</table>\r\n</body>\r\n</html>\r\n","secondary_template_id":"9584","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}, {"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":false,"language_name":"Hindi","language":"Hindi","lang_id":"151"},{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":1,"drag_drop_id":"55acf47048a85bbf7681a35a","scope":null,"tag":null,"is_default":null,"html_content":"","secondary_template_id":"9500","is_base_template":0,"language_name":"Japanese","language":"Japanese","lang_id":"100"}]};
2111
-
2112
2129
  if (data && data.edit) {
2113
2130
  // const formData = {'0': {}};
2114
2131
  const formData = _.cloneDeep(this.state.formData);
@@ -2471,9 +2488,39 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2471
2488
  const formData = _.cloneDeep(this.state.formData);
2472
2489
  const activeLangTab = formData[`${this.state.currentTab - 1}`].activeTab;
2473
2490
  const langIndex = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
2491
+
2492
+ // Store current content before switching
2493
+ const currentContent = formData[`${this.state.currentTab - 1}`][activeLangTab]['template-content'];
2494
+
2495
+ // Update formData to mark as not drag-drop
2496
+ formData[`${this.state.currentTab - 1}`][activeLangTab].is_drag_drop = false;
2497
+ if (formData[`${this.state.currentTab - 1}`].base) {
2498
+ formData.base[activeLangTab].is_drag_drop = false;
2499
+ }
2500
+
2501
+ this.setState({
2502
+ mode: "switchEditor",
2503
+ formData
2504
+ }, () => {
2505
+ // No need to call handleEdmSave as we're switching to CKEditor
2506
+ let schema = _.cloneDeep(this.state.schema);
2507
+ _.forEach(schema.containers, (container, index) => {
2508
+ if (parseInt(index, 10) === (this.state.currentTab - 1)) {
2509
+ const temp = container;
2510
+ const langTab = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
2511
+
2512
+ temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
2513
+ temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
2514
+ temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].colStyle.display = "none";
2515
+ }
2516
+ });
2517
+ schema = this.showInsertImageButton(schema);
2474
2518
 
2475
- this.setState({mode: "switchEditor"}, () => {
2476
- this.handleEdmSave();
2519
+ this.setState({
2520
+ schema,
2521
+ showConfirmationModal: false,
2522
+ isSchemaChanged: true
2523
+ });
2477
2524
  });
2478
2525
  }
2479
2526
 
@@ -2648,7 +2695,21 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2648
2695
  formData[0][selectedLanguages[0]]['template-content'];
2649
2696
  const previewSubject = formData['template-subject'];
2650
2697
  const testOrPreviewProps = {channel: EMAIL, content: previewContent, subject: previewSubject};
2651
- const { onPreviewContentClicked, onTestContentClicked } = this.props;
2698
+
2699
+ // Call our handler instead of the props methods to set the flag
2700
+ const handleClick = () => {
2701
+ if (action === 'TEST') {
2702
+ // For test action, open our Test & Preview slidebox
2703
+ this.handleTestAndPreview();
2704
+ } else {
2705
+ // For preview action, call the original method
2706
+ const { onPreviewContentClicked } = this.props;
2707
+ if (onPreviewContentClicked) {
2708
+ onPreviewContentClicked(testOrPreviewProps);
2709
+ }
2710
+ }
2711
+ };
2712
+
2652
2713
  return (
2653
2714
  <CapButton
2654
2715
  style={{
@@ -2657,7 +2718,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2657
2718
  padding: '0 6px',
2658
2719
  }}
2659
2720
  type="flat"
2660
- onClick={() => action === 'PREVIEW' ? onPreviewContentClicked(testOrPreviewProps) : onTestContentClicked(testOrPreviewProps)}
2721
+ onClick={handleClick}
2661
2722
  >
2662
2723
  <CapIcon type={action === 'PREVIEW' ? "eye" : "lab"}/>
2663
2724
  {action === 'PREVIEW' ? <FormattedMessage {...messages.preview} /> : <FormattedMessage {...messages.testMessage} />}
@@ -2668,23 +2729,29 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2668
2729
  this.beeInstance = instance;
2669
2730
  }
2670
2731
  saveBeeData = (json, html) => {
2732
+ // Update state with new content
2671
2733
  this.setState((prevState) => {
2672
2734
  const { currentTab, formData } = _.cloneDeep(prevState);
2673
2735
  const activeTab = formData[currentTab - 1].activeTab;
2736
+
2737
+ // Update content in both formData and base
2674
2738
  formData[currentTab - 1][activeTab]['template-content'] = html;
2675
2739
  formData[currentTab - 1][activeTab]['json-content'] = json;
2676
-
2677
2740
  formData.base[activeTab]['template-content'] = html;
2678
2741
  formData.base[activeTab]['json-content'] = json;
2679
2742
 
2680
2743
  return {
2681
2744
  ...prevState,
2682
2745
  formData,
2746
+ content: html // Keep latest content in state
2683
2747
  };
2684
2748
  }, () => {
2685
- !this.props.showTestAndPreviewSlidebox && this.setState({
2686
- startValidation: true,
2749
+ // Only trigger validation if we're not in Test & Preview mode
2750
+ if (!this.props.isTestAndPreviewMode) {
2751
+ this.setState({
2752
+ startValidation: true
2687
2753
  });
2754
+ }
2688
2755
  });
2689
2756
  }
2690
2757
 
@@ -2697,6 +2764,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2697
2764
  const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
2698
2765
  const imagePreviewContent = this.getImagePreviewContent();
2699
2766
  const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '', showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview } = this.props;
2767
+ const testAndPreviewContent = this.getTemplateContent();
2700
2768
  if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
2701
2769
  return (<div>Loading...</div>);
2702
2770
  }
@@ -2769,6 +2837,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2769
2837
  eventContextTags={this.props?.eventContextTags}
2770
2838
  forwardedTags={this.props?.forwardedTags}
2771
2839
  isLoyaltyModule={this.props?.isLoyaltyModule}
2840
+ isTestAndPreviewMode={this.state.isTestAndPreviewMode} // Add flag to prevent validation
2772
2841
  /> : ''}
2773
2842
  </Col>
2774
2843
  </Row>
@@ -2796,12 +2865,27 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2796
2865
  onClose={handleCloseTestAndPreview}
2797
2866
  formData={this.state.formData}
2798
2867
  beeInstance={this.beeInstance}
2799
- content={this.getTemplateContent()}
2868
+ content={testAndPreviewContent}
2800
2869
  currentChannel={EMAIL}
2870
+ currentTab={this.state.currentTab}
2801
2871
  />
2802
2872
  </div>
2803
2873
  );
2804
2874
  }
2875
+
2876
+ handleCloseTestAndPreview = () => {
2877
+ this.setState({
2878
+ showTestAndPreviewSlidebox: false,
2879
+ isTestAndPreviewMode: false // Reset flag when closing
2880
+ });
2881
+ }
2882
+
2883
+ handleTestAndPreview = () => {
2884
+ this.setState({
2885
+ showTestAndPreviewSlidebox: true,
2886
+ isTestAndPreviewMode: true // Set flag to prevent validation
2887
+ });
2888
+ }
2805
2889
  }
2806
2890
 
2807
2891
  Email.propTypes = {
@@ -55,6 +55,7 @@ const useEmailWrapper = ({
55
55
  showTestAndPreviewSlidebox,
56
56
  handleTestAndPreview,
57
57
  handleCloseTestAndPreview,
58
+ isTestAndPreviewMode,
58
59
  }) => {
59
60
  // State management
60
61
  const [templateName, setTemplateName] = useState('');
@@ -299,6 +300,7 @@ const useEmailWrapper = ({
299
300
  showTestAndPreviewSlidebox,
300
301
  handleTestAndPreview,
301
302
  handleCloseTestAndPreview,
303
+ isTestAndPreviewMode,
302
304
  }), [
303
305
  setIsLoadingContent,
304
306
  routeParams,
@@ -322,6 +324,7 @@ const useEmailWrapper = ({
322
324
  showTestAndPreviewSlidebox,
323
325
  handleTestAndPreview,
324
326
  handleCloseTestAndPreview,
327
+ isTestAndPreviewMode,
325
328
  ]);
326
329
 
327
330
  // Prepare props for CmsTemplatesComponent
@@ -61,6 +61,7 @@ const EmailWrapper = (props) => {
61
61
  showTestAndPreviewSlidebox,
62
62
  handleTestAndPreview,
63
63
  handleCloseTestAndPreview,
64
+ isTestAndPreviewMode,
64
65
  } = props;
65
66
 
66
67
  // Pass destructured props to the custom hook
@@ -113,6 +114,7 @@ const EmailWrapper = (props) => {
113
114
  showTestAndPreviewSlidebox,
114
115
  handleTestAndPreview,
115
116
  handleCloseTestAndPreview,
117
+ isTestAndPreviewMode,
116
118
  });
117
119
 
118
120
  // Render using the presentation component with data from the hook
@@ -174,6 +176,10 @@ EmailWrapper.propTypes = {
174
176
  onPreviewContentClicked: PropTypes.func,
175
177
  onTestContentClicked: PropTypes.func,
176
178
  editor: PropTypes.object,
179
+ showTestAndPreviewSlidebox: PropTypes.bool,
180
+ handleTestAndPreview: PropTypes.func,
181
+ handleCloseTestAndPreview: PropTypes.func,
182
+ isTestAndPreviewMode: PropTypes.bool,
177
183
  };
178
184
 
179
185
  const mapStateToProps = createStructuredSelector({
@@ -29,7 +29,7 @@ import { makeSelectLoyaltyPromotionDisplay, setInjectedTags } from '../Cap/selec
29
29
  import withCreatives from '../../hoc/withCreatives';
30
30
  import messages from './messages';
31
31
  import './_FTP.scss';
32
- import * as globalActions from '../Cap/actions';
32
+ import * as globalActions from '../../containers/Cap/actions';
33
33
  import { TagList } from '../TagList';
34
34
  import { NO_COMMUNICATION, CREATE, EDIT, PREVIEW } from '../App/constants';
35
35
  import { getTreeStructuredTags } from '../../utils/common';
@@ -17,7 +17,7 @@ import withStyles from '../../../../hoc/withStyles';
17
17
  import globalMessages from '../../../Cap/messages';
18
18
  import { validateTags } from '../../../../utils/tagValidations';
19
19
  import moment from 'moment';
20
- import { GET_TRANSLATION_MAPPED } from '../../../../constants/unified';
20
+ import { GET_TRANSLATION_MAPPED } from '../../../../containers/TagList/constants';
21
21
 
22
22
  const { TextArea } = CapInput;
23
23
  const {CapCustomCardList} = CapCustomCard;
@@ -24,7 +24,7 @@ import {getMessageObject} from '../../../utils/messageUtils';
24
24
  import { gtmPush } from '../../../utils/gtmTrackers';
25
25
  import * as creativesContainerActions from '../../CreativesContainer/actions';
26
26
  import {SMS} from '../../CreativesContainer/constants';
27
- // import callNativeEvent from '../../../legacy/callNativeEvent';
27
+ // import callNativeEvent from '../../../utils/callNativeEvent';
28
28
  import {showError} from '../commonMethods';
29
29
  import withCreatives from '../../../hoc/withCreatives';
30
30
  import { GA } from '@capillarytech/cap-ui-utils';
@@ -24,7 +24,7 @@ import messages from './messages';
24
24
  import {getMessageObject} from '../../../utils/messageUtils';
25
25
  import { gtmPush } from '../../../utils/gtmTrackers';
26
26
  import * as creativesContainerActions from '../../CreativesContainer/actions';
27
- // import callNativeEvent from '../../../legacy/callNativeEvent';
27
+ // import callNativeEvent from '../../../utils/callNativeEvent';
28
28
  import {showError} from '../commonMethods';
29
29
  import withCreatives from '../../../hoc/withCreatives';
30
30
  import { EDIT, TRACK_EDIT_SMS } from '../../App/constants';
@@ -28,7 +28,7 @@ import {
28
28
  } from '../../utils/common';
29
29
  import {
30
30
  GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS, BADGES_ENROLL, BADGES_ISSUE,
31
- } from '../../constants/unified';
31
+ } from '../../containers/App/constants';
32
32
 
33
33
  const {TreeNode} = Tree;
34
34
 
@@ -1,4 +1,4 @@
1
- import { JAPANESE_HIDE_DATE_TAGS } from "../../constants/unified";
1
+ import { JAPANESE_HIDE_DATE_TAGS } from "../../containers/TagList/constants";
2
2
 
3
3
 
4
4
  export const hidingDateTagsForJpLocale = (hideDateTagsForJpLocale, val, list, value) => {
@@ -105,7 +105,7 @@ import {
105
105
  CREATE,
106
106
  } from '../App/constants';
107
107
  import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES , ACCOUNT_MAPPING_ON_CHANNEL} from './constants';
108
- import { COPY_OF } from '../../constants/unified';
108
+ import { COPY_OF } from '../../containers/App/constants';
109
109
  import {
110
110
  STATUS_OPTIONS,
111
111
  CATEGORY,
@@ -6,7 +6,7 @@ import get from 'lodash/get';
6
6
  import * as Api from '../../services/api';
7
7
  import * as types from './constants';
8
8
  import { saveCdnConfigs, removeAllCdnLocalStorageItems } from '../../utils/cdnTransformation';
9
- import { COPY_OF } from '../../constants/unified';
9
+ import { COPY_OF } from '../../containers/App/constants';
10
10
  import { ZALO_TEMPLATE_INFO_REQUEST } from '../Zalo/constants';
11
11
  import { getTemplateInfoById } from '../Zalo/saga';
12
12
  import { watchCreateTemplate } from '../MobilePushNew/sagas';