@capillarytech/creatives-library 9.2.2-alpha.sprint-cap-214249.44 → 9.2.2
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.
- package/constants/unified.js +1 -3
- package/package.json +1 -1
- package/translations/en.json +0 -1
- package/translations/ja-JP.json +0 -1
- package/translations/zh.json +0 -1
- package/utils/common.js +6 -0
- package/utils/createMobilePushPayload.js +56 -50
- package/utils/tagValidations.js +4 -35
- package/utils/tests/createMobilePushPayload.test.js +168 -177
- package/utils/tests/tagValidations.test.js +0 -48
- package/v2Components/CapMpushCTA/index.js +57 -47
- package/v2Components/CapMpushCTA/index.scss +5 -43
- package/v2Components/CapTagList/index.js +7 -46
- package/v2Components/CapTagList/messages.js +0 -44
- package/v2Components/CapTagList/style.scss +1 -113
- package/v2Components/CommonTestAndPreview/UnifiedPreview/MobilePushPreviewContent.js +8 -11
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +1 -13
- package/v2Components/CommonTestAndPreview/constants.js +0 -2
- package/v2Components/CommonTestAndPreview/index.js +12 -51
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/MobilePushPreviewContent.test.js +5 -83
- package/v2Components/CommonTestAndPreview/tests/index.test.js +0 -100
- package/v2Components/FormBuilder/Classic.js +14 -24
- package/v2Components/FormBuilder/Functional/channels/mobilepush/config.js +0 -1
- package/v2Components/FormBuilder/Functional/channels/mobilepush/getEditorErrorDescriptor.js +1 -1
- package/v2Components/FormBuilder/Functional/channels/mobilepush/tests/validate.test.js +0 -57
- package/v2Components/FormBuilder/Functional/channels/mobilepush/validate.js +4 -4
- package/v2Components/FormBuilder/Functional/channels/sms/getEditorErrorDescriptor.js +0 -3
- package/v2Components/FormBuilder/Functional/channels/sms/tests/getEditorErrorDescriptor.test.js +0 -5
- package/v2Components/FormBuilder/Functional/channels/sms/tests/validate.test.js +0 -6
- package/v2Components/FormBuilder/Functional/channels/sms/validate.js +1 -3
- package/v2Components/FormBuilder/Functional/renderers/mpushRenderers.js +0 -3
- package/v2Components/FormBuilder/Functional/tests/mpushRenderers.test.js +0 -22
- package/v2Components/MobilePushPreviewV2/index.js +9 -22
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -18
- package/v2Components/TemplatePreview/index.js +18 -20
- package/v2Components/TemplatePreview/tests/index.test.js +0 -69
- package/v2Containers/Cap/messages.js +0 -4
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/extractContentForPreview.js +2 -12
- package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -4
- package/v2Containers/CreativesContainer/index.js +1 -2
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +0 -43
- package/v2Containers/InApp/index.js +1 -4
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/Text/index.js +1 -3
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -16
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -18
- package/v2Containers/MobilePushNew/components/CtaButtons.js +47 -52
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +345 -105
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +105 -127
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +208 -30
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +1484 -307
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +59 -165
- package/v2Containers/MobilePushNew/constants.js +0 -12
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +1 -63
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -78
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +1 -40
- package/v2Containers/MobilePushNew/hooks/useUpload.js +46 -42
- package/v2Containers/MobilePushNew/index.js +290 -502
- package/v2Containers/MobilePushNew/index.scss +4 -151
- package/v2Containers/MobilePushNew/messages.js +6 -106
- package/v2Containers/MobilePushNew/tests/index.test.js +1 -483
- package/v2Containers/MobilePushNew/tests/utils.test.js +0 -110
- package/v2Containers/MobilePushNew/utils.js +0 -83
- package/v2Containers/Rcs/index.js +1 -8
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -59
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +0 -4
- package/v2Containers/SmsTrai/Edit/index.js +5 -13
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -15
- package/v2Containers/Templates/_templates.scss +2 -10
- package/v2Containers/Templates/index.js +81 -86
- package/v2Containers/Templates/tests/index.test.js +0 -81
- package/v2Containers/Viber/index.js +1 -3
- package/v2Containers/WebPush/Create/utils/validation.js +0 -6
- package/v2Containers/WebPush/Create/utils/validation.test.js +0 -50
- package/v2Containers/Whatsapp/index.js +5 -9
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +2 -2
- package/v2Containers/Zalo/index.js +1 -4
- package/v2Components/CapMpushCTA/tests/index.test.js +0 -150
- package/v2Components/CapTagList/TagFallbackPanel.js +0 -124
- package/v2Components/CapTagList/constants.js +0 -5
- package/v2Components/CapTagList/tests/TagFallback.test.js +0 -222
- package/v2Components/CapTagList/utils.js +0 -17
- package/v2Components/MobilePushPreviewV2/_mobilePushPreviewV2.scss +0 -7
- package/v2Components/MobilePushPreviewV2/tests/index.test.js +0 -55
- package/v2Components/TemplatePreview/_mobilePushPhone.scss +0 -72
- package/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/Tests/extractContentForPreview.test.js +0 -45
- package/v2Containers/MobilePushNew/components/TapLinkActions.js +0 -76
|
@@ -366,7 +366,6 @@ exports[`Creatives SmsTraiCreate test/> done button should be disabled if blank
|
|
|
366
366
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
367
367
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
368
368
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
369
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
370
369
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
371
370
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
372
371
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -3528,7 +3527,6 @@ exports[`Creatives SmsTraiCreate test/> invalid file drop 1`] = `
|
|
|
3528
3527
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
3529
3528
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
3530
3529
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
3531
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
3532
3530
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
3533
3531
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
3534
3532
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -6673,7 +6671,6 @@ exports[`Creatives SmsTraiCreate test/> renders UI 1`] = `
|
|
|
6673
6671
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
6674
6672
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
6675
6673
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
6676
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
6677
6674
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
6678
6675
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
6679
6676
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -9835,7 +9832,6 @@ exports[`Creatives SmsTraiCreate test/> valid file drop 1`] = `
|
|
|
9835
9832
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
9836
9833
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
9837
9834
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
9838
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
9839
9835
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
9840
9836
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
9841
9837
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -579,9 +579,8 @@ export const SmsTraiEdit = (props) => {
|
|
|
579
579
|
tagModule: getDefaultTags,
|
|
580
580
|
isFullMode: true,
|
|
581
581
|
}) || {};
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
// Plain (non-VarSegment) fallback textarea: only unbalanced `{{…}}` or unquoted default disables Done.
|
|
582
|
+
const braceErr = !!tagValidationResponseRef.current.isBraceError;
|
|
583
|
+
// Plain (non-VarSegment) fallback textarea: only unbalanced `{{…}}` disables Done.
|
|
585
584
|
updateIsTagValidationError(braceErr);
|
|
586
585
|
return;
|
|
587
586
|
}
|
|
@@ -592,8 +591,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
592
591
|
) {
|
|
593
592
|
tagValidationResponseRef.current = runValidateTags(updatedSmsEditor.join(''));
|
|
594
593
|
const missing = (tagValidationResponseRef.current.missingTags || []).length > 0;
|
|
595
|
-
const
|
|
596
|
-
const braceErr = !!(isBraceError || isDefaultQuoteError);
|
|
594
|
+
const braceErr = !!tagValidationResponseRef.current.isBraceError;
|
|
597
595
|
updateIsTagValidationError(missing || braceErr);
|
|
598
596
|
} else if (!isRcsSmsFallback) {
|
|
599
597
|
tagValidationResponseRef.current = {};
|
|
@@ -667,9 +665,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
667
665
|
if (syncValidation?.isBraceError) {
|
|
668
666
|
standardErrors.push(formatMessage(globalMessages.unbalanacedCurlyBraces));
|
|
669
667
|
}
|
|
670
|
-
if (syncValidation?.isDefaultQuoteError) {
|
|
671
|
-
standardErrors.push(formatMessage(globalMessages.unquotedTagDefaultValue));
|
|
672
|
-
}
|
|
673
668
|
if (syncValidation?.missingTags?.length) {
|
|
674
669
|
standardErrors.push(
|
|
675
670
|
formatMessage(formBuilderMessages.missingTagsValidationError, {
|
|
@@ -718,7 +713,7 @@ export const SmsTraiEdit = (props) => {
|
|
|
718
713
|
if (isTagValidationError) {
|
|
719
714
|
if (!isRcsSmsFallback) return;
|
|
720
715
|
const tagValidationSnapshot = tagValidationResponseRef.current ?? {};
|
|
721
|
-
if (tagValidationSnapshot.isBraceError
|
|
716
|
+
if (tagValidationSnapshot.isBraceError) return;
|
|
722
717
|
}
|
|
723
718
|
const editorJoined = Array.isArray(updatedSmsEditor)
|
|
724
719
|
? updatedSmsEditor.join('')
|
|
@@ -1043,16 +1038,13 @@ export const SmsTraiEdit = (props) => {
|
|
|
1043
1038
|
};
|
|
1044
1039
|
|
|
1045
1040
|
const tagValidationErrorMessage = () => {
|
|
1046
|
-
const { missingTags = [], unsupportedTags = [], isBraceError
|
|
1041
|
+
const { missingTags = [], unsupportedTags = [], isBraceError } = tagValidationResponseRef.current || {};
|
|
1047
1042
|
const listForMessage = (unsupportedTags && unsupportedTags.length > 0)
|
|
1048
1043
|
? unsupportedTags
|
|
1049
1044
|
: missingTags;
|
|
1050
1045
|
if (isBraceError) {
|
|
1051
1046
|
return <CapError>{formatMessage(globalMessages.unbalanacedCurlyBraces)}</CapError>;
|
|
1052
1047
|
}
|
|
1053
|
-
if (isDefaultQuoteError) {
|
|
1054
|
-
return <CapError>{formatMessage(globalMessages.unquotedTagDefaultValue)}</CapError>;
|
|
1055
|
-
}
|
|
1056
1048
|
if (listForMessage.length > 0) {
|
|
1057
1049
|
return (
|
|
1058
1050
|
<CapError>
|
|
@@ -341,7 +341,6 @@ 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",
|
|
345
344
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
346
345
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
347
346
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -3824,7 +3823,6 @@ FREE GIFTS-
|
|
|
3824
3823
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
3825
3824
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
3826
3825
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
3827
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
3828
3826
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
3829
3827
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
3830
3828
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -6074,7 +6072,6 @@ new message content.",
|
|
|
6074
6072
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
6075
6073
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
6076
6074
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
6077
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
6078
6075
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
6079
6076
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
6080
6077
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -13184,7 +13181,6 @@ FREE GIFTS-
|
|
|
13184
13181
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
13185
13182
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
13186
13183
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
13187
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
13188
13184
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
13189
13185
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
13190
13186
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -15527,7 +15523,6 @@ FREE GIFTS-
|
|
|
15527
15523
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
15528
15524
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
15529
15525
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
15530
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
15531
15526
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
15532
15527
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
15533
15528
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -18019,7 +18014,6 @@ exports[`Creatives SmsTraiEdit test/> should render 2`] = `
|
|
|
18019
18014
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
18020
18015
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
18021
18016
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
18022
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
18023
18017
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
18024
18018
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
18025
18019
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -21994,7 +21988,6 @@ FREE GIFTS-
|
|
|
21994
21988
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
21995
21989
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
21996
21990
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
21997
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
21998
21991
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
21999
21992
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
22000
21993
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -24244,7 +24237,6 @@ new message content.",
|
|
|
24244
24237
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
24245
24238
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
24246
24239
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
24247
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
24248
24240
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
24249
24241
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
24250
24242
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -32326,7 +32318,6 @@ FREE GIFTS-
|
|
|
32326
32318
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
32327
32319
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
32328
32320
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
32329
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
32330
32321
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
32331
32322
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
32332
32323
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -34669,7 +34660,6 @@ FREE GIFTS-
|
|
|
34669
34660
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
34670
34661
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
34671
34662
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
34672
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
34673
34663
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
34674
34664
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
34675
34665
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -37161,7 +37151,6 @@ exports[`Creatives SmsTraiEdit test/> should save 1`] = `
|
|
|
37161
37151
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
37162
37152
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
37163
37153
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
37164
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
37165
37154
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
37166
37155
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
37167
37156
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -40644,7 +40633,6 @@ FREE GIFTS-
|
|
|
40644
40633
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
40645
40634
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
40646
40635
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
40647
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
40648
40636
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
40649
40637
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
40650
40638
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -42894,7 +42882,6 @@ new message content.",
|
|
|
42894
42882
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
42895
42883
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
42896
42884
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
42897
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
42898
42885
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
42899
42886
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
42900
42887
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -50004,7 +49991,6 @@ FREE GIFTS-
|
|
|
50004
49991
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
50005
49992
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
50006
49993
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
50007
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
50008
49994
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
50009
49995
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
50010
49996
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -52347,7 +52333,6 @@ FREE GIFTS-
|
|
|
52347
52333
|
"creatives.componentsV2.TopBar.profile": "Profile",
|
|
52348
52334
|
"creatives.componentsV2.TopBar.settings": "Settings",
|
|
52349
52335
|
"creatives.componentsV2.unbalanacedCurlyBraces": "Invalid label, please close all curly braces",
|
|
52350
|
-
"creatives.componentsV2.unquotedTagDefaultValue": "Invalid label, default value must be within quotes",
|
|
52351
52336
|
"creatives.componentsv2.MobilePushPreviewV2.header": "This is the MobilePushPreviewV2 component !",
|
|
52352
52337
|
"creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
|
|
52353
52338
|
"creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -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:
|
|
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
|
|
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,21 +1426,14 @@ 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:
|
|
1434
|
+
bodyVideo: expandableDetailsAndroid.media?.[0] || {},
|
|
1440
1435
|
bodyGif: '',
|
|
1441
1436
|
actions: expandableDetailsAndroid.ctas || [],
|
|
1442
|
-
// Notification tap, read by the test send
|
|
1443
|
-
cta: androidContent.cta,
|
|
1444
1437
|
carouselData: expandableDetailsAndroid.carouselData || [],
|
|
1445
1438
|
};
|
|
1446
1439
|
|
|
@@ -1449,10 +1442,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1449
1442
|
header: iosContent.title || '',
|
|
1450
1443
|
bodyText: iosContent.message || '',
|
|
1451
1444
|
bodyImage: expandableDetailsIos.image || '',
|
|
1452
|
-
bodyVideo:
|
|
1445
|
+
bodyVideo: expandableDetailsIos.media?.[0] || {},
|
|
1453
1446
|
bodyGif: '',
|
|
1454
1447
|
actions: expandableDetailsIos.ctas || [],
|
|
1455
|
-
cta: iosContent.cta,
|
|
1456
1448
|
carouselData: expandableDetailsIos.carouselData || [],
|
|
1457
1449
|
};
|
|
1458
1450
|
|
|
@@ -2413,91 +2405,94 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2413
2405
|
}
|
|
2414
2406
|
break;
|
|
2415
2407
|
}
|
|
2416
|
-
case MOBILE_PUSH:
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
{style === BIG_PICTURE && (
|
|
2436
|
-
<CapImage src={image} className="mobilepush-image mobilepush-image-padding" />
|
|
2437
|
-
)}
|
|
2438
|
-
{style === VIDEO && (
|
|
2439
|
-
<div className="video-preview">
|
|
2440
|
-
<video aria-label="Template video preview" controls={false} tabIndex="0">
|
|
2441
|
-
<source src={url} type="video/mp4" />
|
|
2442
|
-
</video>
|
|
2443
|
-
<div className="icon-position">
|
|
2444
|
-
<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>
|
|
2445
2427
|
</div>
|
|
2446
2428
|
</div>
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
>
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
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() && (
|
|
2466
2454
|
<CapImage
|
|
2467
|
-
src={data?.
|
|
2455
|
+
src={data?.imageUrl ? data?.imageUrl : data?.url ? data?.url : whatsappImageEmptyPreview}
|
|
2468
2456
|
className="whatsapp-image"
|
|
2469
2457
|
/>
|
|
2470
|
-
|
|
2458
|
+
)}
|
|
2459
|
+
{data?.mediaType === VIDEO.toLowerCase() && (
|
|
2460
|
+
<div className="video-preview">
|
|
2471
2461
|
<CapImage
|
|
2472
|
-
|
|
2473
|
-
|
|
2462
|
+
src={data?.videoPreviewImg ? data?.videoPreviewImg : data?.url ? data?.url : whatsappVideoEmptyPreview}
|
|
2463
|
+
className="whatsapp-image"
|
|
2474
2464
|
/>
|
|
2465
|
+
<div className="icon-position">
|
|
2466
|
+
<CapImage
|
|
2467
|
+
className="video-icon"
|
|
2468
|
+
src={videoPlay}
|
|
2469
|
+
/>
|
|
2470
|
+
</div>
|
|
2475
2471
|
</div>
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
)
|
|
2481
|
-
|
|
2472
|
+
)}
|
|
2473
|
+
</div>
|
|
2474
|
+
</div>
|
|
2475
|
+
)
|
|
2476
|
+
})}
|
|
2477
|
+
</div>
|
|
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
|
+
)}
|
|
2482
2491
|
</div>
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
{ctas.map((cta, index) => (
|
|
2487
|
-
<CapLabel.CapLabelInline
|
|
2488
|
-
className="action"
|
|
2489
|
-
key={`action-${index}`}
|
|
2490
|
-
>
|
|
2491
|
-
{cta?.actionText}
|
|
2492
|
-
</CapLabel.CapLabelInline>
|
|
2493
|
-
))}
|
|
2494
|
-
</CapRow>
|
|
2495
|
-
)}
|
|
2496
|
-
</div>
|
|
2497
|
-
);
|
|
2498
|
-
templateData.isNewMobilePush = true;
|
|
2492
|
+
);
|
|
2493
|
+
templateData.isNewMobilePush = commonUtil.hasNewMobilePushFeatureEnabled();
|
|
2494
|
+
}
|
|
2499
2495
|
break;
|
|
2500
|
-
}
|
|
2501
2496
|
case INAPP: {
|
|
2502
2497
|
// Pass the full template object to CapCustomCard so getInAppContent can extract the data
|
|
2503
2498
|
// Similar to how MOBILE_PUSH passes the full template when new feature is enabled
|
|
@@ -498,85 +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
|
-
it('passes each saved notification tap (cta) for the test send', () => {
|
|
570
|
-
RenderFunctionFor('whatsapp', true);
|
|
571
|
-
const androidCta = { type: 'DEEP_LINK', actionLink: 'app://home' };
|
|
572
|
-
const iosCta = { type: 'EXTERNAL_URL', actionLink: 'https://x.com' };
|
|
573
|
-
|
|
574
|
-
const result = renderedComponent.instance().extractTemplateContentForPreview({
|
|
575
|
-
versions: { base: { ANDROID: { title: 'A', cta: androidCta }, IOS: { title: 'I', cta: iosCta } } },
|
|
576
|
-
}, 'MOBILEPUSH');
|
|
577
|
-
|
|
578
|
-
expect(result.androidContent.cta).toEqual(androidCta);
|
|
579
|
-
expect(result.iosContent.cta).toEqual(iosCta);
|
|
580
|
-
});
|
|
581
|
-
});
|
|
582
501
|
});
|
|
@@ -347,7 +347,7 @@ export const Viber = (props) => {
|
|
|
347
347
|
// validation on Text area and tags validation
|
|
348
348
|
const updateTextContentError = (value) => {
|
|
349
349
|
let errorMessage = false;
|
|
350
|
-
const { valid, isBraceError
|
|
350
|
+
const { valid, isBraceError } = validateTags({
|
|
351
351
|
content: value,
|
|
352
352
|
tagsParam: tags,
|
|
353
353
|
location,
|
|
@@ -360,8 +360,6 @@ export const Viber = (props) => {
|
|
|
360
360
|
errorMessage = formatMessage(messages.limitExceededContentErrorMessage);
|
|
361
361
|
} else if (isBraceError) {
|
|
362
362
|
errorMessage = formatMessage(globalMessages.unbalanacedCurlyBraces);
|
|
363
|
-
} else if (isDefaultQuoteError) {
|
|
364
|
-
errorMessage = formatMessage(globalMessages.unquotedTagDefaultValue);
|
|
365
363
|
} else if (!valid) {
|
|
366
364
|
errorMessage = formatMessage(messages.invalidTagError);
|
|
367
365
|
}
|
|
@@ -37,9 +37,6 @@ export const validateTitle = (value, formatMessage, messages, restrictPersonaliz
|
|
|
37
37
|
if (validationResponse?.isBraceError) {
|
|
38
38
|
return formatMessage(globalMessages.unbalanacedCurlyBraces);
|
|
39
39
|
}
|
|
40
|
-
if (validationResponse?.isDefaultQuoteError) {
|
|
41
|
-
return formatMessage(globalMessages.unquotedTagDefaultValue);
|
|
42
|
-
}
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
return '';
|
|
@@ -86,9 +83,6 @@ export const validateMessageContent = (value, formatMessage, messages, validatio
|
|
|
86
83
|
if (validationResponse?.isBraceError) {
|
|
87
84
|
return formatMessage(globalMessages.unbalanacedCurlyBraces);
|
|
88
85
|
}
|
|
89
|
-
if (validationResponse?.isDefaultQuoteError) {
|
|
90
|
-
return formatMessage(globalMessages.unquotedTagDefaultValue);
|
|
91
|
-
}
|
|
92
86
|
|
|
93
87
|
if (restrictPersonalization && hasPersonalizationTags(value)) {
|
|
94
88
|
return formatMessage(messages.personalizationTokensErrorMessage);
|