@capillarytech/creatives-library 8.0.263 → 8.0.265

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 (280) hide show
  1. package/assets/Android.png +0 -0
  2. package/assets/iOS.png +0 -0
  3. package/constants/unified.js +1 -3
  4. package/initialReducer.js +0 -2
  5. package/package.json +1 -1
  6. package/services/api.js +0 -15
  7. package/services/tests/api.test.js +0 -34
  8. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +35 -17
  9. package/tests/integration/TemplateCreation/api-response.js +1 -31
  10. package/tests/integration/TemplateCreation/msw-handler.js +0 -2
  11. package/utils/common.js +0 -11
  12. package/utils/commonUtils.js +5 -28
  13. package/utils/tests/commonUtil.test.js +0 -224
  14. package/utils/tests/transformerUtils.test.js +0 -297
  15. package/utils/transformTemplateConfig.js +10 -0
  16. package/utils/transformerUtils.js +0 -40
  17. package/v2Components/CapDeviceContent/index.js +56 -61
  18. package/v2Components/CapImageUpload/constants.js +0 -2
  19. package/v2Components/CapImageUpload/index.js +16 -65
  20. package/v2Components/CapImageUpload/index.scss +1 -4
  21. package/v2Components/CapImageUpload/messages.js +1 -5
  22. package/v2Components/CapTagList/index.js +1 -6
  23. package/v2Components/CapTagListWithInput/index.js +1 -5
  24. package/v2Components/CapTagListWithInput/messages.js +1 -1
  25. package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
  26. package/v2Components/ErrorInfoNote/index.js +72 -402
  27. package/v2Components/ErrorInfoNote/messages.js +6 -32
  28. package/v2Components/ErrorInfoNote/style.scss +6 -278
  29. package/v2Components/FormBuilder/tests/index.test.js +4 -13
  30. package/v2Components/HtmlEditor/HTMLEditor.js +99 -418
  31. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1882
  32. package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
  33. package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
  34. package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
  35. package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
  36. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -148
  37. package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
  38. package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
  39. package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +1 -9
  40. package/v2Components/HtmlEditor/components/EditorToolbar/index.js +6 -31
  41. package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
  42. package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
  43. package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
  44. package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
  45. package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
  46. package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
  47. package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +10 -7
  48. package/v2Components/HtmlEditor/components/PreviewPane/index.js +43 -22
  49. package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
  50. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
  51. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +0 -18
  52. package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -36
  53. package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -46
  54. package/v2Components/HtmlEditor/components/ValidationPanel/index.js +46 -52
  55. package/v2Components/HtmlEditor/constants.js +20 -45
  56. package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
  57. package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -351
  58. package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
  59. package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
  60. package/v2Components/HtmlEditor/hooks/useValidation.js +56 -213
  61. package/v2Components/HtmlEditor/index.js +1 -1
  62. package/v2Components/HtmlEditor/messages.js +94 -102
  63. package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -214
  64. package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
  65. package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
  66. package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
  67. package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +124 -158
  68. package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
  69. package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
  70. package/v2Components/MobilePushPreviewV2/index.js +7 -33
  71. package/v2Components/TemplatePreview/_templatePreview.scss +24 -55
  72. package/v2Components/TemplatePreview/index.js +32 -47
  73. package/v2Components/TemplatePreview/messages.js +0 -4
  74. package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
  75. package/v2Containers/App/constants.js +0 -5
  76. package/v2Containers/BeeEditor/index.js +90 -172
  77. package/v2Containers/CreativesContainer/SlideBoxContent.js +53 -184
  78. package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
  79. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -3
  80. package/v2Containers/CreativesContainer/constants.js +0 -4
  81. package/v2Containers/CreativesContainer/index.js +46 -408
  82. package/v2Containers/CreativesContainer/messages.js +0 -12
  83. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -210
  84. package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
  85. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -342
  86. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -103
  87. package/v2Containers/Email/actions.js +0 -7
  88. package/v2Containers/Email/constants.js +1 -5
  89. package/v2Containers/Email/index.js +36 -237
  90. package/v2Containers/Email/messages.js +0 -32
  91. package/v2Containers/Email/reducer.js +1 -12
  92. package/v2Containers/Email/sagas.js +7 -61
  93. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
  94. package/v2Containers/Email/tests/reducer.test.js +0 -46
  95. package/v2Containers/Email/tests/sagas.test.js +29 -320
  96. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
  97. package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
  98. package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
  99. package/v2Containers/EmailWrapper/constants.js +0 -2
  100. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
  101. package/v2Containers/EmailWrapper/index.js +23 -103
  102. package/v2Containers/EmailWrapper/messages.js +1 -65
  103. package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
  104. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
  105. package/v2Containers/InApp/actions.js +0 -7
  106. package/v2Containers/InApp/constants.js +4 -20
  107. package/v2Containers/InApp/index.js +359 -802
  108. package/v2Containers/InApp/index.scss +3 -4
  109. package/v2Containers/InApp/messages.js +3 -7
  110. package/v2Containers/InApp/reducer.js +3 -21
  111. package/v2Containers/InApp/sagas.js +9 -29
  112. package/v2Containers/InApp/selectors.js +5 -25
  113. package/v2Containers/InApp/tests/index.test.js +50 -154
  114. package/v2Containers/InApp/tests/reducer.test.js +0 -34
  115. package/v2Containers/InApp/tests/sagas.test.js +9 -61
  116. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  117. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  118. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
  119. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
  120. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
  121. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
  122. package/v2Containers/TagList/index.js +19 -62
  123. package/v2Containers/Templates/ChannelTypeIllustration.js +1 -13
  124. package/v2Containers/Templates/_templates.scss +1 -265
  125. package/v2Containers/Templates/actions.js +1 -2
  126. package/v2Containers/Templates/constants.js +0 -1
  127. package/v2Containers/Templates/index.js +38 -363
  128. package/v2Containers/Templates/messages.js +0 -28
  129. package/v2Containers/Templates/reducer.js +0 -2
  130. package/v2Containers/Templates/tests/index.test.js +0 -10
  131. package/v2Containers/TemplatesV2/TemplatesV2.style.js +2 -4
  132. package/v2Containers/TemplatesV2/index.js +7 -15
  133. package/v2Containers/TemplatesV2/messages.js +0 -4
  134. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -34
  135. package/utils/imageUrlUpload.js +0 -141
  136. package/v2Components/CapImageUrlUpload/constants.js +0 -26
  137. package/v2Components/CapImageUrlUpload/index.js +0 -365
  138. package/v2Components/CapImageUrlUpload/index.scss +0 -35
  139. package/v2Components/CapImageUrlUpload/messages.js +0 -47
  140. package/v2Components/ErrorInfoNote/constants.js +0 -1
  141. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -870
  142. package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
  143. package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -281
  144. package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -295
  145. package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
  146. package/v2Components/HtmlEditor/utils/validationConstants.js +0 -38
  147. package/v2Components/MobilePushPreviewV2/constants.js +0 -6
  148. package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
  149. package/v2Containers/BeePopupEditor/constants.js +0 -10
  150. package/v2Containers/BeePopupEditor/index.js +0 -194
  151. package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
  152. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1246
  153. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -2472
  154. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
  155. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -956
  156. package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
  157. package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
  158. package/v2Containers/InApp/tests/selectors.test.js +0 -612
  159. package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -151
  160. package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
  161. package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
  162. package/v2Containers/InAppWrapper/constants.js +0 -16
  163. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
  164. package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
  165. package/v2Containers/InAppWrapper/index.js +0 -148
  166. package/v2Containers/InAppWrapper/messages.js +0 -49
  167. package/v2Containers/InappAdvance/index.js +0 -1099
  168. package/v2Containers/InappAdvance/index.scss +0 -10
  169. package/v2Containers/InappAdvance/tests/index.test.js +0 -448
  170. package/v2Containers/WebPush/Create/components/BrandIconSection.js +0 -108
  171. package/v2Containers/WebPush/Create/components/ButtonForm.js +0 -172
  172. package/v2Containers/WebPush/Create/components/ButtonItem.js +0 -101
  173. package/v2Containers/WebPush/Create/components/ButtonList.js +0 -145
  174. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.js +0 -164
  175. package/v2Containers/WebPush/Create/components/ButtonsLinksSection.test.js +0 -463
  176. package/v2Containers/WebPush/Create/components/FormActions.js +0 -54
  177. package/v2Containers/WebPush/Create/components/FormActions.test.js +0 -163
  178. package/v2Containers/WebPush/Create/components/MediaSection.js +0 -142
  179. package/v2Containers/WebPush/Create/components/MediaSection.test.js +0 -341
  180. package/v2Containers/WebPush/Create/components/MessageSection.js +0 -103
  181. package/v2Containers/WebPush/Create/components/MessageSection.test.js +0 -268
  182. package/v2Containers/WebPush/Create/components/NotificationTitleSection.js +0 -87
  183. package/v2Containers/WebPush/Create/components/NotificationTitleSection.test.js +0 -210
  184. package/v2Containers/WebPush/Create/components/TemplateNameSection.js +0 -54
  185. package/v2Containers/WebPush/Create/components/TemplateNameSection.test.js +0 -143
  186. package/v2Containers/WebPush/Create/components/__snapshots__/ButtonsLinksSection.test.js.snap +0 -86
  187. package/v2Containers/WebPush/Create/components/__snapshots__/FormActions.test.js.snap +0 -16
  188. package/v2Containers/WebPush/Create/components/__snapshots__/MediaSection.test.js.snap +0 -41
  189. package/v2Containers/WebPush/Create/components/__snapshots__/MessageSection.test.js.snap +0 -54
  190. package/v2Containers/WebPush/Create/components/__snapshots__/NotificationTitleSection.test.js.snap +0 -37
  191. package/v2Containers/WebPush/Create/components/__snapshots__/TemplateNameSection.test.js.snap +0 -21
  192. package/v2Containers/WebPush/Create/components/_buttons.scss +0 -246
  193. package/v2Containers/WebPush/Create/components/tests/ButtonForm.test.js +0 -554
  194. package/v2Containers/WebPush/Create/components/tests/ButtonItem.test.js +0 -607
  195. package/v2Containers/WebPush/Create/components/tests/ButtonList.test.js +0 -633
  196. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonForm.test.js.snap +0 -666
  197. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonItem.test.js.snap +0 -74
  198. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonList.test.js.snap +0 -78
  199. package/v2Containers/WebPush/Create/hooks/useButtonManagement.js +0 -138
  200. package/v2Containers/WebPush/Create/hooks/useButtonManagement.test.js +0 -406
  201. package/v2Containers/WebPush/Create/hooks/useCharacterCount.js +0 -30
  202. package/v2Containers/WebPush/Create/hooks/useCharacterCount.test.js +0 -151
  203. package/v2Containers/WebPush/Create/hooks/useImageUpload.js +0 -104
  204. package/v2Containers/WebPush/Create/hooks/useImageUpload.test.js +0 -538
  205. package/v2Containers/WebPush/Create/hooks/useTagManagement.js +0 -122
  206. package/v2Containers/WebPush/Create/hooks/useTagManagement.test.js +0 -633
  207. package/v2Containers/WebPush/Create/index.js +0 -1148
  208. package/v2Containers/WebPush/Create/index.scss +0 -134
  209. package/v2Containers/WebPush/Create/messages.js +0 -211
  210. package/v2Containers/WebPush/Create/preview/DevicePreviewContent.js +0 -228
  211. package/v2Containers/WebPush/Create/preview/NotificationContainer.js +0 -294
  212. package/v2Containers/WebPush/Create/preview/PreviewContent.js +0 -90
  213. package/v2Containers/WebPush/Create/preview/PreviewControls.js +0 -305
  214. package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +0 -25
  215. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +0 -155
  216. package/v2Containers/WebPush/Create/preview/assets/Light.svg +0 -53
  217. package/v2Containers/WebPush/Create/preview/assets/Top.svg +0 -5
  218. package/v2Containers/WebPush/Create/preview/assets/android-arrow-down.svg +0 -9
  219. package/v2Containers/WebPush/Create/preview/assets/android-arrow-up.svg +0 -9
  220. package/v2Containers/WebPush/Create/preview/assets/chrome-icon.png +0 -0
  221. package/v2Containers/WebPush/Create/preview/assets/edge-icon.png +0 -0
  222. package/v2Containers/WebPush/Create/preview/assets/firefox-icon.svg +0 -106
  223. package/v2Containers/WebPush/Create/preview/assets/iOS.svg +0 -26
  224. package/v2Containers/WebPush/Create/preview/assets/macos-arrow-down-icon.svg +0 -9
  225. package/v2Containers/WebPush/Create/preview/assets/macos-triple-dot-icon.svg +0 -9
  226. package/v2Containers/WebPush/Create/preview/assets/opera-icon.svg +0 -18
  227. package/v2Containers/WebPush/Create/preview/assets/safari-icon.svg +0 -29
  228. package/v2Containers/WebPush/Create/preview/assets/windows-close-icon.svg +0 -9
  229. package/v2Containers/WebPush/Create/preview/assets/windows-triple-dot-icon.svg +0 -9
  230. package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +0 -51
  231. package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +0 -145
  232. package/v2Containers/WebPush/Create/preview/components/IOSHeader.js +0 -45
  233. package/v2Containers/WebPush/Create/preview/components/NotificationExpandedContent.js +0 -68
  234. package/v2Containers/WebPush/Create/preview/components/NotificationHeader.js +0 -61
  235. package/v2Containers/WebPush/Create/preview/components/WindowsChromeExpanded.js +0 -99
  236. package/v2Containers/WebPush/Create/preview/components/tests/AndroidMobileExpanded.test.js +0 -733
  237. package/v2Containers/WebPush/Create/preview/components/tests/WindowsChromeExpanded.test.js +0 -571
  238. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +0 -85
  239. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/WindowsChromeExpanded.test.js.snap +0 -81
  240. package/v2Containers/WebPush/Create/preview/config/notificationMappings.js +0 -50
  241. package/v2Containers/WebPush/Create/preview/constants.js +0 -637
  242. package/v2Containers/WebPush/Create/preview/notification-container.scss +0 -79
  243. package/v2Containers/WebPush/Create/preview/preview.scss +0 -358
  244. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-chrome.scss +0 -370
  245. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-edge.scss +0 -12
  246. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-firefox.scss +0 -12
  247. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-opera.scss +0 -12
  248. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-chrome.scss +0 -47
  249. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-edge.scss +0 -11
  250. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-firefox.scss +0 -11
  251. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-opera.scss +0 -11
  252. package/v2Containers/WebPush/Create/preview/styles/_base.scss +0 -207
  253. package/v2Containers/WebPush/Create/preview/styles/_ios.scss +0 -153
  254. package/v2Containers/WebPush/Create/preview/styles/_ipados.scss +0 -107
  255. package/v2Containers/WebPush/Create/preview/styles/_macos-chrome.scss +0 -101
  256. package/v2Containers/WebPush/Create/preview/styles/_windows-chrome.scss +0 -229
  257. package/v2Containers/WebPush/Create/preview/tests/DevicePreviewContent.test.js +0 -909
  258. package/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +0 -1081
  259. package/v2Containers/WebPush/Create/preview/tests/PreviewControls.test.js +0 -723
  260. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +0 -1327
  261. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/DevicePreviewContent.test.js.snap +0 -131
  262. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/NotificationContainer.test.js.snap +0 -112
  263. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/PreviewControls.test.js.snap +0 -144
  264. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/WebPushPreview.test.js.snap +0 -129
  265. package/v2Containers/WebPush/Create/utils/payloadBuilder.js +0 -96
  266. package/v2Containers/WebPush/Create/utils/payloadBuilder.test.js +0 -396
  267. package/v2Containers/WebPush/Create/utils/previewUtils.js +0 -89
  268. package/v2Containers/WebPush/Create/utils/urlValidation.js +0 -115
  269. package/v2Containers/WebPush/Create/utils/urlValidation.test.js +0 -449
  270. package/v2Containers/WebPush/Create/utils/validation.js +0 -75
  271. package/v2Containers/WebPush/Create/utils/validation.test.js +0 -283
  272. package/v2Containers/WebPush/actions.js +0 -60
  273. package/v2Containers/WebPush/constants.js +0 -132
  274. package/v2Containers/WebPush/index.js +0 -2
  275. package/v2Containers/WebPush/reducer.js +0 -104
  276. package/v2Containers/WebPush/sagas.js +0 -119
  277. package/v2Containers/WebPush/selectors.js +0 -65
  278. package/v2Containers/WebPush/tests/reducer.test.js +0 -863
  279. package/v2Containers/WebPush/tests/sagas.test.js +0 -566
  280. package/v2Containers/WebPush/tests/selectors.test.js +0 -960
@@ -79,7 +79,6 @@ import * as whatsappActions from '../Whatsapp/actions';
79
79
  import * as rcsActions from '../Rcs/actions';
80
80
  import * as zaloActions from '../Zalo/actions';
81
81
  import * as inAppActions from '../InApp/actions';
82
- import * as webpushActions from '../WebPush/actions';
83
82
  import * as globalActions from '../Cap/actions';
84
83
  import { makeSelectAuthenticated } from '../Cap/selectors';
85
84
  import { UserIsAuthenticated } from '../../utils/authWrapper';
@@ -128,18 +127,17 @@ import {
128
127
  VIDEO,
129
128
  GIF,
130
129
  } from '../Whatsapp/constants';
131
- import { INAPP_LAYOUT_DETAILS, INAPP_MESSAGE_LAYOUT_TYPES, INAPP_MEDIA_TYPES, BIG_HTML, ANDROID, IOS } from '../InApp/constants';
130
+ import { INAPP_LAYOUT_DETAILS } from '../InApp/constants';
132
131
  import { ZALO_STATUS_OPTIONS, ZALO_STATUSES } from '../Zalo/constants';
133
132
  import { getWhatsappContent, getWhatsappStatus, getWhatsappCategory, getWhatsappCta, getWhatsappQuickReply, getWhatsappAutoFill, getWhatsappCarouselButtonView } from '../Whatsapp/utils';
134
133
  import { getRCSContent } from '../Rcs/utils';
135
134
  import {RCS_STATUSES} from '../Rcs/constants';
136
135
  import zaloMessages from '../Zalo/messages';
137
136
  import rcsMessages from '../Rcs/messages';
138
- import inAppMessages from '../InApp/messages';
139
137
  import globalMessages from '../../v2Containers/Cap/messages';
140
138
  import { handlePreviewInNewTab } from '../../utils/common';
141
139
 
142
- import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, VIBER, FACEBOOK, WHATSAPP, RCS, ZALO, INAPP, WEBPUSH } from '../CreativesContainer/constants';
140
+ import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, VIBER, FACEBOOK, WHATSAPP, RCS, ZALO, INAPP } from '../CreativesContainer/constants';
143
141
 
144
142
  import {CREATIVE} from '../Facebook/constants';
145
143
  import videoPlay from '../../assets/videoPlay.svg';
@@ -157,13 +155,10 @@ import { DAEMON } from '@capillarytech/vulcan-react-sdk/utils/sagaInjectorTypes'
157
155
  import { Rcs } from '../Rcs';
158
156
  import { makeSelectRcs } from '../Rcs/selectors';
159
157
  import { getRcsStatusType } from '../Rcs/utils';
160
- import { makeSelectWebPush } from '../WebPush/selectors';
161
158
  import { v2MobilePushSagas } from '../MobilePushNew/sagas';
162
159
  import { AUTO_CAROUSEL, BIG_PICTURE, FILMSTRIP_CAROUSEL, MANUAL_CAROUSEL } from '../MobilePushNew/constants';
163
160
  import CapPageSpinner from '../../v2Components/CapPageSpinner';
164
- import webPushSagas from '../WebPush/sagas';
165
161
  const withMobilePushNewSaga = injectSaga({ key: 'mobilePushNew', saga: v2MobilePushSagas, mode: DAEMON });
166
- const withWebPushSaga = injectSaga({ key: 'webPush', saga: webPushSagas, mode: DAEMON });
167
162
 
168
163
  const { timeTracker } = GA;
169
164
  const {CapCustomCardList} = CapCustomCard;
@@ -205,29 +200,6 @@ const SMS_FILTERS = {
205
200
  SERVICE_IMPLICIT: 'implicit',
206
201
  };
207
202
 
208
- const INAPP_LAYOUT_OPTIONS = [
209
- {
210
- key: 'popup',
211
- value: INAPP_MESSAGE_LAYOUT_TYPES.MODAL,
212
- label: <FormattedMessage {...inAppMessages.layoutModal} />,
213
- },
214
- {
215
- key: 'topBanner',
216
- value: INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER,
217
- label: <FormattedMessage {...inAppMessages.layoutTopBanner} />,
218
- },
219
- {
220
- key: 'bottomBanner',
221
- value: INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER,
222
- label: <FormattedMessage {...inAppMessages.layoutBottomBanner} />,
223
- },
224
- {
225
- key: 'fullScreen',
226
- value: INAPP_MESSAGE_LAYOUT_TYPES.FULLSCREEN,
227
- label: <FormattedMessage {...inAppMessages.layoutFullScreen} />,
228
- },
229
- ];
230
-
231
203
  const WHATSAPP_LOWERCASE = WHATSAPP.toLowerCase();
232
204
  const RCS_LOWERCASE = RCS.toLowerCase();
233
205
  const SMS_LOWERCASE = SMS.toLowerCase();
@@ -240,7 +212,6 @@ const EBILL_LOWERCASE = EBILL.toLowerCase();
240
212
  const LINE_LOWERCASE = LINE.toLowerCase();
241
213
  const ZALO_LOWERCASE = ZALO.toLowerCase();
242
214
  const WECHAT_LOWERCASE = WECHAT.toLowerCase();
243
- const WEBPUSH_LOWERCASE = WEBPUSH.toLowerCase();
244
215
  const duplicateEnum = {
245
216
  sms: "smsActions",
246
217
  line: "lineActions",
@@ -279,7 +250,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
279
250
  selectedWhatsappStatus: '',
280
251
  selectedWhatsappCategory: '',
281
252
  selectedZaloStatus: '',
282
- selectedInAppLayout: '',
283
253
  hostName: '',
284
254
  searchedZaloTemplates: [],
285
255
  searchingZaloTemplate: false,
@@ -300,9 +270,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
300
270
  // Phase 18: EMAIL API call flag
301
271
  isWaitingForEmailTemplateDetails: false,
302
272
  };
303
- // Timeout IDs for cleanup
304
- this._clearEditTimeout = null;
305
- this._clearCreateTimeout = null;
306
273
  this.getAllTemplates = this.getAllTemplates.bind(this);
307
274
  this.createTemplate = this.createTemplate.bind(this);
308
275
  this.searchTemplate = this.searchTemplate.bind(this);
@@ -428,19 +395,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
428
395
  orgUnitId: -1,
429
396
  });
430
397
  break;
431
- case WEBPUSH:
432
- channel = 'Webpush';
433
- activeMode = ACCOUNT_SELECTION_MODE;
434
- this.props.actions.getWeCrmAccounts('WebPush');
435
- break;
436
398
  default:
437
399
  channel = '';
438
400
  }
439
401
  this.setState({ channel, activeMode });
440
- // Clear templates when entering account selection mode to prevent showing old channel templates
441
- if (activeMode === ACCOUNT_SELECTION_MODE) {
442
- this.props.actions.resetTemplate();
443
- }
444
402
  if (isEmpty(this.props.Templates?.userList)) {
445
403
  this.props.actions.getUserList();
446
404
  }
@@ -538,10 +496,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
538
496
  channel = 'Facebook';
539
497
  this.setState({defaultAccount: true});
540
498
  nextProps.actions.getAccountsSettings();
541
- } else if (nextProps.route.name.toLowerCase() === WEBPUSH_LOWERCASE) {
542
- this.setState({defaultAccount: true});
543
- channel = 'Webpush';
544
- nextProps.actions.getWeCrmAccounts('WebPush');
545
499
  }
546
500
 
547
501
  // Phase 14: Reset Test and Preview state on channel change
@@ -693,50 +647,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
693
647
  }, 1000);
694
648
  }
695
649
 
696
- // Check for WebPush edit response - prevent duplicate calls
697
- if (selectedChannel === WEBPUSH_LOWERCASE && nextProps.WebPush?.editResponse && (nextProps.WebPush.editResponse.templateId || nextProps.WebPush.editResponse._id) && !isEqual(nextProps.WebPush.editResponse, this.props.WebPush?.editResponse)) {
698
- const channelLabel = this.props.intl.formatMessage(messages.webpushHeader);
699
- const message = `${channelLabel} ${this.props.intl.formatMessage(messages.templateUpdateSuccess)}`;
700
- CapNotification.success({
701
- key: 'webpushEditSuccess',
702
- message
703
- });
704
- // Clear previous state before loading newer templates
705
- this.props.actions.resetTemplate();
706
- this.getAllTemplates({params, resetPage: true});
707
- // Delay clearing to allow drawer to close first
708
- // Clear any existing timeout before setting a new one
709
- if (this._clearEditTimeout) {
710
- clearTimeout(this._clearEditTimeout);
711
- }
712
- this._clearEditTimeout = setTimeout(() => {
713
- this.props.webpushActions.clearEditResponse();
714
- this._clearEditTimeout = null;
715
- }, 200);
716
- }
717
-
718
- // Check for WebPush create response (for new template creation)
719
- if (selectedChannel === WEBPUSH_LOWERCASE && nextProps.WebPush?.response && (nextProps.WebPush.response?.templateId || nextProps.WebPush.response?._id) && !isEqual(nextProps.WebPush.response, this.props.WebPush?.response)) {
720
- // Skip showing generic "created" toast when this is a duplicate operation
721
- if (!nextProps.WebPush.response.meta?.isDuplicate) {
722
- const channelLabel = this.props.intl.formatMessage(messages.webpushHeader);
723
- const message = `${channelLabel} ${this.props.intl.formatMessage(messages.templateCreateSuccess)}`;
724
- CapNotification.success({key: 'webpushCreateSuccess', message});
725
- // Clear previous state before loading newer templates
726
- this.props.actions.resetTemplate();
727
- this.getAllTemplates({params, resetPage: true});
728
- // Delay clearing to allow drawer to close first
729
- // Clear any existing timeout before setting a new one
730
- if (this._clearCreateTimeout) {
731
- clearTimeout(this._clearCreateTimeout);
732
- }
733
- this._clearCreateTimeout = setTimeout(() => {
734
- this.props.webpushActions.clearCreateResponse();
735
- this._clearCreateTimeout = null;
736
- }, 200);
737
- }
738
- }
739
-
740
650
 
741
651
 
742
652
  if (nextProps.Create && this.props.Create && nextProps.Create.createTemplateError && !isEqual(nextProps.Create.createTemplateError, this.props.Create.createTemplateError)) {
@@ -744,7 +654,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
744
654
  if ((this.state.channel || '').toLowerCase() !== "sms") {
745
655
  CapNotification.error({key: 'somethingWrong', message});
746
656
  }
747
- const { smsActions, mobilepushActions, ebillActions, lineActions, viberActions, facebookActions, whatsappActions, inAppActions, rcsActions, webpushActions } = this.props;
657
+ const { smsActions, mobilepushActions, ebillActions, lineActions, viberActions, facebookActions, whatsappActions, inAppActions, rcsActions } = this.props;
748
658
  switch (selectedChannel) {
749
659
  case SMS_LOWERCASE:
750
660
  smsActions.clearCreateResponse();
@@ -773,9 +683,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
773
683
  case inAppActions:
774
684
  inAppActions.clearCreateResponse();
775
685
  break;
776
- case WEBPUSH_LOWERCASE:
777
- webpushActions.clearCreateResponse();
778
- break;
779
686
  default:
780
687
  break;
781
688
  }
@@ -788,10 +695,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
788
695
  nextProps.Templates.deleteResponse) {
789
696
  const message = `${this.state.channel} ${this.props.intl.formatMessage(messages['Template deleted successfully'])}`;
790
697
  CapNotification.success({key: 'deleteSucess', message});
791
- // Clear previous state before loading newer templates for web push channel
792
- if (selectedChannel === WEBPUSH_LOWERCASE) {
793
- this.props.actions.resetTemplate();
794
- }
795
698
  this.getAllTemplates({params, resetPage: true});
796
699
  }
797
700
 
@@ -904,7 +807,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
904
807
  this.setState({ previewTemplate: nextProps.Templates.templateDetails });
905
808
  }
906
809
  const { weCrmAccounts: weCrmAccountsList = [], senderDetails = {} } = get(nextProps, 'Templates', {});
907
- const weCrmChannels = [WHATSAPP_LOWERCASE, ZALO_LOWERCASE, RCS_LOWERCASE, WEBPUSH_LOWERCASE];
810
+ const weCrmChannels = [WHATSAPP_LOWERCASE, ZALO_LOWERCASE, RCS_LOWERCASE];
908
811
 
909
812
  // Keeping the wechat flow separate as it has different logic for setting the account. Currently we don't support wechat but still keeping the flow.
910
813
  if (weCrmAccountsList?.length === 1 && this.state?.defaultAccount && selectedChannel === WECHAT_LOWERCASE && !isEmpty(senderDetails?.hostName)) {
@@ -931,9 +834,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
931
834
  const isSingleAccount = weCrmAccountsList?.length === 1;
932
835
  const selectedAccount = this.props.Templates[ACCOUNT_MAPPING_ON_CHANNEL[selectedChannel]] || {};
933
836
  const hostName = this.getHostName(isSingleAccount ? weCrmAccountsList[0]?.sourceAccountIdentifier : selectedAccount?.sourceAccountIdentifier, senderDetails?.domainProperties);
934
- if (!isEmpty(hostName) || selectedChannel === WEBPUSH_LOWERCASE) {
837
+ if (!isEmpty(hostName)) {
935
838
  const paramsDefault = {};
936
- const {name, sourceAccountIdentifier, configs, id } = weCrmAccountsList?.[0] || {};
839
+ const {name, sourceAccountIdentifier, configs } = weCrmAccountsList?.[0] || {};
937
840
  if (isSingleAccount) {
938
841
  weCrmAccountsList[0].hostName = hostName;
939
842
  this.setState({ selectedAccount: name });
@@ -958,9 +861,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
958
861
  paramsDefault.accessToken = configs?.accessToken;
959
862
  paramsDefault.host = hostName || this.props.Templates?.selectedRcsAccount?.hostName;
960
863
  }
961
- if (selectedChannel === WEBPUSH_LOWERCASE) {
962
- paramsDefault.accountId = id;
963
- }
964
864
  this.setState({ defaultAccount: false });
965
865
  /**
966
866
  * Incase of multiple accounts, getAllTemplates is called on selecting the account. It's handled in onAccountSelect function.
@@ -983,15 +883,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
983
883
  window.removeEventListener("message", this.handleFrameTasks);
984
884
  this.props.actions.resetTemplateStoreData();
985
885
  this.props.globalActions.clearMetaEntities();
986
- // Clear any pending timeouts to prevent memory leaks
987
- if (this._clearEditTimeout) {
988
- clearTimeout(this._clearEditTimeout);
989
- this._clearEditTimeout = null;
990
- }
991
- if (this._clearCreateTimeout) {
992
- clearTimeout(this._clearCreateTimeout);
993
- this._clearCreateTimeout = null;
994
- }
995
886
  // this.props.actions.resetAccount();
996
887
  // this.setState({defaultAccount: false});
997
888
  // Phase 14: Cleanup Test and Preview state
@@ -1002,10 +893,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1002
893
  });
1003
894
  }
1004
895
 
1005
- onAccountSelect(e) {
896
+ onAccountSelect(e) {
1006
897
  const value = e.target.value;
1007
- // Clear templates immediately when account is selected to prevent showing old channel templates
1008
- this.props.actions.resetTemplate();
1009
898
  this.setState({selectedAccount: value}, () => {
1010
899
  const params = {};
1011
900
  if (this.state.channel.toLowerCase() !== ZALO_LOWERCASE) {
@@ -1033,7 +922,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1033
922
  } else {
1034
923
  this.setState({ selectedAccountError: false });
1035
924
  }
1036
- } else if ([LINE.toLowerCase(), RCS_LOWERCASE, ZALO_LOWERCASE, WHATSAPP_LOWERCASE, WEBPUSH_LOWERCASE].includes(selectedChannel)) {
925
+ } else if ([LINE.toLowerCase(), RCS_LOWERCASE, ZALO_LOWERCASE, WHATSAPP_LOWERCASE].includes(selectedChannel)) {
1037
926
  const setAcc = this.props?.Templates?.weCrmAccounts?.find((item) => item?.name === this.state.selectedAccount);
1038
927
  const { domainProperties = [] } = this.props?.Templates?.senderDetails || {};
1039
928
  let hostName = '';
@@ -1060,9 +949,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1060
949
  params.accountId = sourceAccountIdentifier;
1061
950
  params.host = hostName;
1062
951
  }
1063
- if (selectedChannel === WEBPUSH_LOWERCASE && setAcc) {
1064
- params.accountId = setAcc.accountId || setAcc.id;
1065
- }
1066
952
  if (selectedChannel === RCS_LOWERCASE && hostName) {
1067
953
  const { configs: { accessToken = "" } = {} } = setAcc || {};
1068
954
  params.accountId = sourceAccountIdentifier;
@@ -1516,41 +1402,32 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1516
1402
  let creativesParams = {mode: ''};
1517
1403
  if (!isEmpty(routeParams)) {
1518
1404
  const { pathname } = routeParams;
1519
- if (pathname) {
1520
- if (pathname.includes('create')) {
1521
- creativesParams.mode = 'create';
1522
- } else if (pathname.includes('edit') || pathname.includes('overview')) {
1523
- creativesParams.mode = 'edit';
1524
- if (pathname.includes('richmedia')) {
1525
- creativesParams._id = pathname.split('/')[4];
1526
- creativesParams.definition = {
1527
- msgcontent: "RICH_MEDIA_WECHAT",
1528
- };
1529
- } else {
1530
- creativesParams._id = pathname.split('/')[3];
1531
- creativesParams.modeType = pathname.split('/')[4];
1532
- creativesParams.account = pathname.split('/')[5];
1533
- if (this.state.channel.toLowerCase() === WHATSAPP_LOWERCASE) {
1534
- const whatsappSelectedTemplateData = this.selectTemplate(creativesParams._id) || {};
1535
- const { name = '', versions = {} } = whatsappSelectedTemplateData;
1536
- creativesParams.whatsappTemplateName = name;
1537
- creativesParams.whatsappTemplateCategory = get(versions, `base.content.whatsapp.category`, '');
1538
- creativesParams.whatsappTemplateLanguageCode = get(versions, `base.content.whatsapp.languages[0].language`, '');
1539
- } else if (this.state.channel.toLocaleLowerCase() === ZALO_LOWERCASE) {
1540
- const zaloSelectedTemplateData = this.selectTemplate(parseInt(creativesParams._id, 10)) || {};
1541
- const { name = '' } = zaloSelectedTemplateData;
1542
- creativesParams.name = name
1543
- } else if (this.state.channel.toLowerCase() === WEBPUSH_LOWERCASE) {
1544
- // For WebPush, extract only the fields the component uses
1545
- const webpushSelectedTemplateData = this.selectTemplate(creativesParams._id) || {};
1546
- const { name = '', definition = {}, versions = {} } = webpushSelectedTemplateData;
1547
- creativesParams.name = name;
1548
- creativesParams.definition = definition;
1549
- creativesParams.versions = versions;
1550
- }
1405
+ if (pathname.includes('create')) {
1406
+ creativesParams.mode = 'create';
1407
+ } else if (pathname.includes('edit') || pathname.includes('overview')) {
1408
+ creativesParams.mode = 'edit';
1409
+ if (pathname.includes('richmedia')) {
1410
+ creativesParams._id = pathname.split('/')[4];
1411
+ creativesParams.definition = {
1412
+ msgcontent: "RICH_MEDIA_WECHAT",
1413
+ };
1414
+ } else {
1415
+ creativesParams._id = pathname.split('/')[3];
1416
+ creativesParams.modeType = pathname.split('/')[4];
1417
+ creativesParams.account = pathname.split('/')[5];
1418
+ if (this.state.channel.toLowerCase() === WHATSAPP_LOWERCASE) {
1419
+ const whatsappSelectedTemplateData = this.selectTemplate(creativesParams._id) || {};
1420
+ const { name = '', versions = {} } = whatsappSelectedTemplateData;
1421
+ creativesParams.whatsappTemplateName = name;
1422
+ creativesParams.whatsappTemplateCategory = get(versions, `base.content.whatsapp.category`, '');
1423
+ creativesParams.whatsappTemplateLanguageCode = get(versions, `base.content.whatsapp.languages[0].language`, '');
1424
+ } else if (this.state.channel.toLocaleLowerCase() === ZALO_LOWERCASE) {
1425
+ const zaloSelectedTemplateData = this.selectTemplate(parseInt(creativesParams._id, 10)) || {};
1426
+ const { name = '' } = zaloSelectedTemplateData;
1427
+ creativesParams.name = name
1551
1428
  }
1552
- creativesParams.type = this.state.channel.toUpperCase();
1553
1429
  }
1430
+ creativesParams.type = this.state.channel.toUpperCase();
1554
1431
  }
1555
1432
  }
1556
1433
  if (this.state.previewOpen) {
@@ -1584,13 +1461,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1584
1461
  queryParams.host = params?.host || this.state?.hostName;
1585
1462
  };
1586
1463
 
1587
- setWebpushQueryParams = (queryParams, params) => {
1588
- const selectedAccount = this.props.Templates?.selectedWebPushAccount;
1589
- queryParams.accountId = params?.accountId
1590
- || selectedAccount?.accountId
1591
- || selectedAccount?.id;
1592
- };
1593
-
1594
1464
  getAllTemplates = ({params, getNextPage, resetPage}, resetTemplates) => {
1595
1465
  let queryParams = params || {};
1596
1466
  let page = this.state.page;
@@ -1622,9 +1492,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1622
1492
  if (this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE) {
1623
1493
  this.setWhatsappQueryParams(queryParams, params);
1624
1494
  }
1625
- if (this.state?.channel?.toLowerCase() === WEBPUSH_LOWERCASE) {
1626
- this.setWebpushQueryParams(queryParams, params);
1627
- }
1628
1495
  if (this.state?.channel?.toLowerCase() === RCS_LOWERCASE && !isEmpty(this.props.Templates?.selectedRcsAccount)) {
1629
1496
  const { sourceAccountIdentifier = '', configs: { accessToken = '' } = {}, hostName = '' } = this.props.Templates.selectedRcsAccount;
1630
1497
  if (sourceAccountIdentifier) {
@@ -1689,9 +1556,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1689
1556
  if (this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE) {
1690
1557
  this.setWhatsappQueryParams(queryParams, params);
1691
1558
  }
1692
- if (this.state?.channel?.toLowerCase() === WEBPUSH_LOWERCASE) {
1693
- this.setWebpushQueryParams(queryParams, params);
1694
- }
1695
1559
  if (this.state?.channel?.toLowerCase() === RCS_LOWERCASE && !isEmpty(this.props.Templates?.selectedRcsAccount)) {
1696
1560
  const { sourceAccountIdentifier = '', configs: { accessToken = '' } = {}, hostName = '' } = this.props.Templates.selectedRcsAccount;
1697
1561
  if (sourceAccountIdentifier) {
@@ -1784,19 +1648,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1784
1648
  return templates;
1785
1649
  }
1786
1650
 
1787
- filterInAppTemplates = (templates) => {
1788
- const { selectedInAppLayout } = this.state;
1789
- if (!selectedInAppLayout) {
1790
- return templates;
1791
- }
1792
- return templates.filter((template) => {
1793
- const androidBodyType = get(template, 'versions.base.content.ANDROID.bodyType');
1794
- const iosBodyType = get(template, 'versions.base.content.IOS.bodyType');
1795
- const inappBodyType = androidBodyType || iosBodyType;
1796
- return inappBodyType === selectedInAppLayout;
1797
- });
1798
- }
1799
-
1800
1651
  filterSMSTemplates = (templates) => {
1801
1652
  const { smsFilter } = this.state;
1802
1653
  if (SMS_FILTERS.ALL === smsFilter) {
@@ -1883,9 +1734,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1883
1734
  case ZALO:
1884
1735
  filteredTemplates = this.filterZaloTemplates(templates);
1885
1736
  break;
1886
- case INAPP:
1887
- filteredTemplates = this.filterInAppTemplates(templates);
1888
- break;
1889
1737
  default:
1890
1738
  break;
1891
1739
  }
@@ -2175,12 +2023,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2175
2023
  templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
2176
2024
  }
2177
2025
  break;
2178
- case INAPP: {
2179
- // Pass the full template object to CapCustomCard so getInAppContent can extract the data
2180
- // Similar to how MOBILE_PUSH passes the full template when new feature is enabled
2026
+ case INAPP:
2181
2027
  templateData.content = template;
2182
2028
  break;
2183
- }
2184
2029
  case WECHAT:
2185
2030
  templateData.content = this.prepareWeChatPreviewData(template);
2186
2031
  break;
@@ -2457,70 +2302,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2457
2302
  templateData.content = <CapLabel type="label19" className="zalo-listing-content desc">{template.name}</CapLabel>;
2458
2303
  break;
2459
2304
  }
2460
- case WEBPUSH: {
2461
- const webpushContent = get(template, 'versions.base.content.webpush', {});
2462
- const notificationTitle = webpushContent?.title || '';
2463
- const notificationMessage = webpushContent?.message || '';
2464
- const brandIcon = webpushContent?.brandIcon || '';
2465
- const mediaImage = webpushContent?.image || '';
2466
- const ctaButtons = Array.isArray(webpushContent?.ctas)
2467
- ? webpushContent.ctas.filter(
2468
- (cta) => typeof cta?.actionText === 'string' && cta.actionText.trim()
2469
- )
2470
- : [];
2471
- const visibleCtas = ctaButtons.slice(0, 2);
2472
- templateData.content = (
2473
- <div className="sms-template-content webpush-template-content">
2474
- <div className="webpush-template-card">
2475
- <div className="webpush-template-meta">
2476
- {brandIcon ? (
2477
- <img
2478
- src={brandIcon}
2479
- alt="Brand Icon"
2480
- className="webpush-brand-icon"
2481
- />
2482
- ) : (
2483
- <span className="webpush-brand-icon-placeholder" />
2484
- )}
2485
- <div className="webpush-template-text">
2486
- <div className="webpush-template-header">
2487
- <div className="webpush-template-title">
2488
- {notificationTitle}
2489
- </div>
2490
- <div className="webpush-template-time">2:29 PM</div>
2491
- </div>
2492
- {notificationMessage ? (
2493
- <div className="webpush-template-message">
2494
- {notificationMessage}
2495
- </div>
2496
- ) : null}
2497
- {mediaImage ? (
2498
- <img
2499
- src={mediaImage}
2500
- alt="Media"
2501
- className="webpush-media-image"
2502
- />
2503
- ) : null}
2504
- </div>
2505
- </div>
2506
- {visibleCtas.length ? (
2507
- <div
2508
- className={`webpush-template-cta-section${
2509
- visibleCtas.length === 1 ? ' single-cta' : ''
2510
- }`}
2511
- >
2512
- {visibleCtas.map((cta, index) => (
2513
- <div className="webpush-template-cta-item" key={`webpush-cta-${index}`}>
2514
- <span className="webpush-template-cta-text">{cta.actionText}</span>
2515
- </div>
2516
- ))}
2517
- </div>
2518
- ) : null}
2519
- </div>
2520
- </div>
2521
- );
2522
- break;
2523
- }
2524
2305
  default:
2525
2306
  templateData.content = "";
2526
2307
  }
@@ -2556,9 +2337,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2556
2337
  const noLoaderAndSearchText = isEmpty(this.state.searchText) && !isLoading;
2557
2338
 
2558
2339
  return (<div>
2559
- {[WECHAT, MOBILE_PUSH, WEBPUSH, INAPP, WHATSAPP, ZALO, RCS].includes(currentChannel) && this.showAccountName()}
2340
+ {[WECHAT, MOBILE_PUSH, INAPP, WHATSAPP, ZALO,RCS].includes(currentChannel) && this.showAccountName()}
2560
2341
  {filterContent}
2561
- {[WHATSAPP, ZALO, INAPP,RCS].includes(currentChannel) && this.selectedFilters()}
2342
+ {[WHATSAPP, ZALO,RCS].includes(currentChannel) && this.selectedFilters()}
2562
2343
  {<div>
2563
2344
  {!isEmpty(filteredTemplates) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError) ? (
2564
2345
  <div className={!isEmpty(this.state.searchText) && isEmpty(cardDataList) ? '' : this.isFullMode() ? "v2-pagination-container" : "v2-pagination-container-half"}>
@@ -2630,11 +2411,6 @@ return (<div>
2630
2411
  <ChannelTypeIllustration isFullMode={this.props.isFullMode} createTemplate={this.createTemplate} currentChannel={currentChannel}/>
2631
2412
  </div>
2632
2413
  }
2633
- {showIllustrationForChannel(WEBPUSH_LOWERCASE) &&
2634
- <div style={this.isFullMode() ? { height: "calc(100vh - 20.3125rem)", overflow: 'auto' } : {}}>
2635
- <ChannelTypeIllustration isFullMode={this.props.isFullMode} createTemplate={this.createTemplate} currentChannel={currentChannel} hostName={this.state?.hostName}/>
2636
- </div>
2637
- }
2638
2414
  {<CapCustomSkeleton loader={isInitialLoading && (isLoading || getAllTemplatesInProgress)} />}
2639
2415
  {<CapPageSpinner spinning={!isInitialLoading && (isLoading || getAllTemplatesInProgress)} />}
2640
2416
  </div>
@@ -2773,9 +2549,6 @@ return (<div>
2773
2549
 
2774
2550
  prepareWeChatMappedPreviewData(content, templateTags, tagData) {
2775
2551
  let formattedContent = cloneDeep(content);
2776
- if (!formattedContent || typeof formattedContent !== 'string') {
2777
- return formattedContent || '';
2778
- }
2779
2552
  forEach(templateTags, (tag) => {
2780
2553
  if (tagData[tag].value !== undefined) {
2781
2554
  formattedContent = formattedContent.replace(`{{${tag}.DATA}}`, tagData[tag].value);
@@ -3031,10 +2804,6 @@ return (<div>
3031
2804
  params.host = this.state?.hostName;
3032
2805
  }
3033
2806
  this.delay(() => {
3034
- // Clear previous state before loading newer templates for web push channel
3035
- if (this.state.channel.toLowerCase() === WEBPUSH_LOWERCASE) {
3036
- this.props.actions.resetTemplate();
3037
- }
3038
2807
  this.getAllTemplates({params, resetPage: true});
3039
2808
  }, 500);
3040
2809
  });
@@ -3198,32 +2967,6 @@ return (<div>
3198
2967
  this.getAllTemplates({params: {}}, true);
3199
2968
  this.props.inAppActions.clearCreateResponse();
3200
2969
  });
3201
- } else if (this.state.channel.toLowerCase() === "webpush") {
3202
- const params = {
3203
- name: this.state.searchText,
3204
- sortBy: this.state.sortBy,
3205
- };
3206
-
3207
- // Get the selected WebPush account
3208
- const selectedAccount = this.props.Templates?.selectedWebPushAccount;
3209
-
3210
- // Set the accountId in the duplicate object
3211
- if (duplicateObj.definition) {
3212
- duplicateObj.definition.accountId = selectedAccount?.accountId || selectedAccount?.id;
3213
- }
3214
-
3215
- const channelLabel = this.props.intl.formatMessage(messages.webpushHeader);
3216
- this.props.webpushActions.createTemplate(duplicateObj, (response) => {
3217
- if (response && (response.templateId || response._id)) {
3218
- // Clear response immediately to prevent componentWillReceiveProps from showing "created" notification
3219
- this.props.webpushActions.clearCreateResponse();
3220
- // Clear previous state before loading newer templates
3221
- this.props.actions.resetTemplate();
3222
- const message = `${channelLabel} ${this.props.intl.formatMessage(messages.templateDuplicateSuccess)}`;
3223
- CapNotification.success({key: 'duplicateSuccess', message});
3224
- this.getAllTemplates({params, resetPage: true});
3225
- }
3226
- }, { isDuplicate: true });
3227
2970
  } else if (this.state.channel.toLowerCase() === "ebill") {
3228
2971
  this.props.ebillActions.createTemplate(duplicateObj);
3229
2972
  } else if (this.state.channel.toLowerCase() === "email") {
@@ -3358,10 +3101,6 @@ return (<div>
3358
3101
  pathName = `/inapp/edit/${id}/`;
3359
3102
  break;
3360
3103
  }
3361
- case WEBPUSH: {
3362
- pathName = `/webpush/edit/${id}`;
3363
- break;
3364
- }
3365
3104
  default:
3366
3105
  break;
3367
3106
  }
@@ -3709,14 +3448,6 @@ return (<div>
3709
3448
  fetchingWeCrmAccounts,
3710
3449
  sendingFile,
3711
3450
  } = Templates;
3712
-
3713
- // Show loading when in account selection or account change mode
3714
- const isAccountSelectionMode = this.state.activeMode === ACCOUNT_SELECTION_MODE ||
3715
- this.state.activeMode === ACCOUNT_CHANGE_MODE;
3716
- if (isAccountSelectionMode) {
3717
- return false;
3718
- }
3719
-
3720
3451
  const lineLoader = this.checkLoader('line');
3721
3452
  const smsLoader = this.checkLoader('sms');
3722
3453
  const viberLoader = this.checkLoader(VIBER_CHANNEL);
@@ -3739,10 +3470,6 @@ return (<div>
3739
3470
  fetchingWeCrmAccounts ) &&
3740
3471
  this.state.channel.toLowerCase() === ZALO_LOWERCASE;
3741
3472
  const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
3742
- const webpushLoader = (
3743
- (getAllTemplatesInProgress && this.state.channel.toLowerCase() === WEBPUSH_LOWERCASE) ||
3744
- (fetchingWeCrmAccounts && this.state.channel.toLowerCase() === WEBPUSH_LOWERCASE)
3745
- );
3746
3473
  const inAppLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === INAPP_LOWERCASE);
3747
3474
  const emailLoader = (
3748
3475
  (getAllTemplatesInProgress ||
@@ -3757,7 +3484,6 @@ return (<div>
3757
3484
  (emailLoader !== undefined ? emailLoader : false) ||
3758
3485
  (ebillLoader !== undefined ? ebillLoader : false) ||
3759
3486
  (mobilePushLoader !== undefined ? mobilePushLoader : false) ||
3760
- (webpushLoader !== undefined ? webpushLoader : false) ||
3761
3487
  (lineLoader !== undefined ? lineLoader : false) ||
3762
3488
  (facebookLoader !== undefined ? facebookLoader : false) ||
3763
3489
  (viberLoader !== undefined ? viberLoader : false) ||
@@ -3828,9 +3554,9 @@ return (<div>
3828
3554
  const isMobilePushChannel = channel === MOBILE_PUSH;
3829
3555
  const isInAppChannel = channel === INAPP;
3830
3556
  const isFacebookChannel = channel === FACEBOOK;
3831
- if ([WECHAT, MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP, WEBPUSH, RCS].includes(channel) && !isEmpty(weCrmAccounts) && !isFacebookChannel) {
3557
+ if ([WECHAT, MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP, RCS].includes(channel) && !isEmpty(weCrmAccounts) && !isFacebookChannel) {
3832
3558
  forEach(weCrmAccounts, (account) => {
3833
- if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || [MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP, WEBPUSH, RCS].includes(channel)) {
3559
+ if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || [MOBILE_PUSH, INAPP, LINE, ZALO, WHATSAPP, RCS].includes(channel)) {
3834
3560
  if (query.type === 'embedded' && (!query.module || (query.module && query.module !== 'library'))) {
3835
3561
  if (query.source_account_id && account.sourceAccountIdentifier === query.source_account_id) {
3836
3562
  accountOptions.push(
@@ -3909,11 +3635,6 @@ return (<div>
3909
3635
  noAccountHeader = messages.noAccountsPresentZalo;
3910
3636
  break;
3911
3637
  }
3912
- case WEBPUSH: {
3913
- accountHeader = formatMessage(messages.webpushAccount);
3914
- noAccountHeader = messages.noAccountsPresentWebpush;
3915
- break;
3916
- }
3917
3638
  case RCS: {
3918
3639
  accountHeader = formatMessage(messages.rcsAccount);
3919
3640
  noAccountHeader = messages.noAccountsPresentRcs;
@@ -3970,12 +3691,10 @@ return (<div>
3970
3691
  };
3971
3692
 
3972
3693
  setAccountSelectionMode = () => {
3973
- this.props.actions.resetTemplate();
3974
3694
  this.setState({activeMode: ACCOUNT_SELECTION_MODE});
3975
3695
  }
3976
3696
 
3977
3697
  setAccountChangeMode = () => {
3978
- this.props.actions.resetTemplate();
3979
3698
  this.setState({activeMode: ACCOUNT_CHANGE_MODE});
3980
3699
  }
3981
3700
 
@@ -3992,7 +3711,6 @@ return (<div>
3992
3711
 
3993
3712
  const channelObj = {
3994
3713
  [MOBILE_PUSH]: 'mobilepushAccount',
3995
- [WEBPUSH]: 'webpushAccount',
3996
3714
  [WECHAT]: 'wechatAccount',
3997
3715
  [WHATSAPP]: 'whatsappAccount',
3998
3716
  [INAPP]: 'inappAccount',
@@ -4028,19 +3746,14 @@ return (<div>
4028
3746
  }
4029
3747
 
4030
3748
  removeZaloFilter = () => this.setState({ selectedZaloStatus: null });
4031
- removeInAppLayoutFilter = () => this.setState({ selectedInAppLayout: '' });
4032
3749
 
4033
3750
  selectedFilters = () => {
4034
- const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus, selectedInAppLayout } = this.state;
3751
+ const { selectedWhatsappStatus, selectedWhatsappCategory, selectedZaloStatus } = this.state;
4035
3752
  const {
4036
3753
  intl: {
4037
3754
  formatMessage,
4038
3755
  },
4039
3756
  } = this.props;
4040
- const getInAppLayoutLabel = (layoutValue) => {
4041
- const layoutOption = INAPP_LAYOUT_OPTIONS.find(opt => opt.value === layoutValue);
4042
- return layoutOption ? layoutOption.label : layoutValue;
4043
- };
4044
3757
  return (
4045
3758
  <CapRow type="flex" align="middle" className="selected-whatsapp-filters">
4046
3759
  {
@@ -4075,23 +3788,6 @@ return (<div>
4075
3788
  </CapTag>
4076
3789
  ) : null
4077
3790
  }
4078
- {
4079
- selectedInAppLayout ? (
4080
- <CapTag closable onClose={this.removeInAppLayoutFilter}>
4081
- {formatMessage(messages.layout)}: {getInAppLayoutLabel(selectedInAppLayout)}
4082
- </CapTag>
4083
- ) : null
4084
- }
4085
- {
4086
- selectedInAppLayout ? (
4087
- <CapLink
4088
- onClick={() => {
4089
- this.removeInAppLayoutFilter();
4090
- }}
4091
- title={this.props.intl.formatMessage(messages.clearAll)}
4092
- />
4093
- ) : null
4094
- }
4095
3791
  </CapRow>
4096
3792
  );
4097
3793
  }
@@ -4102,7 +3798,6 @@ return (<div>
4102
3798
  setLineFilter = (e) => this.setState({lineFilter: e.target.value});
4103
3799
  setSMSFilter = (e) => this.setState({smsFilter: e.target.value});
4104
3800
  setZaloStatus = (value) => this.setState({selectedZaloStatus: value?.item?.props?.value});
4105
- setInAppLayout = (value) => this.setState({selectedInAppLayout: value?.item?.props?.value});
4106
3801
 
4107
3802
  openCreativesFullMode = () => {
4108
3803
  const channelLowerCase = this.state.channel.toLowerCase();
@@ -4355,21 +4050,6 @@ return (<div>
4355
4050
  )
4356
4051
  : () => null
4357
4052
  }
4358
- {
4359
- channel.toUpperCase() === INAPP && (
4360
- <div className="inapp-filters">
4361
- <CapSelectFilter
4362
- placement="bottomLeft"
4363
- data={INAPP_LAYOUT_OPTIONS}
4364
- onSelect={this.setInAppLayout}
4365
- selectedValue={this.state.selectedInAppLayout}
4366
- placeholder="Layout"
4367
- showBadge
4368
- width="120px"
4369
- />
4370
- </div>
4371
- )
4372
- }
4373
4053
  <div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
4374
4054
  {
4375
4055
  this.state?.channel?.toLowerCase() === WHATSAPP_LOWERCASE && (isWhatsappCountExeeded)? (
@@ -4649,8 +4329,6 @@ Templates.propTypes = {
4649
4329
  rcsActions: PropTypes.object,
4650
4330
  zaloActions: PropTypes.object,
4651
4331
  inAppActions: PropTypes.object,
4652
- webpushActions: PropTypes.object,
4653
- WebPush: PropTypes.object,
4654
4332
  smsRegister: PropTypes.any,
4655
4333
  isDltFromRcs: PropTypes.bool,
4656
4334
  };
@@ -4670,7 +4348,6 @@ const mapStateToProps = createStructuredSelector({
4670
4348
  Rcs: makeSelectRcs(),
4671
4349
  Zalo: makeSelectZalo(),
4672
4350
  InApp: makeSelectInApp(),
4673
- WebPush: makeSelectWebPush(),
4674
4351
  });
4675
4352
 
4676
4353
  function mapDispatchToProps(dispatch) {
@@ -4690,7 +4367,6 @@ function mapDispatchToProps(dispatch) {
4690
4367
  whatsappActions: bindActionCreators(whatsappActions, dispatch),
4691
4368
  rcsActions: bindActionCreators(rcsActions, dispatch),
4692
4369
  zaloActions: bindActionCreators(zaloActions, dispatch),
4693
- webpushActions: bindActionCreators(webpushActions, dispatch),
4694
4370
  };
4695
4371
  }
4696
4372
 
@@ -4704,7 +4380,6 @@ export default compose(
4704
4380
  UserIsAuthenticated,
4705
4381
  withSaga,
4706
4382
  withMobilePushNewSaga,
4707
- withWebPushSaga,
4708
4383
  withReducer,
4709
4384
  withConnect,
4710
4385
  )(injectIntl(Templates));