@capillarytech/creatives-library 8.0.134-alpha.0 → 8.0.135
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/index.js +0 -8
- package/package.json +1 -1
- package/services/api.js +0 -5
- package/utils/createMobilePushPayload.js +42 -39
- package/utils/tests/createMobilePushPayload.test.js +273 -3
- package/utils/transformerUtils.js +11 -12
- package/utils/vendorDataTransformers.js +1 -1
- package/v2Components/CapMpushCTA/index.js +0 -11
- package/v2Components/CapVideoUpload/index.js +4 -2
- package/v2Components/TestAndPreviewSlidebox/index.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -0
- package/v2Containers/CreativesContainer/index.js +4 -5
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +7 -7
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +1 -3
- package/v2Containers/MobilePushNew/index.js +533 -56
- package/v2Containers/MobilePushNew/messages.js +1 -1
- package/v2Containers/Whatsapp/index.js +22 -12
- package/assets/loading_img.gif +0 -0
- package/utils/transformTemplateConfig.js +0 -250
- package/utils/whatsappMediaUtils.js +0 -44
- package/v2Containers/Email/tests/index.test.js +0 -35
|
@@ -81,7 +81,7 @@ const SlideBoxWrapper = styled.div`
|
|
|
81
81
|
export class Creatives extends React.Component {
|
|
82
82
|
constructor(props) {
|
|
83
83
|
super(props);
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
const initialSlidBoxContent = this.getSlideBoxContent({ mode: props.creativesMode, templateData: props.templateData, isFullMode: props.isFullMode });
|
|
86
86
|
|
|
87
87
|
this.state = {
|
|
@@ -802,7 +802,7 @@ export class Creatives extends React.Component {
|
|
|
802
802
|
androidContent.expandableDetails = this.getMobilePushCarouselData({...androidContent?.expandableDetails});
|
|
803
803
|
}
|
|
804
804
|
templateData.androidContent = androidContent;
|
|
805
|
-
templateData.androidContent.type = get(channelTemplate, 'definition.mode', '')
|
|
805
|
+
templateData.androidContent.type = androidContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || constants.TEXT;
|
|
806
806
|
templateData.androidContent.deviceType = constants.ANDROID;
|
|
807
807
|
}
|
|
808
808
|
const iosContent = channel === constants.INAPP ? get(channelTemplate, 'versions.base.content.IOS') : get(channelTemplate, 'versions.base.IOS');
|
|
@@ -824,7 +824,7 @@ export class Creatives extends React.Component {
|
|
|
824
824
|
iosContent.expandableDetails = this.getMobilePushCarouselData({...iosContent?.expandableDetails});
|
|
825
825
|
}
|
|
826
826
|
templateData.iosContent = iosContent;
|
|
827
|
-
templateData.iosContent.type = get(channelTemplate, 'definition.mode')
|
|
827
|
+
templateData.iosContent.type = iosContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || 'TEXT';
|
|
828
828
|
templateData.iosContent.deviceType = constants.IOS;
|
|
829
829
|
}
|
|
830
830
|
templateData.messageSubject = channelTemplate?.name ? channelTemplate?.name : "messageSubject";
|
|
@@ -954,7 +954,6 @@ export class Creatives extends React.Component {
|
|
|
954
954
|
default:
|
|
955
955
|
break;
|
|
956
956
|
}
|
|
957
|
-
|
|
958
957
|
templateData = {
|
|
959
958
|
channel,
|
|
960
959
|
accountId,
|
|
@@ -962,7 +961,7 @@ export class Creatives extends React.Component {
|
|
|
962
961
|
accountName: accountDetails?.name || '',
|
|
963
962
|
messageBody: languages[0].content,
|
|
964
963
|
templateConfigs: {
|
|
965
|
-
id: template?.
|
|
964
|
+
id: template?.value?.name,
|
|
966
965
|
name: template?.value?.name,
|
|
967
966
|
template: templateEditor,
|
|
968
967
|
varMapped,
|
|
@@ -549,7 +549,7 @@ const MediaUploaders = ({
|
|
|
549
549
|
<FormattedMessage {...messages.actionDescription} />
|
|
550
550
|
</CapLabel>
|
|
551
551
|
</CapRow>
|
|
552
|
-
{button
|
|
552
|
+
{button?.actionOnClick && (
|
|
553
553
|
<CapRow style={{ display: "flex", justifyContent: "space-around" }}>
|
|
554
554
|
<CapColumn span={6}>
|
|
555
555
|
<CapHeading type="h4" className="buttons-heading">
|
|
@@ -563,7 +563,7 @@ const MediaUploaders = ({
|
|
|
563
563
|
selectPlaceholder={formatMessage(messages.selectDeepLink)}
|
|
564
564
|
/>
|
|
565
565
|
</CapColumn>
|
|
566
|
-
{button
|
|
566
|
+
{button?.linkType === DEEP_LINK && (
|
|
567
567
|
<CapColumn span={14}>
|
|
568
568
|
<CapHeading type="h4" className="buttons-heading">
|
|
569
569
|
{formatMessage(messages.deepLink)}
|
|
@@ -583,7 +583,7 @@ const MediaUploaders = ({
|
|
|
583
583
|
)}
|
|
584
584
|
</CapColumn>
|
|
585
585
|
)}
|
|
586
|
-
{button
|
|
586
|
+
{button?.linkType === EXTERNAL_LINK && (
|
|
587
587
|
<CapColumn span={14}>
|
|
588
588
|
<CapHeading type="h4" className="buttons-heading">
|
|
589
589
|
{formatMessage(messages.externalLink)}
|
|
@@ -592,7 +592,7 @@ const MediaUploaders = ({
|
|
|
592
592
|
id={`mobile-push-external-link-input-${activeTab}-${cardIndex}`}
|
|
593
593
|
onChange={(e) => handleCarouselExternalLinkChange(cardIndex, e.target.value)}
|
|
594
594
|
placeholder={formatMessage(messages.enterExternalLink)}
|
|
595
|
-
value={button
|
|
595
|
+
value={button?.externalLinkValue}
|
|
596
596
|
size="default"
|
|
597
597
|
isRequired
|
|
598
598
|
/>
|
|
@@ -605,8 +605,8 @@ const MediaUploaders = ({
|
|
|
605
605
|
)}
|
|
606
606
|
</CapRow>
|
|
607
607
|
)}
|
|
608
|
-
{button
|
|
609
|
-
const selectedDeepLink = deepLink?.find((link) => link?.value === button
|
|
608
|
+
{button?.linkType === DEEP_LINK && button?.deepLinkValue && button?.actionOnClick && (() => {
|
|
609
|
+
const selectedDeepLink = deepLink?.find((link) => link?.value === button?.deepLinkValue);
|
|
610
610
|
const deepLinkKeysFromSelection = selectedDeepLink?.keys;
|
|
611
611
|
let deepLinkKeysFromSelectionArray = [];
|
|
612
612
|
if (Array.isArray(deepLinkKeysFromSelection)) {
|
|
@@ -617,7 +617,7 @@ const MediaUploaders = ({
|
|
|
617
617
|
return deepLinkKeysFromSelectionArray?.length > 0;
|
|
618
618
|
})() && (
|
|
619
619
|
<CapRow style={{ marginTop: "10px", left: "6%", width: '115%'}}>
|
|
620
|
-
<CapColumn span={
|
|
620
|
+
<CapColumn span={14}>
|
|
621
621
|
<CapHeading type="h4" className="deep-link-keys-heading">
|
|
622
622
|
{formatMessage(messages.deepLinkKeys)}
|
|
623
623
|
</CapHeading>
|
|
@@ -58,8 +58,6 @@ const PlatformContentFields = ({
|
|
|
58
58
|
externalLinkValue,
|
|
59
59
|
} = linkProps;
|
|
60
60
|
|
|
61
|
-
// Debug logging removed - issue identified and fixed
|
|
62
|
-
|
|
63
61
|
// Get the selected deep link object to extract keys
|
|
64
62
|
const selectedDeepLink = deepLink?.find((link) => link?.value === deepLinkValue);
|
|
65
63
|
const deepLinkKeysFromSelection = selectedDeepLink?.keys;
|
|
@@ -289,7 +287,7 @@ const PlatformContentFields = ({
|
|
|
289
287
|
)}
|
|
290
288
|
{content?.actionOnClick && content?.linkType === DEEP_LINK && deepLinkValue && deepLinkKeysFromSelectionArray?.length > 0 && (
|
|
291
289
|
<CapRow style={{ marginTop: "10px", left: "6%", width: '115%'}}>
|
|
292
|
-
<CapColumn span={
|
|
290
|
+
<CapColumn span={14}>
|
|
293
291
|
<CapHeading type="h4" className="deep-link-keys-heading">
|
|
294
292
|
{formatMessage(messages.deepLinkKeys)}
|
|
295
293
|
</CapHeading>
|