@capillarytech/creatives-library 9.1.8-alpha.sprint-cap-214249.38 → 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 (127) hide show
  1. package/constants/unified.js +4 -0
  2. package/index.js +13 -0
  3. package/package.json +1 -1
  4. package/services/getSchema.js +4 -1
  5. package/services/tests/getSchema.test.js +2 -2
  6. package/translations/en.json +1 -0
  7. package/translations/ja-JP.json +1 -0
  8. package/translations/zh.json +1 -0
  9. package/utils/common.js +6 -0
  10. package/utils/createMobilePushPayload.js +33 -47
  11. package/utils/tagValidations.js +35 -4
  12. package/utils/templateVarUtils.js +49 -0
  13. package/utils/tests/createMobilePushPayload.test.js +8 -102
  14. package/utils/tests/tagValidations.test.js +48 -0
  15. package/utils/tests/templateVarUtils.test.js +89 -0
  16. package/v2Components/CapMpushCTA/index.js +9 -10
  17. package/v2Components/CapMpushCTA/index.scss +3 -29
  18. package/v2Components/CapTagList/TagFallbackPanel.js +124 -0
  19. package/v2Components/CapTagList/constants.js +5 -0
  20. package/v2Components/CapTagList/index.js +46 -7
  21. package/v2Components/CapTagList/messages.js +44 -0
  22. package/v2Components/CapTagList/style.scss +113 -1
  23. package/v2Components/CapTagList/tests/TagFallback.test.js +222 -0
  24. package/v2Components/CapTagList/utils.js +17 -0
  25. package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +13 -26
  26. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
  27. package/v2Components/CommonTestAndPreview/constants.js +3 -2
  28. package/v2Components/CommonTestAndPreview/index.js +62 -62
  29. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -79
  30. package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -86
  31. package/v2Components/CommonTestAndPreview/tests/utils.test.js +102 -0
  32. package/v2Components/CommonTestAndPreview/utils.js +42 -3
  33. package/v2Components/FormBuilder/Classic.js +24 -14
  34. package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +1 -0
  35. package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
  36. package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +57 -0
  37. package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
  38. package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +3 -0
  39. package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +5 -0
  40. package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +6 -0
  41. package/v2Components/FormBuilder/Functional/channels/sms/validate.js +3 -1
  42. package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +3 -0
  43. package/v2Components/FormBuilder/Functional/tests/manual.typingPerf.test.js +135 -0
  44. package/v2Components/FormBuilder/Functional/tests/mpush.crossFlowParity.test.js +1 -1
  45. package/v2Components/FormBuilder/Functional/tests/mpush.ctaFlows.parity.test.js +320 -0
  46. package/v2Components/FormBuilder/Functional/tests/mpush.editContainer.parity.test.js +148 -0
  47. package/v2Components/FormBuilder/Functional/tests/mpush.libraryValidity.parity.test.js +152 -0
  48. package/v2Components/FormBuilder/Functional/tests/mpush.shellEvents.test.js +1 -1
  49. package/v2Components/FormBuilder/Functional/tests/mpush.singlePlatform.test.js +1 -1
  50. package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +22 -0
  51. package/v2Components/FormBuilder/tests/mpush.characterization.test.js +2 -2
  52. package/v2Components/TemplatePreview/_templatePreview.scss +2 -12
  53. package/v2Components/TemplatePreview/index.js +17 -30
  54. package/v2Components/TemplatePreview/tests/index.test.js +0 -61
  55. package/v2Containers/Cap/index.js +3 -0
  56. package/v2Containers/Cap/messages.js +4 -0
  57. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +1 -0
  58. package/v2Containers/CreativesContainer/SlideBoxContent.js +151 -70
  59. package/v2Containers/CreativesContainer/index.js +6 -3
  60. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -29
  61. package/v2Containers/InApp/index.js +4 -1
  62. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
  63. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
  64. package/v2Containers/Line/Container/Text/index.js +3 -1
  65. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +16 -0
  66. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +18 -0
  67. package/v2Containers/MobilePush/Create/_mobilePushCreate.scss +70 -0
  68. package/v2Containers/MobilePush/Create/actions.js +52 -0
  69. package/v2Containers/MobilePush/Create/constants.js +26 -0
  70. package/v2Containers/MobilePush/Create/index.js +2149 -0
  71. package/v2Containers/MobilePush/Create/messages.js +349 -0
  72. package/v2Containers/MobilePush/Create/reducer.js +72 -0
  73. package/v2Containers/MobilePush/Create/sagas.js +79 -0
  74. package/v2Containers/MobilePush/Create/selectors.js +29 -0
  75. package/v2Containers/MobilePush/Create/test/contentValidity.test.js +154 -0
  76. package/v2Containers/MobilePush/Create/test/saga.test.js +19 -0
  77. package/v2Containers/MobilePush/Create/test/stayOpenOnSave.test.js +80 -0
  78. package/v2Containers/MobilePush/Edit/_mobilePushCreate.scss +65 -0
  79. package/v2Containers/MobilePush/Edit/actions.js +94 -0
  80. package/v2Containers/MobilePush/Edit/constants.js +37 -0
  81. package/v2Containers/MobilePush/Edit/index.js +2407 -0
  82. package/v2Containers/MobilePush/Edit/messages.js +341 -0
  83. package/v2Containers/MobilePush/Edit/reducer.js +113 -0
  84. package/v2Containers/MobilePush/Edit/sagas.js +113 -0
  85. package/v2Containers/MobilePush/Edit/selectors.js +33 -0
  86. package/v2Containers/MobilePush/Edit/test/contentValidity.test.js +149 -0
  87. package/v2Containers/MobilePush/Edit/test/saga.test.js +255 -0
  88. package/v2Containers/MobilePush/Edit/test/stayOpenOnSave.test.js +60 -0
  89. package/v2Containers/MobilePush/commonMethods.js +333 -0
  90. package/v2Containers/MobilePush/eventsMap.js +130 -0
  91. package/v2Containers/MobilePush/tests/commonMethods.test.js +401 -0
  92. package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
  93. package/v2Containers/MobilePushNew/components/MediaUploaders.js +192 -207
  94. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +121 -116
  95. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
  96. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +72 -316
  97. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +16 -45
  98. package/v2Containers/MobilePushNew/constants.js +0 -5
  99. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
  100. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -52
  101. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -38
  102. package/v2Containers/MobilePushNew/hooks/useUpload.js +39 -29
  103. package/v2Containers/MobilePushNew/index.js +192 -454
  104. package/v2Containers/MobilePushNew/index.scss +4 -188
  105. package/v2Containers/MobilePushNew/messages.js +6 -86
  106. package/v2Containers/MobilePushNew/tests/index.test.js +1 -450
  107. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -25
  108. package/v2Containers/MobilePushNew/utils.js +0 -8
  109. package/v2Containers/MobilepushWrapper/_mobilepushWrapper.scss +22 -0
  110. package/v2Containers/MobilepushWrapper/index.js +178 -0
  111. package/v2Containers/MobilepushWrapper/messages.js +29 -0
  112. package/v2Containers/Rcs/index.js +8 -1
  113. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +59 -0
  114. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -0
  115. package/v2Containers/SmsTrai/Edit/index.js +17 -7
  116. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +42 -0
  117. package/v2Containers/Templates/_templates.scss +2 -10
  118. package/v2Containers/Templates/index.js +90 -84
  119. package/v2Containers/Templates/tests/index.test.js +0 -68
  120. package/v2Containers/Viber/index.js +3 -1
  121. package/v2Containers/WebPush/Create/utils/validation.js +6 -0
  122. package/v2Containers/WebPush/Create/utils/validation.test.js +50 -0
  123. package/v2Containers/Whatsapp/index.js +9 -5
  124. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
  125. package/v2Containers/Zalo/index.js +4 -1
  126. package/v2Components/CapMpushCTA/tests/index.test.js +0 -89
  127. /package/{v2Components/FormBuilder/Functional/tests/fixtures/mpushInitialSchema.js → v2Containers/MobilePush/initialSchema.js} +0 -0
@@ -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
  }
@@ -55,6 +55,7 @@ import {
55
55
  } from "@capillarytech/cap-ui-library";
56
56
  import { makeSelectTemplates, makeSelectTemplatesResponse } from './selectors';
57
57
  import { makeSelectCreate as makeSelectCreateSms } from '../Sms/Create/selectors';
58
+ import { makeSelectCreate as makeSelectCreateMobilePush } from '../MobilePush/Create/selectors';
58
59
  import { makeSelectMobilePushNew } from '../MobilePushNew/selectors';
59
60
  import { makeSelectEbill as makeSelectCreateEbill } from '../Ebill/selectors';
60
61
  import { makeSelectEmail as makeSelectCreateEmail } from '../Email/selectors';
@@ -65,6 +66,7 @@ import { makeSelectZalo } from '../Zalo/selectors';
65
66
  import { makeSelectInApp } from '../InApp/selectors';
66
67
  import * as actions from './actions';
67
68
  import * as smsActions from '../Sms/Create/actions';
69
+ import * as mobilepushActions from '../MobilePush/Create/actions';
68
70
  import * as mobilePushNewActions from '../MobilePushNew/actions';
69
71
  import * as smsEditActions from '../Sms/Edit/actions';
70
72
  import * as ebillActions from '../Ebill/actions';
@@ -162,7 +164,7 @@ import { makeSelectRcs } from '../Rcs/selectors';
162
164
  import { getRcsStatusType } from '../Rcs/utils';
163
165
  import { makeSelectWebPush } from '../WebPush/selectors';
164
166
  import { v2MobilePushSagas } from '../MobilePushNew/sagas';
165
- 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';
166
168
  import CapPageSpinner from '../../v2Components/CapPageSpinner';
167
169
  import webPushSagas from '../WebPush/sagas';
168
170
  import { DLT_LEGACY_VAR_REGEX } from '../SmsTrai/Edit/dltVarTypes';
@@ -789,11 +791,14 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
789
791
  if ((this.state.channel || '').toLowerCase() !== "sms") {
790
792
  CapNotification.error({key: 'somethingWrong', message});
791
793
  }
792
- const { smsActions, ebillActions, lineActions, viberActions, facebookActions, whatsappActions, inAppActions, rcsActions, webpushActions } = this.props;
794
+ const { smsActions, mobilepushActions, ebillActions, lineActions, viberActions, facebookActions, whatsappActions, inAppActions, rcsActions, webpushActions } = this.props;
793
795
  switch (selectedChannel) {
794
796
  case SMS_LOWERCASE:
795
797
  smsActions.clearCreateResponse();
796
798
  break;
799
+ case MOBILE_PUSH_LOWERCASE:
800
+ mobilepushActions.clearCreateResponse();
801
+ break;
797
802
  case EBILL_LOWERCASE:
798
803
  ebillActions.clearCreateResponse();
799
804
  break;
@@ -1421,17 +1426,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1421
1426
 
1422
1427
  const expandableDetailsAndroid = androidContent.expandableDetails || {};
1423
1428
  const expandableDetailsIos = iosContent.expandableDetails || {};
1424
- // Saved media[0] is { url, type, videoPreviewUrl }; the preview reads { videoSrc, videoPreview }
1425
- const toPreviewVideo = (media) => {
1426
- const { type, url, videoPreviewUrl } = media?.[0] || {};
1427
- return type === MPUSH_VIDEO && url ? { videoSrc: url, videoPreview: videoPreviewUrl || '' } : {};
1428
- };
1429
1429
  // Extract Android content
1430
1430
  const androidPreview = {
1431
1431
  header: androidContent.title || '',
1432
1432
  bodyText: androidContent.message || '',
1433
1433
  bodyImage: expandableDetailsAndroid.image || '',
1434
- bodyVideo: toPreviewVideo(expandableDetailsAndroid.media),
1434
+ bodyVideo: expandableDetailsAndroid.media?.[0] || {},
1435
1435
  bodyGif: '',
1436
1436
  actions: expandableDetailsAndroid.ctas || [],
1437
1437
  carouselData: expandableDetailsAndroid.carouselData || [],
@@ -1442,7 +1442,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1442
1442
  header: iosContent.title || '',
1443
1443
  bodyText: iosContent.message || '',
1444
1444
  bodyImage: expandableDetailsIos.image || '',
1445
- bodyVideo: toPreviewVideo(expandableDetailsIos.media),
1445
+ bodyVideo: expandableDetailsIos.media?.[0] || {},
1446
1446
  bodyGif: '',
1447
1447
  actions: expandableDetailsIos.ctas || [],
1448
1448
  carouselData: expandableDetailsIos.carouselData || [],
@@ -2405,91 +2405,94 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2405
2405
  }
2406
2406
  break;
2407
2407
  }
2408
- case MOBILE_PUSH: {
2409
- const mpushData = get(template, 'versions.base', template);
2410
- const androidData = get(mpushData, 'ANDROID') || get(mpushData, 'androidContent');
2411
- const iosData = get(mpushData, 'IOS') || get(mpushData, 'iosContent');
2412
- let mpushListingData = androidData;
2413
- if (isEmpty(androidData) || !androidData?.title) {
2414
- mpushListingData = iosData;
2415
- };
2416
- const { title, message, expandableDetails: { style = '', image, carouselData = [], ctas = [], media = [] } = {} } = mpushListingData || {};
2417
- const {url = ''} = media?.[0] || {};
2418
- templateData.content = (
2419
- <div className='mobilepush-container'>
2420
- <div className="app-header">
2421
- <div className="app-header-left">
2422
- <span className="app-icon">{""}</span>
2423
- <CapLabel type="label4">{title}</CapLabel>
2424
- </div>
2425
- </div>
2426
- <CapLabel className="mobilepush-message" type="label1">{message}</CapLabel>
2427
- {style === BIG_PICTURE && (
2428
- <CapImage src={image} className="mobilepush-image mobilepush-image-padding" />
2429
- )}
2430
- {style === VIDEO && (
2431
- <div className="video-preview">
2432
- <video aria-label="Template video preview" controls={false} tabIndex="0">
2433
- <source src={url} type="video/mp4" />
2434
- </video>
2435
- <div className="icon-position">
2436
- <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>
2437
2427
  </div>
2438
2428
  </div>
2439
- )}
2440
- {[MANUAL_CAROUSEL, AUTO_CAROUSEL, FILMSTRIP_CAROUSEL].includes(style) && (
2441
- <div className="scroll-container">
2442
- {carouselData?.map((data, index) => {
2443
- return (
2444
- <div
2445
- key={`carousel-${index + 1}`}
2446
- className="whatsapp-carousel-container"
2447
- role="group"
2448
- >
2449
- <div className="whatsapp-carousel-card">
2450
- {data?.mediaType === IMAGE.toLowerCase() && (
2451
- <CapImage
2452
- src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
2453
- className="whatsapp-image"
2454
- />
2455
- )}
2456
- {data?.mediaType === VIDEO.toLowerCase() && (
2457
- <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() && (
2458
2454
  <CapImage
2459
- src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
2455
+ src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
2460
2456
  className="whatsapp-image"
2461
2457
  />
2462
- <div className="icon-position">
2458
+ )}
2459
+ {data?.mediaType === VIDEO.toLowerCase() && (
2460
+ <div className="video-preview">
2463
2461
  <CapImage
2464
- className="video-icon"
2465
- src={videoPlay}
2462
+ src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
2463
+ className="whatsapp-image"
2466
2464
  />
2465
+ <div className="icon-position">
2466
+ <CapImage
2467
+ className="video-icon"
2468
+ src={videoPlay}
2469
+ />
2470
+ </div>
2467
2471
  </div>
2468
- </div>
2469
- )}
2470
- </div>
2471
- </div>
2472
- )
2473
- })}
2474
- </div>
2475
- )}
2476
- {ctas.length > 0 && (
2477
- <div className="actions">
2478
- {ctas.map((cta, index) => (
2479
- <span
2480
- className="action"
2481
- key={`action-${index}`}
2482
- >
2483
- {cta?.actionText}
2484
- </span>
2485
- ))}
2472
+ )}
2473
+ </div>
2474
+ </div>
2475
+ )
2476
+ })}
2486
2477
  </div>
2487
- )}
2488
- </div>
2489
- );
2490
- 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
+ }
2491
2495
  break;
2492
- }
2493
2496
  case INAPP: {
2494
2497
  // Pass the full template object to CapCustomCard so getInAppContent can extract the data
2495
2498
  // Similar to how MOBILE_PUSH passes the full template when new feature is enabled
@@ -5353,6 +5356,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
5353
5356
  Templates.propTypes = {
5354
5357
  actions: PropTypes.object.isRequired,
5355
5358
  smsActions: PropTypes.object,
5359
+ mobilepushActions: PropTypes.object,
5356
5360
  mobilePushNewActions: PropTypes.object,
5357
5361
  smsEditActions: PropTypes.object,
5358
5362
  ebillActions: PropTypes.object,
@@ -5396,6 +5400,7 @@ const mapStateToProps = createStructuredSelector({
5396
5400
  Templates: makeSelectTemplates(),
5397
5401
  TemplatesList: makeSelectTemplatesResponse(),
5398
5402
  Create: makeSelectCreateSms(),
5403
+ CreateMobilePush: makeSelectCreateMobilePush(),
5399
5404
  MobilePushNew: makeSelectMobilePushNew(),
5400
5405
  CreateEbill: makeSelectCreateEbill(),
5401
5406
  Edit: makeSelectEdit(),
@@ -5413,6 +5418,7 @@ function mapDispatchToProps(dispatch) {
5413
5418
  return {
5414
5419
  actions: bindActionCreators(actions, dispatch),
5415
5420
  smsActions: bindActionCreators(smsActions, dispatch),
5421
+ mobilepushActions: bindActionCreators(mobilepushActions, dispatch),
5416
5422
  mobilePushNewActions: bindActionCreators(mobilePushNewActions, dispatch),
5417
5423
  inAppActions: bindActionCreators(inAppActions, dispatch),
5418
5424
  smsEditActions: bindActionCreators(smsEditActions, dispatch),