@capillarytech/creatives-library 9.1.8-alpha.sprint-cap-214249.39 → 9.2.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 (87) hide show
  1. package/constants/unified.js +4 -0
  2. package/package.json +1 -1
  3. package/translations/en.json +1 -0
  4. package/translations/ja-JP.json +1 -0
  5. package/translations/zh.json +1 -0
  6. package/utils/common.js +6 -0
  7. package/utils/createMobilePushPayload.js +33 -50
  8. package/utils/tagValidations.js +35 -4
  9. package/utils/templateVarUtils.js +49 -0
  10. package/utils/tests/createMobilePushPayload.test.js +8 -113
  11. package/utils/tests/tagValidations.test.js +48 -0
  12. package/utils/tests/templateVarUtils.test.js +89 -0
  13. package/v2Components/CapMpushCTA/index.js +9 -10
  14. package/v2Components/CapMpushCTA/index.scss +3 -29
  15. package/v2Components/CapTagList/TagFallbackPanel.js +124 -0
  16. package/v2Components/CapTagList/constants.js +5 -0
  17. package/v2Components/CapTagList/index.js +46 -7
  18. package/v2Components/CapTagList/messages.js +44 -0
  19. package/v2Components/CapTagList/style.scss +113 -1
  20. package/v2Components/CapTagList/tests/TagFallback.test.js +222 -0
  21. package/v2Components/CapTagList/utils.js +17 -0
  22. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +12 -20
  23. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
  24. package/v2Components/CommonTestAndPreview/constants.js +3 -2
  25. package/v2Components/CommonTestAndPreview/index.js +61 -61
  26. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -81
  27. package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -86
  28. package/v2Components/CommonTestAndPreview/tests/utils.test.js +102 -0
  29. package/v2Components/CommonTestAndPreview/utils.js +42 -3
  30. package/v2Components/FormBuilder/Classic.js +24 -14
  31. package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +1 -0
  32. package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
  33. package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +57 -0
  34. package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
  35. package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +3 -0
  36. package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +5 -0
  37. package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +6 -0
  38. package/v2Components/FormBuilder/Functional/channels/sms/validate.js +3 -1
  39. package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +3 -0
  40. package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +22 -0
  41. package/v2Components/TemplatePreview/_templatePreview.scss +2 -12
  42. package/v2Components/TemplatePreview/index.js +16 -24
  43. package/v2Components/TemplatePreview/tests/index.test.js +0 -68
  44. package/v2Containers/Cap/messages.js +4 -0
  45. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +1 -0
  46. package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -4
  47. package/v2Containers/CreativesContainer/index.js +1 -2
  48. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -43
  49. package/v2Containers/InApp/index.js +4 -1
  50. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
  51. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
  52. package/v2Containers/Line/Container/Text/index.js +3 -1
  53. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +16 -0
  54. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +18 -0
  55. package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
  56. package/v2Containers/MobilePushNew/components/MediaUploaders.js +216 -297
  57. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +125 -158
  58. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
  59. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +108 -464
  60. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +35 -106
  61. package/v2Containers/MobilePushNew/constants.js +0 -5
  62. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
  63. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -52
  64. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -40
  65. package/v2Containers/MobilePushNew/hooks/useUpload.js +39 -29
  66. package/v2Containers/MobilePushNew/index.js +239 -488
  67. package/v2Containers/MobilePushNew/index.scss +4 -205
  68. package/v2Containers/MobilePushNew/messages.js +6 -106
  69. package/v2Containers/MobilePushNew/tests/index.test.js +1 -469
  70. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -70
  71. package/v2Containers/MobilePushNew/utils.js +0 -56
  72. package/v2Containers/Rcs/index.js +8 -1
  73. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +59 -0
  74. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -0
  75. package/v2Containers/SmsTrai/Edit/index.js +17 -7
  76. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +42 -0
  77. package/v2Containers/Templates/_templates.scss +2 -10
  78. package/v2Containers/Templates/index.js +81 -83
  79. package/v2Containers/Templates/tests/index.test.js +0 -68
  80. package/v2Containers/Viber/index.js +3 -1
  81. package/v2Containers/WebPush/Create/utils/validation.js +6 -0
  82. package/v2Containers/WebPush/Create/utils/validation.test.js +50 -0
  83. package/v2Containers/Whatsapp/index.js +9 -5
  84. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
  85. package/v2Containers/Zalo/index.js +4 -1
  86. package/v2Components/CapMpushCTA/tests/index.test.js +0 -89
  87. package/v2Containers/MobilePushNew/components/TapLinkActions.js +0 -76
@@ -341,6 +341,7 @@ exports[`Creatives SmsTraiEdit test/> should render 1`] = `
341
341
  "creatives.componentsV2.TopBar.profile": "Profile",
342
342
  "creatives.componentsV2.TopBar.settings": "Settings",
343
343
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
344
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
344
345
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
345
346
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
346
347
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -3823,6 +3824,7 @@ FREE GIFTS-
3823
3824
  "creatives.componentsV2.TopBar.profile": "Profile",
3824
3825
  "creatives.componentsV2.TopBar.settings": "Settings",
3825
3826
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
3827
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
3826
3828
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
3827
3829
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
3828
3830
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -6072,6 +6074,7 @@ new message content.",
6072
6074
  "creatives.componentsV2.TopBar.profile": "Profile",
6073
6075
  "creatives.componentsV2.TopBar.settings": "Settings",
6074
6076
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
6077
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
6075
6078
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
6076
6079
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
6077
6080
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -12539,6 +12542,7 @@ FREE GIFTS-
12539
12542
  {#var#}",
12540
12543
  "templateId": "'1107160207324585172'",
12541
12544
  "traiDltEnabled": undefined,
12545
+ "varMapped": Object {},
12542
12546
  },
12543
12547
  }
12544
12548
  }
@@ -12575,6 +12579,7 @@ FREE GIFTS-
12575
12579
  {#var#}",
12576
12580
  "templateId": "'1107160207324585172'",
12577
12581
  "traiDltEnabled": undefined,
12582
+ "varMapped": Object {},
12578
12583
  },
12579
12584
  }
12580
12585
  }
@@ -12612,6 +12617,7 @@ FREE GIFTS-
12612
12617
  {#var#}",
12613
12618
  "templateId": "'1107160207324585172'",
12614
12619
  "traiDltEnabled": undefined,
12620
+ "varMapped": Object {},
12615
12621
  },
12616
12622
  }
12617
12623
  }
@@ -12648,6 +12654,7 @@ FREE GIFTS-
12648
12654
  {#var#}",
12649
12655
  "templateId": "'1107160207324585172'",
12650
12656
  "traiDltEnabled": undefined,
12657
+ "varMapped": Object {},
12651
12658
  },
12652
12659
  }
12653
12660
  }
@@ -12685,6 +12692,7 @@ FREE GIFTS-
12685
12692
  {#var#}",
12686
12693
  "templateId": "'1107160207324585172'",
12687
12694
  "traiDltEnabled": undefined,
12695
+ "varMapped": Object {},
12688
12696
  },
12689
12697
  }
12690
12698
  }
@@ -12745,6 +12753,7 @@ FREE GIFTS-
12745
12753
  {#var#}",
12746
12754
  "templateId": "'1107160207324585172'",
12747
12755
  "traiDltEnabled": undefined,
12756
+ "varMapped": Object {},
12748
12757
  },
12749
12758
  }
12750
12759
  }
@@ -12832,6 +12841,7 @@ FREE GIFTS-
12832
12841
  {#var#}",
12833
12842
  "templateId": "'1107160207324585172'",
12834
12843
  "traiDltEnabled": undefined,
12844
+ "varMapped": Object {},
12835
12845
  },
12836
12846
  }
12837
12847
  }
@@ -13174,6 +13184,7 @@ FREE GIFTS-
13174
13184
  "creatives.componentsV2.TopBar.profile": "Profile",
13175
13185
  "creatives.componentsV2.TopBar.settings": "Settings",
13176
13186
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
13187
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
13177
13188
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
13178
13189
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
13179
13190
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -15173,6 +15184,7 @@ FREE GIFTS-
15173
15184
  {#var#}",
15174
15185
  "templateId": "'1107160207324585172'",
15175
15186
  "traiDltEnabled": undefined,
15187
+ "varMapped": Object {},
15176
15188
  },
15177
15189
  }
15178
15190
  }
@@ -15515,6 +15527,7 @@ FREE GIFTS-
15515
15527
  "creatives.componentsV2.TopBar.profile": "Profile",
15516
15528
  "creatives.componentsV2.TopBar.settings": "Settings",
15517
15529
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
15530
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
15518
15531
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
15519
15532
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
15520
15533
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -17535,6 +17548,7 @@ FREE GIFTS-
17535
17548
  {#var#}",
17536
17549
  "templateId": "'1107160207324585172'",
17537
17550
  "traiDltEnabled": undefined,
17551
+ "varMapped": Object {},
17538
17552
  },
17539
17553
  }
17540
17554
  }
@@ -18005,6 +18019,7 @@ exports[`Creatives SmsTraiEdit test/> should render 2`] = `
18005
18019
  "creatives.componentsV2.TopBar.profile": "Profile",
18006
18020
  "creatives.componentsV2.TopBar.settings": "Settings",
18007
18021
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
18022
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
18008
18023
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
18009
18024
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
18010
18025
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -21979,6 +21994,7 @@ FREE GIFTS-
21979
21994
  "creatives.componentsV2.TopBar.profile": "Profile",
21980
21995
  "creatives.componentsV2.TopBar.settings": "Settings",
21981
21996
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
21997
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
21982
21998
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
21983
21999
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
21984
22000
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -24228,6 +24244,7 @@ new message content.",
24228
24244
  "creatives.componentsV2.TopBar.profile": "Profile",
24229
24245
  "creatives.componentsV2.TopBar.settings": "Settings",
24230
24246
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
24247
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
24231
24248
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
24232
24249
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
24233
24250
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -31667,6 +31684,7 @@ FREE GIFTS-
31667
31684
  {#var#}",
31668
31685
  "templateId": "'1107160207324585172'",
31669
31686
  "traiDltEnabled": undefined,
31687
+ "varMapped": Object {},
31670
31688
  },
31671
31689
  }
31672
31690
  }
@@ -31703,6 +31721,7 @@ FREE GIFTS-
31703
31721
  {#var#}",
31704
31722
  "templateId": "'1107160207324585172'",
31705
31723
  "traiDltEnabled": undefined,
31724
+ "varMapped": Object {},
31706
31725
  },
31707
31726
  }
31708
31727
  }
@@ -31740,6 +31759,7 @@ FREE GIFTS-
31740
31759
  {#var#}",
31741
31760
  "templateId": "'1107160207324585172'",
31742
31761
  "traiDltEnabled": undefined,
31762
+ "varMapped": Object {},
31743
31763
  },
31744
31764
  }
31745
31765
  }
@@ -31776,6 +31796,7 @@ FREE GIFTS-
31776
31796
  {#var#}",
31777
31797
  "templateId": "'1107160207324585172'",
31778
31798
  "traiDltEnabled": undefined,
31799
+ "varMapped": Object {},
31779
31800
  },
31780
31801
  }
31781
31802
  }
@@ -31813,6 +31834,7 @@ FREE GIFTS-
31813
31834
  {#var#}",
31814
31835
  "templateId": "'1107160207324585172'",
31815
31836
  "traiDltEnabled": undefined,
31837
+ "varMapped": Object {},
31816
31838
  },
31817
31839
  }
31818
31840
  }
@@ -31873,6 +31895,7 @@ FREE GIFTS-
31873
31895
  {#var#}",
31874
31896
  "templateId": "'1107160207324585172'",
31875
31897
  "traiDltEnabled": undefined,
31898
+ "varMapped": Object {},
31876
31899
  },
31877
31900
  }
31878
31901
  }
@@ -31960,6 +31983,7 @@ FREE GIFTS-
31960
31983
  {#var#}",
31961
31984
  "templateId": "'1107160207324585172'",
31962
31985
  "traiDltEnabled": undefined,
31986
+ "varMapped": Object {},
31963
31987
  },
31964
31988
  }
31965
31989
  }
@@ -32302,6 +32326,7 @@ FREE GIFTS-
32302
32326
  "creatives.componentsV2.TopBar.profile": "Profile",
32303
32327
  "creatives.componentsV2.TopBar.settings": "Settings",
32304
32328
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
32329
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
32305
32330
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
32306
32331
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
32307
32332
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -34301,6 +34326,7 @@ FREE GIFTS-
34301
34326
  {#var#}",
34302
34327
  "templateId": "'1107160207324585172'",
34303
34328
  "traiDltEnabled": undefined,
34329
+ "varMapped": Object {},
34304
34330
  },
34305
34331
  }
34306
34332
  }
@@ -34643,6 +34669,7 @@ FREE GIFTS-
34643
34669
  "creatives.componentsV2.TopBar.profile": "Profile",
34644
34670
  "creatives.componentsV2.TopBar.settings": "Settings",
34645
34671
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
34672
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
34646
34673
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
34647
34674
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
34648
34675
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -36663,6 +36690,7 @@ FREE GIFTS-
36663
36690
  {#var#}",
36664
36691
  "templateId": "'1107160207324585172'",
36665
36692
  "traiDltEnabled": undefined,
36693
+ "varMapped": Object {},
36666
36694
  },
36667
36695
  }
36668
36696
  }
@@ -37133,6 +37161,7 @@ exports[`Creatives SmsTraiEdit test/> should save 1`] = `
37133
37161
  "creatives.componentsV2.TopBar.profile": "Profile",
37134
37162
  "creatives.componentsV2.TopBar.settings": "Settings",
37135
37163
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
37164
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
37136
37165
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
37137
37166
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
37138
37167
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -40615,6 +40644,7 @@ FREE GIFTS-
40615
40644
  "creatives.componentsV2.TopBar.profile": "Profile",
40616
40645
  "creatives.componentsV2.TopBar.settings": "Settings",
40617
40646
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
40647
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
40618
40648
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
40619
40649
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
40620
40650
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -42864,6 +42894,7 @@ new message content.",
42864
42894
  "creatives.componentsV2.TopBar.profile": "Profile",
42865
42895
  "creatives.componentsV2.TopBar.settings": "Settings",
42866
42896
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
42897
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
42867
42898
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
42868
42899
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
42869
42900
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -49331,6 +49362,7 @@ FREE GIFTS-
49331
49362
  {#var#}",
49332
49363
  "templateId": "'1107160207324585172'",
49333
49364
  "traiDltEnabled": undefined,
49365
+ "varMapped": Object {},
49334
49366
  },
49335
49367
  }
49336
49368
  }
@@ -49367,6 +49399,7 @@ FREE GIFTS-
49367
49399
  {#var#}",
49368
49400
  "templateId": "'1107160207324585172'",
49369
49401
  "traiDltEnabled": undefined,
49402
+ "varMapped": Object {},
49370
49403
  },
49371
49404
  }
49372
49405
  }
@@ -49404,6 +49437,7 @@ FREE GIFTS-
49404
49437
  {#var#}",
49405
49438
  "templateId": "'1107160207324585172'",
49406
49439
  "traiDltEnabled": undefined,
49440
+ "varMapped": Object {},
49407
49441
  },
49408
49442
  }
49409
49443
  }
@@ -49440,6 +49474,7 @@ FREE GIFTS-
49440
49474
  {#var#}",
49441
49475
  "templateId": "'1107160207324585172'",
49442
49476
  "traiDltEnabled": undefined,
49477
+ "varMapped": Object {},
49443
49478
  },
49444
49479
  }
49445
49480
  }
@@ -49477,6 +49512,7 @@ FREE GIFTS-
49477
49512
  {#var#}",
49478
49513
  "templateId": "'1107160207324585172'",
49479
49514
  "traiDltEnabled": undefined,
49515
+ "varMapped": Object {},
49480
49516
  },
49481
49517
  }
49482
49518
  }
@@ -49537,6 +49573,7 @@ FREE GIFTS-
49537
49573
  {#var#}",
49538
49574
  "templateId": "'1107160207324585172'",
49539
49575
  "traiDltEnabled": undefined,
49576
+ "varMapped": Object {},
49540
49577
  },
49541
49578
  }
49542
49579
  }
@@ -49624,6 +49661,7 @@ FREE GIFTS-
49624
49661
  {#var#}",
49625
49662
  "templateId": "'1107160207324585172'",
49626
49663
  "traiDltEnabled": undefined,
49664
+ "varMapped": Object {},
49627
49665
  },
49628
49666
  }
49629
49667
  }
@@ -49966,6 +50004,7 @@ FREE GIFTS-
49966
50004
  "creatives.componentsV2.TopBar.profile": "Profile",
49967
50005
  "creatives.componentsV2.TopBar.settings": "Settings",
49968
50006
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
50007
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
49969
50008
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
49970
50009
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
49971
50010
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -51965,6 +52004,7 @@ FREE GIFTS-
51965
52004
  {#var#}",
51966
52005
  "templateId": "'1107160207324585172'",
51967
52006
  "traiDltEnabled": undefined,
52007
+ "varMapped": Object {},
51968
52008
  },
51969
52009
  }
51970
52010
  }
@@ -52307,6 +52347,7 @@ FREE GIFTS-
52307
52347
  "creatives.componentsV2.TopBar.profile": "Profile",
52308
52348
  "creatives.componentsV2.TopBar.settings": "Settings",
52309
52349
  "creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
52350
+ "creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
52310
52351
  "creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
52311
52352
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
52312
52353
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
@@ -54327,6 +54368,7 @@ FREE GIFTS-
54327
54368
  {#var#}",
54328
54369
  "templateId": "'1107160207324585172'",
54329
54370
  "traiDltEnabled": undefined,
54371
+ "varMapped": Object {},
54330
54372
  },
54331
54373
  }
54332
54374
  }
@@ -495,23 +495,15 @@
495
495
  padding: $CAP_SPACE_08;
496
496
  text-align: center;
497
497
  display: flex;
498
+ flex-direction: column;
498
499
  align-items: center;
499
500
  justify-content: center;
500
501
  gap: $CAP_SPACE_08;
501
- // Same as the editor previews: one button centred, two as halves split by a divider
502
502
  .action{
503
- flex: 1 1 0;
504
- min-width: 0;
505
- white-space: nowrap;
506
- overflow: hidden;
507
- text-overflow: ellipsis;
508
503
  font-size: $FONT_SIZE_S;
509
504
  font-weight: 600;
510
- color: $FONT_COLOR_01;
505
+ color: #1970DA;
511
506
  height: 1.25rem;
512
- & + .action {
513
- border-left: 1px solid $CAP_G07;
514
- }
515
507
  }
516
508
  }
517
509
  }
@@ -164,7 +164,7 @@ import { makeSelectRcs } from '../Rcs/selectors';
164
164
  import { getRcsStatusType } from '../Rcs/utils';
165
165
  import { makeSelectWebPush } from '../WebPush/selectors';
166
166
  import { v2MobilePushSagas } from '../MobilePushNew/sagas';
167
- import { AUTO_CAROUSEL, BIG_PICTURE, FILMSTRIP_CAROUSEL, MANUAL_CAROUSEL, VIDEO as MPUSH_VIDEO } from '../MobilePushNew/constants';
167
+ import { AUTO_CAROUSEL, BIG_PICTURE, FILMSTRIP_CAROUSEL, MANUAL_CAROUSEL } from '../MobilePushNew/constants';
168
168
  import CapPageSpinner from '../../v2Components/CapPageSpinner';
169
169
  import webPushSagas from '../WebPush/sagas';
170
170
  import { DLT_LEGACY_VAR_REGEX } from '../SmsTrai/Edit/dltVarTypes';
@@ -1426,17 +1426,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1426
1426
 
1427
1427
  const expandableDetailsAndroid = androidContent.expandableDetails || {};
1428
1428
  const expandableDetailsIos = iosContent.expandableDetails || {};
1429
- // Saved media[0] is { url, type, videoPreviewUrl }; the preview reads { videoSrc, videoPreview }
1430
- const toPreviewVideo = (media) => {
1431
- const { type, url, videoPreviewUrl } = media?.[0] || {};
1432
- return type === MPUSH_VIDEO && url ? { videoSrc: url, videoPreview: videoPreviewUrl || '' } : {};
1433
- };
1434
1429
  // Extract Android content
1435
1430
  const androidPreview = {
1436
1431
  header: androidContent.title || '',
1437
1432
  bodyText: androidContent.message || '',
1438
1433
  bodyImage: expandableDetailsAndroid.image || '',
1439
- bodyVideo: toPreviewVideo(expandableDetailsAndroid.media),
1434
+ bodyVideo: expandableDetailsAndroid.media?.[0] || {},
1440
1435
  bodyGif: '',
1441
1436
  actions: expandableDetailsAndroid.ctas || [],
1442
1437
  carouselData: expandableDetailsAndroid.carouselData || [],
@@ -1447,7 +1442,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1447
1442
  header: iosContent.title || '',
1448
1443
  bodyText: iosContent.message || '',
1449
1444
  bodyImage: expandableDetailsIos.image || '',
1450
- bodyVideo: toPreviewVideo(expandableDetailsIos.media),
1445
+ bodyVideo: expandableDetailsIos.media?.[0] || {},
1451
1446
  bodyGif: '',
1452
1447
  actions: expandableDetailsIos.ctas || [],
1453
1448
  carouselData: expandableDetailsIos.carouselData || [],
@@ -2410,91 +2405,94 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2410
2405
  }
2411
2406
  break;
2412
2407
  }
2413
- case MOBILE_PUSH: {
2414
- const mpushData = get(template, 'versions.base', template);
2415
- const androidData = get(mpushData, 'ANDROID') || get(mpushData, 'androidContent');
2416
- const iosData = get(mpushData, 'IOS') || get(mpushData, 'iosContent');
2417
- let mpushListingData = androidData;
2418
- if (isEmpty(androidData) || !androidData?.title) {
2419
- mpushListingData = iosData;
2420
- };
2421
- const { title, message, expandableDetails: { style = '', image, carouselData = [], ctas = [], media = [] } = {} } = mpushListingData || {};
2422
- const {url = ''} = media?.[0] || {};
2423
- templateData.content = (
2424
- <div className='mobilepush-container'>
2425
- <div className="app-header">
2426
- <div className="app-header-left">
2427
- <span className="app-icon">{""}</span>
2428
- <CapLabel type="label4">{title}</CapLabel>
2429
- </div>
2430
- </div>
2431
- <CapLabel className="mobilepush-message" type="label1">{message}</CapLabel>
2432
- {style === BIG_PICTURE && (
2433
- <CapImage src={image} className="mobilepush-image mobilepush-image-padding" />
2434
- )}
2435
- {style === VIDEO && (
2436
- <div className="video-preview">
2437
- <video aria-label="Template video preview" controls={false} tabIndex="0">
2438
- <source src={url} type="video/mp4" />
2439
- </video>
2440
- <div className="icon-position">
2441
- <CapImage className="video-icon" src={videoPlay} />
2408
+ case MOBILE_PUSH:
2409
+ if (!commonUtil.hasNewMobilePushFeatureEnabled()) {
2410
+ templateData.content = template;
2411
+ } else {
2412
+ const mpushData = get(template, 'versions.base', template);
2413
+ const androidData = get(mpushData, 'ANDROID') || get(mpushData, 'androidContent');
2414
+ const iosData = get(mpushData, 'IOS') || get(mpushData, 'iosContent');
2415
+ let mpushListingData = androidData;
2416
+ if (isEmpty(androidData) || !androidData?.title) {
2417
+ mpushListingData = iosData;
2418
+ };
2419
+ const { title, message, expandableDetails: { style = '', image, carouselData = [], ctas = [], media = [] } = {} } = mpushListingData || {};
2420
+ const {url = ''} = media?.[0] || {};
2421
+ templateData.content = (
2422
+ <div className='mobilepush-container'>
2423
+ <div className="app-header">
2424
+ <div className="app-header-left">
2425
+ <span className="app-icon">{""}</span>
2426
+ <CapLabel type="label4">{title}</CapLabel>
2442
2427
  </div>
2443
2428
  </div>
2444
- )}
2445
- {[MANUAL_CAROUSEL, AUTO_CAROUSEL, FILMSTRIP_CAROUSEL].includes(style) && (
2446
- <div className="scroll-container">
2447
- {carouselData?.map((data, index) => {
2448
- return (
2449
- <div
2450
- key={`carousel-${index + 1}`}
2451
- className="whatsapp-carousel-container"
2452
- role="group"
2453
- >
2454
- <div className="whatsapp-carousel-card">
2455
- {data?.mediaType === IMAGE.toLowerCase() && (
2456
- <CapImage
2457
- src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
2458
- className="whatsapp-image"
2459
- />
2460
- )}
2461
- {data?.mediaType === VIDEO.toLowerCase() && (
2462
- <div className="video-preview">
2429
+ <CapLabel className="mobilepush-message" type="label1">{message}</CapLabel>
2430
+ {style === BIG_PICTURE && (
2431
+ <CapImage src={image} className="mobilepush-image mobilepush-image-padding" />
2432
+ )}
2433
+ {style === VIDEO && (
2434
+ <div className="video-preview">
2435
+ <video aria-label="Template video preview" controls={false} tabIndex="0">
2436
+ <source src={url} type="video/mp4" />
2437
+ </video>
2438
+ <div className="icon-position">
2439
+ <CapImage className="video-icon" src={videoPlay} />
2440
+ </div>
2441
+ </div>
2442
+ )}
2443
+ {[MANUAL_CAROUSEL, AUTO_CAROUSEL, FILMSTRIP_CAROUSEL].includes(style) && (
2444
+ <div className="scroll-container">
2445
+ {carouselData?.map((data, index) => {
2446
+ return (
2447
+ <div
2448
+ key={`carousel-${index + 1}`}
2449
+ className="whatsapp-carousel-container"
2450
+ role="group"
2451
+ >
2452
+ <div className="whatsapp-carousel-card">
2453
+ {data?.mediaType === IMAGE.toLowerCase() && (
2463
2454
  <CapImage
2464
- src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
2455
+ src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
2465
2456
  className="whatsapp-image"
2466
2457
  />
2467
- <div className="icon-position">
2458
+ )}
2459
+ {data?.mediaType === VIDEO.toLowerCase() && (
2460
+ <div className="video-preview">
2468
2461
  <CapImage
2469
- className="video-icon"
2470
- src={videoPlay}
2462
+ src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
2463
+ className="whatsapp-image"
2471
2464
  />
2465
+ <div className="icon-position">
2466
+ <CapImage
2467
+ className="video-icon"
2468
+ src={videoPlay}
2469
+ />
2470
+ </div>
2472
2471
  </div>
2473
- </div>
2474
- )}
2475
- </div>
2476
- </div>
2477
- )
2478
- })}
2479
- </div>
2480
- )}
2481
- {ctas.length > 0 && (
2482
- <div className="actions">
2483
- {ctas.map((cta, index) => (
2484
- <span
2485
- className="action"
2486
- key={`action-${index}`}
2487
- >
2488
- {cta?.actionText}
2489
- </span>
2490
- ))}
2472
+ )}
2473
+ </div>
2474
+ </div>
2475
+ )
2476
+ })}
2491
2477
  </div>
2492
- )}
2493
- </div>
2494
- );
2495
- templateData.isNewMobilePush = true;
2478
+ )}
2479
+ {ctas.length > 0 && (
2480
+ <div className="actions">
2481
+ {ctas.map((cta) => (
2482
+ <span
2483
+ className="action"
2484
+ key={`action-${cta?.actionText}`}
2485
+ >
2486
+ {cta?.actionText && cta?.actionText.toUpperCase()}
2487
+ </span>
2488
+ ))}
2489
+ </div>
2490
+ )}
2491
+ </div>
2492
+ );
2493
+ templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
2494
+ }
2496
2495
  break;
2497
- }
2498
2496
  case INAPP: {
2499
2497
  // Pass the full template object to CapCustomCard so getInAppContent can extract the data
2500
2498
  // Similar to how MOBILE_PUSH passes the full template when new feature is enabled
@@ -498,72 +498,4 @@ describe('Test Templates container', () => {
498
498
  expect(renderedComponent.instance().getCreativesParams()).not.toHaveProperty('openTestAndPreview');
499
499
  });
500
500
  });
501
-
502
- describe('Mobile push grid tile buttons', () => {
503
- it('renders button labels as typed with index keys, so duplicate labels do not clash', () => {
504
- RenderFunctionFor('whatsapp', true);
505
-
506
- const cardDataList = renderedComponent.instance().getTemplateDataForGrid({
507
- templates: [{
508
- _id: 'mpush_1',
509
- name: 'Push Template',
510
- versions: {
511
- base: {
512
- ANDROID: {
513
- title: 'Title',
514
- message: 'Body',
515
- expandableDetails: { ctas: [{ actionText: 'Shop' }, { actionText: 'Shop' }] },
516
- },
517
- },
518
- },
519
- }],
520
- handlers: { handlePreviewClick: jest.fn(), handleEditClick: jest.fn() },
521
- filterContent: null,
522
- channel: 'mobilepush',
523
- isLoading: false,
524
- isInitialLoading: false,
525
- loadingTip: '',
526
- previewTemplateId: null,
527
- });
528
-
529
- const buttons = findByClassName(cardDataList, 'mobilepush-container').props.children
530
- .find((child) => child?.props?.className === 'actions').props.children;
531
- expect(buttons.map((button) => button.key)).toEqual(['action-0', 'action-1']);
532
- expect(buttons.map((button) => button.props.children)).toEqual(['Shop', 'Shop']);
533
- });
534
- });
535
-
536
- describe('Mobile push Test & Preview content from the list', () => {
537
- it('maps each saved video to the { videoSrc, videoPreview } shape the preview reads', () => {
538
- RenderFunctionFor('whatsapp', true);
539
-
540
- const result = renderedComponent.instance().extractTemplateContentForPreview({
541
- versions: {
542
- base: {
543
- ANDROID: {
544
- title: 'A',
545
- expandableDetails: { media: [{ url: 'https://a.mp4', type: 'VIDEO', videoPreviewUrl: 'https://a.jpg' }] },
546
- },
547
- IOS: {
548
- title: 'I',
549
- expandableDetails: { media: [{ url: 'https://i.mp4', type: 'VIDEO' }] },
550
- },
551
- },
552
- },
553
- }, 'MOBILEPUSH');
554
-
555
- expect(result.androidContent.bodyVideo).toEqual({ videoSrc: 'https://a.mp4', videoPreview: 'https://a.jpg' });
556
- expect(result.iosContent.bodyVideo).toEqual({ videoSrc: 'https://i.mp4', videoPreview: '' });
557
- });
558
-
559
- it('gives no video for a text template', () => {
560
- RenderFunctionFor('whatsapp', true);
561
-
562
- const result = renderedComponent.instance().extractTemplateContentForPreview({
563
- versions: { base: { ANDROID: { title: 'A', expandableDetails: { style: 'BIG_TEXT' } } } },
564
- }, 'MOBILEPUSH');
565
-
566
- expect(result.androidContent.bodyVideo).toEqual({});
567
- });
568
- });
569
501
  });