@capillarytech/creatives-library 8.0.136 → 8.0.137-alpha.0

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 (295) hide show
  1. package/constants/unified.js +189 -0
  2. package/package.json +1 -1
  3. package/services/getSchema.js +1 -1
  4. package/services/localStorageApi.js +1 -0
  5. package/tests/i18n.test.js +1 -1
  6. package/utils/common.js +2 -2
  7. package/utils/tagValidations.js +1 -1
  8. package/utils/tests/checkStore.test.js +1 -1
  9. package/utils/tests/customAuth.test.js +1 -1
  10. package/utils/transformerUtils.js +1 -1
  11. package/v2Components/CapTagList/index.js +9 -14
  12. package/v2Components/Carousel/style.scss +1 -1
  13. package/v2Components/EmailMobilePreview/index.js +2 -2
  14. package/v2Components/FormBuilder/index.js +2 -2
  15. package/v2Components/TemplatePreview/index.js +2 -1
  16. package/v2Containers/Cap/tests/saga.test.js +1 -1
  17. package/v2Containers/Email/index.js +1 -1
  18. package/v2Containers/FTP/index.js +1 -1
  19. package/v2Containers/Line/Container/Text/index.js +1 -1
  20. package/v2Containers/MobilePushNew/components/MediaUploaders.js +0 -1
  21. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +271 -0
  22. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +189 -0
  23. package/v2Containers/MobilePushNew/index.scss +0 -7
  24. package/v2Containers/Sms/Create/index.js +2 -2
  25. package/v2Containers/Sms/Edit/index.js +1 -1
  26. package/v2Containers/TagList/index.js +1 -1
  27. package/v2Containers/TagList/utils.js +1 -1
  28. package/v2Containers/Templates/index.js +1 -1
  29. package/v2Containers/Templates/sagas.js +1 -1
  30. package/components/BreadCrumbs/index.js +0 -65
  31. package/components/BreadCrumbs/messages.js +0 -13
  32. package/components/CapTagList/index.js +0 -235
  33. package/components/CapTagList/messages.js +0 -45
  34. package/components/Card/_customCard.scss +0 -40
  35. package/components/Card/index.js +0 -78
  36. package/components/Card/tests/__snapshots__/index.test.js.snap +0 -22
  37. package/components/Card/tests/index.test.js +0 -20
  38. package/components/CardGrid/index.js +0 -71
  39. package/components/Ckeditor/index.js +0 -238
  40. package/components/Ckeditor/messages.js +0 -13
  41. package/components/Ckeditor/style.scss +0 -3
  42. package/components/Component/index.js +0 -29
  43. package/components/CustomPopOver/index.js +0 -81
  44. package/components/CustomPopOver/messages.js +0 -17
  45. package/components/DateFilter/index.js +0 -349
  46. package/components/DateFilter/messages.js +0 -57
  47. package/components/DateRange/index.js +0 -114
  48. package/components/DateRange/messages.js +0 -25
  49. package/components/Edmeditor/index.js +0 -65
  50. package/components/Edmeditor/messages.js +0 -13
  51. package/components/EmailPreview/_emailPreview.scss +0 -119
  52. package/components/EmailPreview/assets/images/iPad.svg +0 -10
  53. package/components/EmailPreview/assets/images/mobile.png +0 -0
  54. package/components/EmailPreview/index.js +0 -107
  55. package/components/EmailPreview/messages.js +0 -33
  56. package/components/Footer/index.js +0 -27
  57. package/components/Footer/messages.js +0 -13
  58. package/components/FormBuilder/_formBuilder.scss +0 -83
  59. package/components/FormBuilder/index.js +0 -3279
  60. package/components/FormBuilder/messages.js +0 -61
  61. package/components/Header/index.js +0 -44
  62. package/components/Header/messages.js +0 -29
  63. package/components/ImagePreview/_imagePreview.scss +0 -63
  64. package/components/ImagePreview/index.js +0 -52
  65. package/components/ImagePreview/messages.js +0 -17
  66. package/components/PageHeader/_pageHeader.scss +0 -22
  67. package/components/PageHeader/index.js +0 -37
  68. package/components/PageHeader/messages.js +0 -13
  69. package/components/Pagination/_pagination.scss +0 -5
  70. package/components/Pagination/index.js +0 -49
  71. package/components/PreviewSideBar/_previewsidebar.scss +0 -28
  72. package/components/PreviewSideBar/index.js +0 -152
  73. package/components/PreviewSideBar/messages.js +0 -41
  74. package/components/Sidebar/_sidebar.scss +0 -115
  75. package/components/Sidebar/index.js +0 -214
  76. package/components/Sidebar/messages.js +0 -21
  77. package/components/SlideBox/_slideBox.scss +0 -63
  78. package/components/SlideBox/index.js +0 -47
  79. package/components/SlideBox/tests/index.test.js +0 -103
  80. package/components/SmsEditor/index.js +0 -55
  81. package/components/SmsTest/index.js +0 -117
  82. package/components/SmsTest/messages.js +0 -21
  83. package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +0 -42
  84. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +0 -141
  85. package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +0 -21
  86. package/components/TemplatePreview/_templatePreview.scss +0 -642
  87. package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
  88. package/components/TemplatePreview/assets/images/androidPushMessage.svg +0 -45
  89. package/components/TemplatePreview/assets/images/home-screen-android.svg +0 -21
  90. package/components/TemplatePreview/assets/images/home-screen-ios.svg +0 -16
  91. package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +0 -135
  92. package/components/TemplatePreview/assets/images/mobile.svg +0 -24
  93. package/components/TemplatePreview/assets/images/sms-body.png +0 -0
  94. package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
  95. package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
  96. package/components/TemplatePreview/assets/images/sms_mobile_android.svg +0 -22
  97. package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +0 -16
  98. package/components/TemplatePreview/assets/images/user-icon.svg +0 -19
  99. package/components/TemplatePreview/assets/images/wechat-mobile.svg +0 -78
  100. package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +0 -20
  101. package/components/TemplatePreview/index.js +0 -617
  102. package/components/TemplatePreview/messages.js +0 -78
  103. package/components/Toastr/index.js +0 -60
  104. package/components/Toastr/messages.js +0 -13
  105. package/components/ToastrMessage/index.js +0 -113
  106. package/components/ToastrMessage/messages.js +0 -17
  107. package/components/TopBar/_topbar.scss +0 -46
  108. package/components/TopBar/assets/images/capillary_logo.png +0 -0
  109. package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
  110. package/components/TopBar/index.js +0 -113
  111. package/components/TopBar/messages.js +0 -29
  112. package/containers/App/actions.js +0 -7
  113. package/containers/App/constants.js +0 -114
  114. package/containers/App/index.js +0 -52
  115. package/containers/App/reducer.js +0 -19
  116. package/containers/App/sagas.js +0 -31
  117. package/containers/App/selectors.js +0 -25
  118. package/containers/App/test/saga.test.js +0 -11
  119. package/containers/Assets/Gallery/_gallery.scss +0 -126
  120. package/containers/Assets/Gallery/actions.js +0 -37
  121. package/containers/Assets/Gallery/constants.js +0 -23
  122. package/containers/Assets/Gallery/index.js +0 -473
  123. package/containers/Assets/Gallery/messages.js +0 -93
  124. package/containers/Assets/Gallery/reducer.js +0 -81
  125. package/containers/Assets/Gallery/sagas.js +0 -80
  126. package/containers/Assets/Gallery/selectors.js +0 -25
  127. package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -9
  128. package/containers/Assets/Gallery/tests/actions.test.js +0 -25
  129. package/containers/Assets/Gallery/tests/reducer.test.js +0 -96
  130. package/containers/Assets/Gallery/tests/saga.test.js +0 -157
  131. package/containers/Cap/actions.js +0 -66
  132. package/containers/Cap/constants.js +0 -25
  133. package/containers/Cap/index.js +0 -402
  134. package/containers/Cap/messages.js +0 -75
  135. package/containers/Cap/reducer.js +0 -113
  136. package/containers/Cap/sagas.js +0 -159
  137. package/containers/Cap/selectors.js +0 -75
  138. package/containers/Cap/tests/__snapshots__/index.test.js.snap +0 -2269
  139. package/containers/Cap/tests/index.test.js +0 -22
  140. package/containers/Cap/tests/saga.test.js +0 -284
  141. package/containers/Dashboard/actions.js +0 -15
  142. package/containers/Dashboard/constants.js +0 -7
  143. package/containers/Dashboard/index.js +0 -76
  144. package/containers/Dashboard/messages.js +0 -13
  145. package/containers/Dashboard/reducer.js +0 -21
  146. package/containers/Dashboard/sagas.js +0 -17
  147. package/containers/Dashboard/selectors.js +0 -25
  148. package/containers/Dashboard/test/saga.test.js +0 -9
  149. package/containers/Ebill/_ebill.scss +0 -5
  150. package/containers/Ebill/actions.js +0 -43
  151. package/containers/Ebill/constants.js +0 -20
  152. package/containers/Ebill/index.js +0 -1278
  153. package/containers/Ebill/messages.js +0 -77
  154. package/containers/Ebill/reducer.js +0 -72
  155. package/containers/Ebill/sagas.js +0 -74
  156. package/containers/Ebill/selectors.js +0 -25
  157. package/containers/Ebill/test/saga.test.js +0 -11
  158. package/containers/Email/_email.scss +0 -141
  159. package/containers/Email/actions.js +0 -81
  160. package/containers/Email/constants.js +0 -36
  161. package/containers/Email/index.js +0 -3325
  162. package/containers/Email/messages.js +0 -289
  163. package/containers/Email/reducer.js +0 -142
  164. package/containers/Email/sagas.js +0 -135
  165. package/containers/Email/selectors.js +0 -31
  166. package/containers/Email/test/saga.test.js +0 -671
  167. package/containers/LanguageProvider/actions.js +0 -17
  168. package/containers/LanguageProvider/constants.js +0 -8
  169. package/containers/LanguageProvider/index.js +0 -80
  170. package/containers/LanguageProvider/reducer.js +0 -30
  171. package/containers/LanguageProvider/selectors.js +0 -20
  172. package/containers/LanguageProvider/tests/actions.test.js +0 -19
  173. package/containers/LanguageProvider/tests/index.test.js +0 -78
  174. package/containers/LanguageProvider/tests/reducer.test.js +0 -20
  175. package/containers/LanguageProvider/tests/selectors.test.js +0 -15
  176. package/containers/Line/Create/_lineCreate.scss +0 -54
  177. package/containers/Line/Create/actions.js +0 -90
  178. package/containers/Line/Create/constants.js +0 -39
  179. package/containers/Line/Create/index.js +0 -836
  180. package/containers/Line/Create/messages.js +0 -189
  181. package/containers/Line/Create/reducer.js +0 -99
  182. package/containers/Line/Create/sagas.js +0 -121
  183. package/containers/Line/Create/selectors.js +0 -36
  184. package/containers/Line/Create/tests/saga.test.js +0 -202
  185. package/containers/Line/Edit/_lineEdit.scss +0 -35
  186. package/containers/Line/Edit/actions.js +0 -79
  187. package/containers/Line/Edit/constants.js +0 -27
  188. package/containers/Line/Edit/index.js +0 -1050
  189. package/containers/Line/Edit/messages.js +0 -177
  190. package/containers/Line/Edit/reducer.js +0 -83
  191. package/containers/Line/Edit/sagas.js +0 -80
  192. package/containers/Line/Edit/selectors.js +0 -29
  193. package/containers/Line/Edit/test/saga.test.js +0 -160
  194. package/containers/Login/assets/images/capillary_logo.png +0 -0
  195. package/containers/Login/components/LoginForm/index.js +0 -62
  196. package/containers/Login/components/LoginForm/messages.js +0 -33
  197. package/containers/Login/index.js +0 -130
  198. package/containers/Login/messages.js +0 -25
  199. package/containers/Login/selectors.js +0 -25
  200. package/containers/MobilePush/Create/_mobilePushCreate.scss +0 -39
  201. package/containers/MobilePush/Create/actions.js +0 -46
  202. package/containers/MobilePush/Create/constants.js +0 -23
  203. package/containers/MobilePush/Create/index.js +0 -2303
  204. package/containers/MobilePush/Create/messages.js +0 -269
  205. package/containers/MobilePush/Create/reducer.js +0 -70
  206. package/containers/MobilePush/Create/sagas.js +0 -74
  207. package/containers/MobilePush/Create/selectors.js +0 -28
  208. package/containers/MobilePush/Create/test/saga.test.js +0 -19
  209. package/containers/MobilePush/Edit/_mobilePushCreate.scss +0 -39
  210. package/containers/MobilePush/Edit/actions.js +0 -91
  211. package/containers/MobilePush/Edit/constants.js +0 -35
  212. package/containers/MobilePush/Edit/index.js +0 -2601
  213. package/containers/MobilePush/Edit/messages.js +0 -266
  214. package/containers/MobilePush/Edit/reducer.js +0 -112
  215. package/containers/MobilePush/Edit/sagas.js +0 -126
  216. package/containers/MobilePush/Edit/selectors.js +0 -29
  217. package/containers/MobilePush/Edit/tests/saga.test.js +0 -255
  218. package/containers/NotFoundPage/index.js +0 -25
  219. package/containers/NotFoundPage/messages.js +0 -13
  220. package/containers/NotFoundPage/tests/index.test.js +0 -17
  221. package/containers/Sms/Create/_smsCreate.scss +0 -42
  222. package/containers/Sms/Create/actions.js +0 -27
  223. package/containers/Sms/Create/constants.js +0 -16
  224. package/containers/Sms/Create/index.js +0 -1488
  225. package/containers/Sms/Create/messages.js +0 -109
  226. package/containers/Sms/Create/reducer.js +0 -41
  227. package/containers/Sms/Create/sagas.js +0 -40
  228. package/containers/Sms/Create/selectors.js +0 -28
  229. package/containers/Sms/Create/test/saga.test.js +0 -11
  230. package/containers/Sms/Edit/actions.js +0 -40
  231. package/containers/Sms/Edit/constants.js +0 -17
  232. package/containers/Sms/Edit/index.js +0 -1472
  233. package/containers/Sms/Edit/messages.js +0 -105
  234. package/containers/Sms/Edit/reducer.js +0 -50
  235. package/containers/Sms/Edit/sagas.js +0 -60
  236. package/containers/Sms/Edit/selectors.js +0 -32
  237. package/containers/Sms/Edit/test/saga.test.js +0 -13
  238. package/containers/TagList/_tagList.scss +0 -8
  239. package/containers/TagList/actions.js +0 -15
  240. package/containers/TagList/constants.js +0 -32
  241. package/containers/TagList/index.js +0 -236
  242. package/containers/TagList/messages.js +0 -13
  243. package/containers/TagList/reducer.js +0 -23
  244. package/containers/TagList/sagas.js +0 -11
  245. package/containers/TagList/selectors.js +0 -25
  246. package/containers/Templates/_templates.scss +0 -333
  247. package/containers/Templates/actions.js +0 -103
  248. package/containers/Templates/constants.js +0 -60
  249. package/containers/Templates/index.js +0 -1756
  250. package/containers/Templates/messages.js +0 -337
  251. package/containers/Templates/reducer.js +0 -142
  252. package/containers/Templates/sagas.js +0 -163
  253. package/containers/Templates/selectors.js +0 -28
  254. package/containers/Templates/test/saga.test.js +0 -241
  255. package/containers/WeChat/MapTemplates/_mapTemplates.scss +0 -8
  256. package/containers/WeChat/MapTemplates/actions.js +0 -52
  257. package/containers/WeChat/MapTemplates/constants.js +0 -28
  258. package/containers/WeChat/MapTemplates/index.js +0 -1610
  259. package/containers/WeChat/MapTemplates/messages.js +0 -157
  260. package/containers/WeChat/MapTemplates/reducer.js +0 -74
  261. package/containers/WeChat/MapTemplates/sagas.js +0 -84
  262. package/containers/WeChat/MapTemplates/selectors.js +0 -25
  263. package/containers/WeChat/MapTemplates/test/saga.test.js +0 -155
  264. package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +0 -57
  265. package/containers/WeChat/RichmediaTemplates/Create/actions.js +0 -36
  266. package/containers/WeChat/RichmediaTemplates/Create/constants.js +0 -15
  267. package/containers/WeChat/RichmediaTemplates/Create/index.js +0 -1071
  268. package/containers/WeChat/RichmediaTemplates/Create/messages.js +0 -165
  269. package/containers/WeChat/RichmediaTemplates/Create/reducer.js +0 -60
  270. package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +0 -497
  271. package/containers/WeChat/RichmediaTemplates/Create/sagas.js +0 -51
  272. package/containers/WeChat/RichmediaTemplates/Create/selectors.js +0 -37
  273. package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +0 -13
  274. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +0 -20
  275. package/containers/WeChat/RichmediaTemplates/Edit/constants.js +0 -10
  276. package/containers/WeChat/RichmediaTemplates/Edit/index.js +0 -136
  277. package/containers/WeChat/RichmediaTemplates/Edit/messages.js +0 -13
  278. package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +0 -28
  279. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +0 -36
  280. package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +0 -30
  281. package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +0 -12
  282. package/containers/WeChat/RichmediaTemplates/View/actions.js +0 -15
  283. package/containers/WeChat/RichmediaTemplates/View/constants.js +0 -7
  284. package/containers/WeChat/RichmediaTemplates/View/index.js +0 -47
  285. package/containers/WeChat/RichmediaTemplates/View/messages.js +0 -21
  286. package/containers/WeChat/RichmediaTemplates/View/reducer.js +0 -23
  287. package/containers/WeChat/RichmediaTemplates/View/sagas.js +0 -11
  288. package/containers/WeChat/RichmediaTemplates/View/selectors.js +0 -25
  289. package/utils/asyncInjectors.js +0 -78
  290. package/utils/callNativeEvent.js +0 -16
  291. package/utils/checkStore.js +0 -21
  292. package/utils/customAuthWrapper.js +0 -62
  293. package/utils/customConnectedAuthWrapper.js +0 -26
  294. package/utils/jed.js +0 -1497
  295. package/utils/smsCharCount.js +0 -351
@@ -3177,4 +3177,275 @@ describe('MediaUploaders', () => {
3177
3177
  );
3178
3178
  });
3179
3179
  });
3180
+
3181
+ // Test cases for uncovered lines
3182
+ describe('Deep link null/undefined handling', () => {
3183
+ it('should handle null deepLink in carousel options', () => {
3184
+ const onCarouselDataChange = jest.fn();
3185
+ renderComponent({
3186
+ mediaType: 'CAROUSEL',
3187
+ carouselData: [
3188
+ {
3189
+ mediaType: 'image',
3190
+ imageUrl: 'test.jpg',
3191
+ buttons: [{
3192
+ actionOnClick: true,
3193
+ linkType: 'DEEP_LINK',
3194
+ deepLinkValue: '',
3195
+ externalLinkValue: '',
3196
+ }],
3197
+ }
3198
+ ],
3199
+ onCarouselDataChange,
3200
+ linkProps: {
3201
+ deepLink: null, // This should trigger the fallback to empty array
3202
+ },
3203
+ carouselActiveTabIndex: 0,
3204
+ });
3205
+
3206
+ // Should render without crashing when deepLink is null
3207
+ expect(screen.getByTestId('cap-image-upload')).toBeInTheDocument();
3208
+ });
3209
+
3210
+ it('should handle undefined deepLink in carousel options', () => {
3211
+ const onCarouselDataChange = jest.fn();
3212
+ renderComponent({
3213
+ mediaType: 'CAROUSEL',
3214
+ carouselData: [
3215
+ {
3216
+ mediaType: 'image',
3217
+ imageUrl: 'test.jpg',
3218
+ buttons: [{
3219
+ actionOnClick: true,
3220
+ linkType: 'DEEP_LINK',
3221
+ deepLinkValue: '',
3222
+ externalLinkValue: '',
3223
+ }],
3224
+ }
3225
+ ],
3226
+ onCarouselDataChange,
3227
+ linkProps: {
3228
+ deepLink: undefined, // This should trigger the fallback to empty array
3229
+ },
3230
+ carouselActiveTabIndex: 0,
3231
+ });
3232
+
3233
+ // Should render without crashing when deepLink is undefined
3234
+ expect(screen.getByTestId('cap-image-upload')).toBeInTheDocument();
3235
+ });
3236
+ });
3237
+
3238
+ describe('Deep link query parameter handling', () => {
3239
+ it('should match deep link with query parameters in carousel action render', () => {
3240
+ const mockDeepLink = [
3241
+ { value: 'myapp://page', keys: ['param1'] }
3242
+ ];
3243
+ const mockCarouselData = [{
3244
+ mediaType: 'image',
3245
+ imageUrl: 'test-image.jpg',
3246
+ buttons: [{
3247
+ actionOnClick: true,
3248
+ linkType: 'DEEP_LINK',
3249
+ deepLinkValue: 'myapp://page?param1=value1', // Has query parameters
3250
+ deepLinkKeys: ['param1'],
3251
+ externalLinkValue: '',
3252
+ }]
3253
+ }];
3254
+
3255
+ const { getByText } = render(
3256
+ <Provider store={mockStore}>
3257
+ <IntlProvider messages={messages} locale="en">
3258
+ <MediaUploaders
3259
+ mediaType="CAROUSEL"
3260
+ activeTab="ANDROID"
3261
+ imageSrc={{ androidImageSrc: '', iosImageSrc: '' }}
3262
+ uploadMpushAsset={jest.fn()}
3263
+ isFullMode={false}
3264
+ setUpdateMpushImageSrc={jest.fn()}
3265
+ updateOnMpushImageReUpload={jest.fn()}
3266
+ imageData={{}}
3267
+ videoAssetList={{}}
3268
+ gifAssetList={{}}
3269
+ setUpdateMpushVideoSrc={jest.fn()}
3270
+ videoDataForVideo={{}}
3271
+ videoDataForGif={{}}
3272
+ videoSrc={''}
3273
+ formatMessage={mockFormatMessage}
3274
+ linkProps={{ deepLink: mockDeepLink }}
3275
+ clearImageDataByMediaType={jest.fn()}
3276
+ carouselData={mockCarouselData}
3277
+ onCarouselDataChange={jest.fn()}
3278
+ mobilePushActions={{ clearAsset: jest.fn() }}
3279
+ carouselActiveTabIndex={0}
3280
+ setCarouselActiveTabIndex={jest.fn()}
3281
+ carouselLinkErrors={{}}
3282
+ updateCarouselLinkError={jest.fn()}
3283
+ />
3284
+ </IntlProvider>
3285
+ </Provider>
3286
+ );
3287
+
3288
+ // Should find the base deep link and display keys
3289
+ expect(getByText('param1')).toBeInTheDocument();
3290
+ });
3291
+
3292
+ it('should match deep link with query parameters in carousel keys display', () => {
3293
+ const mockDeepLink = [
3294
+ { value: 'myapp://home', keys: ['userId', 'sessionId'] }
3295
+ ];
3296
+ const mockCarouselData = [{
3297
+ mediaType: 'image',
3298
+ imageUrl: 'test-image.jpg',
3299
+ buttons: [{
3300
+ actionOnClick: true,
3301
+ linkType: 'DEEP_LINK',
3302
+ deepLinkValue: 'myapp://home?userId=123&sessionId=abc', // Has query parameters
3303
+ deepLinkKeys: ['userId', 'sessionId'],
3304
+ externalLinkValue: '',
3305
+ }]
3306
+ }];
3307
+
3308
+ const { getByText } = render(
3309
+ <Provider store={mockStore}>
3310
+ <IntlProvider messages={messages} locale="en">
3311
+ <MediaUploaders
3312
+ mediaType="CAROUSEL"
3313
+ activeTab="ANDROID"
3314
+ imageSrc={{ androidImageSrc: '', iosImageSrc: '' }}
3315
+ uploadMpushAsset={jest.fn()}
3316
+ isFullMode={false}
3317
+ setUpdateMpushImageSrc={jest.fn()}
3318
+ updateOnMpushImageReUpload={jest.fn()}
3319
+ imageData={{}}
3320
+ videoAssetList={{}}
3321
+ gifAssetList={{}}
3322
+ setUpdateMpushVideoSrc={jest.fn()}
3323
+ videoDataForVideo={{}}
3324
+ videoDataForGif={{}}
3325
+ videoSrc={''}
3326
+ formatMessage={mockFormatMessage}
3327
+ linkProps={{ deepLink: mockDeepLink }}
3328
+ clearImageDataByMediaType={jest.fn()}
3329
+ carouselData={mockCarouselData}
3330
+ onCarouselDataChange={jest.fn()}
3331
+ mobilePushActions={{ clearAsset: jest.fn() }}
3332
+ carouselActiveTabIndex={0}
3333
+ setCarouselActiveTabIndex={jest.fn()}
3334
+ carouselLinkErrors={{}}
3335
+ updateCarouselLinkError={jest.fn()}
3336
+ />
3337
+ </IntlProvider>
3338
+ </Provider>
3339
+ );
3340
+
3341
+ // Should find the base deep link and display keys
3342
+ expect(getByText('userId, sessionId')).toBeInTheDocument();
3343
+ });
3344
+
3345
+ it('should match deep link with query parameters in carousel placeholder', () => {
3346
+ const mockDeepLink = [
3347
+ { value: 'testapp://screen', keys: ['itemId'] }
3348
+ ];
3349
+ const mockCarouselData = [{
3350
+ mediaType: 'image',
3351
+ imageUrl: 'test-image.jpg',
3352
+ buttons: [{
3353
+ actionOnClick: true,
3354
+ linkType: 'DEEP_LINK',
3355
+ deepLinkValue: 'testapp://screen?itemId=456', // Has query parameters
3356
+ deepLinkKeys: [],
3357
+ externalLinkValue: '',
3358
+ }]
3359
+ }];
3360
+
3361
+ render(
3362
+ <Provider store={mockStore}>
3363
+ <IntlProvider messages={messages} locale="en">
3364
+ <MediaUploaders
3365
+ mediaType="CAROUSEL"
3366
+ activeTab="ANDROID"
3367
+ imageSrc={{ androidImageSrc: '', iosImageSrc: '' }}
3368
+ uploadMpushAsset={jest.fn()}
3369
+ isFullMode={false}
3370
+ setUpdateMpushImageSrc={jest.fn()}
3371
+ updateOnMpushImageReUpload={jest.fn()}
3372
+ imageData={{}}
3373
+ videoAssetList={{}}
3374
+ gifAssetList={{}}
3375
+ setUpdateMpushVideoSrc={jest.fn()}
3376
+ videoDataForVideo={{}}
3377
+ videoDataForGif={{}}
3378
+ videoSrc={''}
3379
+ formatMessage={mockFormatMessage}
3380
+ linkProps={{ deepLink: mockDeepLink }}
3381
+ clearImageDataByMediaType={jest.fn()}
3382
+ carouselData={mockCarouselData}
3383
+ onCarouselDataChange={jest.fn()}
3384
+ mobilePushActions={{ clearAsset: jest.fn() }}
3385
+ carouselActiveTabIndex={0}
3386
+ setCarouselActiveTabIndex={jest.fn()}
3387
+ carouselLinkErrors={{}}
3388
+ updateCarouselLinkError={jest.fn()}
3389
+ />
3390
+ </IntlProvider>
3391
+ </Provider>
3392
+ );
3393
+
3394
+ // The component should render successfully and find the deep link by base value
3395
+ expect(screen.getByTestId('cap-image-upload')).toBeInTheDocument();
3396
+ });
3397
+
3398
+ it('should not match deep link when no base match exists with query parameters', () => {
3399
+ const mockDeepLink = [
3400
+ { value: 'myapp://different', keys: ['param1'] }
3401
+ ];
3402
+ const mockCarouselData = [{
3403
+ mediaType: 'image',
3404
+ imageUrl: 'test-image.jpg',
3405
+ buttons: [{
3406
+ actionOnClick: true,
3407
+ linkType: 'DEEP_LINK',
3408
+ deepLinkValue: 'myapp://nomatch?param1=value1', // Base doesn't match any deepLink
3409
+ deepLinkKeys: [],
3410
+ externalLinkValue: '',
3411
+ }]
3412
+ }];
3413
+
3414
+ render(
3415
+ <Provider store={mockStore}>
3416
+ <IntlProvider messages={messages} locale="en">
3417
+ <MediaUploaders
3418
+ mediaType="CAROUSEL"
3419
+ activeTab="ANDROID"
3420
+ imageSrc={{ androidImageSrc: '', iosImageSrc: '' }}
3421
+ uploadMpushAsset={jest.fn()}
3422
+ isFullMode={false}
3423
+ setUpdateMpushImageSrc={jest.fn()}
3424
+ updateOnMpushImageReUpload={jest.fn()}
3425
+ imageData={{}}
3426
+ videoAssetList={{}}
3427
+ gifAssetList={{}}
3428
+ setUpdateMpushVideoSrc={jest.fn()}
3429
+ videoDataForVideo={{}}
3430
+ videoDataForGif={{}}
3431
+ videoSrc={''}
3432
+ formatMessage={mockFormatMessage}
3433
+ linkProps={{ deepLink: mockDeepLink }}
3434
+ clearImageDataByMediaType={jest.fn()}
3435
+ carouselData={mockCarouselData}
3436
+ onCarouselDataChange={jest.fn()}
3437
+ mobilePushActions={{ clearAsset: jest.fn() }}
3438
+ carouselActiveTabIndex={0}
3439
+ setCarouselActiveTabIndex={jest.fn()}
3440
+ carouselLinkErrors={{}}
3441
+ updateCarouselLinkError={jest.fn()}
3442
+ />
3443
+ </IntlProvider>
3444
+ </Provider>
3445
+ );
3446
+
3447
+ // Should render without crashing even when no match is found
3448
+ expect(screen.getByTestId('cap-image-upload')).toBeInTheDocument();
3449
+ });
3450
+ });
3180
3451
  });
@@ -651,4 +651,193 @@ describe("PlatformContentFields", () => {
651
651
  // Check that error message is displayed
652
652
  expect(getByText('Deep link keys error message')).toBeInTheDocument();
653
653
  });
654
+
655
+ // Test cases for uncovered lines
656
+ describe('Deep link null/undefined handling', () => {
657
+ it('should handle null deepLink in options', () => {
658
+ const { container } = renderComponent({
659
+ content: { ...defaultProps.content, actionOnClick: true, linkType: DEEP_LINK },
660
+ linkProps: {
661
+ deepLink: null, // This should trigger the fallback to empty array
662
+ deepLinkValue: '',
663
+ externalLinkValue: '',
664
+ },
665
+ });
666
+
667
+ // Should render without crashing when deepLink is null
668
+ expect(container).toBeInTheDocument();
669
+ });
670
+
671
+ it('should handle undefined deepLink in options', () => {
672
+ const { container } = renderComponent({
673
+ content: { ...defaultProps.content, actionOnClick: true, linkType: DEEP_LINK },
674
+ linkProps: {
675
+ deepLink: undefined, // This should trigger the fallback to empty array
676
+ deepLinkValue: '',
677
+ externalLinkValue: '',
678
+ },
679
+ });
680
+
681
+ // Should render without crashing when deepLink is undefined
682
+ expect(container).toBeInTheDocument();
683
+ });
684
+ });
685
+
686
+ describe('Deep link query parameter handling', () => {
687
+ it('should match deep link with query parameters', () => {
688
+ const mockDeepLink = [
689
+ { value: 'myapp://profile', keys: ['userId'] }
690
+ ];
691
+ const mockLinkProps = {
692
+ deepLink: mockDeepLink,
693
+ deepLinkValue: 'myapp://profile?userId=123', // Has query parameters
694
+ deepLinkKeysValue: ['userId'],
695
+ externalLinkValue: '',
696
+ };
697
+ const mockContent = {
698
+ title: 'Test Title',
699
+ message: 'Test Message',
700
+ mediaType: 'IMAGE',
701
+ actionOnClick: true,
702
+ linkType: 'DEEP_LINK',
703
+ };
704
+
705
+ const { getByText } = render(
706
+ <IntlProvider locale="en">
707
+ <PlatformContentFields
708
+ deviceType="ANDROID"
709
+ content={mockContent}
710
+ errors={{}}
711
+ handlers={defaultProps.handlers}
712
+ tagListProps={defaultProps.tagListProps}
713
+ mediaUploaderProps={defaultProps.mediaUploaderProps}
714
+ ctaButtonProps={defaultProps.ctaButtonProps}
715
+ linkProps={mockLinkProps}
716
+ sameContent={false}
717
+ formatMessage={defaultProps.formatMessage}
718
+ />
719
+ </IntlProvider>
720
+ );
721
+
722
+ // Should find the base deep link and display keys
723
+ expect(getByText('userId')).toBeInTheDocument();
724
+ });
725
+
726
+ it('should not match deep link when no base match exists with query parameters', () => {
727
+ const mockDeepLink = [
728
+ { value: 'myapp://settings', keys: ['theme'] }
729
+ ];
730
+ const mockLinkProps = {
731
+ deepLink: mockDeepLink,
732
+ deepLinkValue: 'myapp://nomatch?theme=dark', // Base doesn't match any deepLink
733
+ deepLinkKeysValue: [],
734
+ externalLinkValue: '',
735
+ };
736
+ const mockContent = {
737
+ title: 'Test Title',
738
+ message: 'Test Message',
739
+ mediaType: 'IMAGE',
740
+ actionOnClick: true,
741
+ linkType: 'DEEP_LINK',
742
+ };
743
+
744
+ const { container } = render(
745
+ <IntlProvider locale="en">
746
+ <PlatformContentFields
747
+ deviceType="ANDROID"
748
+ content={mockContent}
749
+ errors={{}}
750
+ handlers={defaultProps.handlers}
751
+ tagListProps={defaultProps.tagListProps}
752
+ mediaUploaderProps={defaultProps.mediaUploaderProps}
753
+ ctaButtonProps={defaultProps.ctaButtonProps}
754
+ linkProps={mockLinkProps}
755
+ sameContent={false}
756
+ formatMessage={defaultProps.formatMessage}
757
+ />
758
+ </IntlProvider>
759
+ );
760
+
761
+ // Should render without crashing even when no match is found
762
+ expect(container).toBeInTheDocument();
763
+ });
764
+
765
+ it('should handle multiple query parameters in deep link value', () => {
766
+ const mockDeepLink = [
767
+ { value: 'testapp://dashboard', keys: ['category', 'filter'] }
768
+ ];
769
+ const mockLinkProps = {
770
+ deepLink: mockDeepLink,
771
+ deepLinkValue: 'testapp://dashboard?category=news&filter=recent', // Multiple query parameters
772
+ deepLinkKeysValue: ['category', 'filter'],
773
+ externalLinkValue: '',
774
+ };
775
+ const mockContent = {
776
+ title: 'Test Title',
777
+ message: 'Test Message',
778
+ mediaType: 'IMAGE',
779
+ actionOnClick: true,
780
+ linkType: 'DEEP_LINK',
781
+ };
782
+
783
+ const { getByText } = render(
784
+ <IntlProvider locale="en">
785
+ <PlatformContentFields
786
+ deviceType="ANDROID"
787
+ content={mockContent}
788
+ errors={{}}
789
+ handlers={defaultProps.handlers}
790
+ tagListProps={defaultProps.tagListProps}
791
+ mediaUploaderProps={defaultProps.mediaUploaderProps}
792
+ ctaButtonProps={defaultProps.ctaButtonProps}
793
+ linkProps={mockLinkProps}
794
+ sameContent={false}
795
+ formatMessage={defaultProps.formatMessage}
796
+ />
797
+ </IntlProvider>
798
+ );
799
+
800
+ // Should find the base deep link and display keys
801
+ expect(getByText('category, filter')).toBeInTheDocument();
802
+ });
803
+
804
+ it('should handle empty query parameters in deep link value', () => {
805
+ const mockDeepLink = [
806
+ { value: 'myapp://search', keys: ['query'] }
807
+ ];
808
+ const mockLinkProps = {
809
+ deepLink: mockDeepLink,
810
+ deepLinkValue: 'myapp://search?', // Empty query parameters
811
+ deepLinkKeysValue: ['query'],
812
+ externalLinkValue: '',
813
+ };
814
+ const mockContent = {
815
+ title: 'Test Title',
816
+ message: 'Test Message',
817
+ mediaType: 'IMAGE',
818
+ actionOnClick: true,
819
+ linkType: 'DEEP_LINK',
820
+ };
821
+
822
+ const { getByText } = render(
823
+ <IntlProvider locale="en">
824
+ <PlatformContentFields
825
+ deviceType="ANDROID"
826
+ content={mockContent}
827
+ errors={{}}
828
+ handlers={defaultProps.handlers}
829
+ tagListProps={defaultProps.tagListProps}
830
+ mediaUploaderProps={defaultProps.mediaUploaderProps}
831
+ ctaButtonProps={defaultProps.ctaButtonProps}
832
+ linkProps={mockLinkProps}
833
+ sameContent={false}
834
+ formatMessage={defaultProps.formatMessage}
835
+ />
836
+ </IntlProvider>
837
+ );
838
+
839
+ // Should find the base deep link and display keys
840
+ expect(getByText('query')).toBeInTheDocument();
841
+ });
842
+ });
654
843
  });
@@ -34,9 +34,6 @@
34
34
  }
35
35
 
36
36
  .platform-header {
37
- display: flex;
38
- align-items: center;
39
- justify-content: space-between;
40
37
  margin-bottom: $CAP_SPACE_24;
41
38
  }
42
39
 
@@ -44,10 +41,6 @@
44
41
  flex: 1;
45
42
  }
46
43
 
47
- // .platform-header {
48
- // margin-left: 24px;
49
- // }
50
-
51
44
  .tab-label {
52
45
  display: flex;
53
46
  align-items: center;
@@ -18,13 +18,13 @@ import './_smsCreate.scss';
18
18
  import FormBuilder from '../../../v2Components/FormBuilder';
19
19
  import * as actions from './actions';
20
20
  import messages from './messages';
21
- import * as charCount from '../../../utils/smsCharCount';
21
+ import * as charCount from '../../../legacy/smsCharCount';
22
22
  import {checkUnicode, updateCharCount} from '../../../utils/smsCharCountV2';
23
23
  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 '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../legacy/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 '../../../utils/callNativeEvent';
27
+ // import callNativeEvent from '../../../legacy/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 '../../containers/App/constants';
31
+ } from '../../constants/unified';
32
32
 
33
33
  const {TreeNode} = Tree;
34
34
 
@@ -1,4 +1,4 @@
1
- import { JAPANESE_HIDE_DATE_TAGS } from "../../containers/TagList/constants";
1
+ import { JAPANESE_HIDE_DATE_TAGS } from "../../constants/unified";
2
2
 
3
3
 
4
4
  export const hidingDateTagsForJpLocale = (hideDateTagsForJpLocale, val, list, value) => {
@@ -104,7 +104,7 @@ import {
104
104
  CREATE,
105
105
  } from '../App/constants';
106
106
  import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES , ACCOUNT_MAPPING_ON_CHANNEL} from './constants';
107
- import { COPY_OF } from '../../containers/App/constants';
107
+ import { COPY_OF } from '../../constants/unified';
108
108
  import {
109
109
  STATUS_OPTIONS,
110
110
  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 '../../containers/App/constants';
9
+ import { COPY_OF } from '../../constants/unified';
10
10
  import { ZALO_TEMPLATE_INFO_REQUEST } from '../Zalo/constants';
11
11
  import { getTemplateInfoById } from '../Zalo/saga';
12
12
  import { watchCreateTemplate } from '../MobilePushNew/sagas';
@@ -1,65 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- import React from 'react';
3
- // import styled from 'styled-components';
4
- import { Link } from 'react-router';
5
- import _ from 'lodash';
6
-
7
- class BreadCrumbs extends React.Component { // eslint-disable-line react/prefer-stateless-function
8
- constructor(props) {
9
- super(props);
10
- this.prepareBreadcrumbElement = this.prepareBreadcrumbElement.bind(this);
11
- this.disabledBreadcrumb = this.disabledBreadcrumb.bind(this);
12
- }
13
-
14
- disabledBreadcrumb(e, location) {
15
- if (location.disabled) {
16
- e.preventDefault();
17
- }
18
- }
19
-
20
- prepareBreadcrumbElement() {
21
- const breadcrumbs = [];
22
- _.forEach(this.props.locations, (location) => {
23
- const titleText = (typeof location.text === 'string') ? location.text : location.text.props.defaultMessage;
24
- const element = (
25
- <Link
26
- to={location.url}
27
- key={titleText}
28
- title={titleText}
29
- onClick={(e) => this.disabledBreadcrumb(e, location)}
30
- >
31
- <span
32
- className={location.disabled ? 'disabled-breadcrumb' : 'active-breadcrumb'}
33
- disabled={location.disabled}
34
- > {location.text}
35
- </span>
36
- </Link>
37
- );
38
- if (breadcrumbs.length !== 0) {
39
- breadcrumbs.push(
40
- <span
41
- key={`${titleText}separator`}
42
- > {this.props.separator ? this.props.separator : ' / '}
43
- </span>
44
- );
45
- }
46
- breadcrumbs.push(element);
47
- });
48
- return breadcrumbs;
49
- }
50
-
51
- render() {
52
- return (
53
- <div className="breadcrumbs-wrapper">
54
- {this.prepareBreadcrumbElement()}
55
- </div>
56
- );
57
- }
58
- }
59
-
60
- BreadCrumbs.propTypes = {
61
- locations: PropTypes.array.isRequired,
62
- separator: PropTypes.string,
63
- };
64
-
65
- export default BreadCrumbs;
@@ -1,13 +0,0 @@
1
- /*
2
- * BreadCrumbs Messages
3
- *
4
- * This contains all the text for the BreadCrumbs component.
5
- */
6
- import { defineMessages } from 'react-intl';
7
-
8
- export default defineMessages({
9
- header: {
10
- id: 'creatives.components.BreadCrumbs.header',
11
- defaultMessage: 'This is the BreadCrumbs component !',
12
- },
13
- });