@capillarytech/creatives-library 7.10.47 → 7.10.49
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/package.json +1 -1
- package/v2Components/TemplatePreview/index.js +38 -27
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -0
- package/v2Containers/CreativesContainer/index.js +4 -3
- package/v2Containers/TemplatesV2/index.js +4 -0
- package/v2Containers/Whatsapp/index.js +1 -0
package/package.json
CHANGED
|
@@ -137,7 +137,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
137
137
|
|
|
138
138
|
render() {
|
|
139
139
|
let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
|
|
140
|
-
const { channel, showTestAndPreviewIcon, module, viberBrandName, viberAccountName, whatsappAccountName, intl, templateData } = this.props;
|
|
140
|
+
const { channel, showTestAndPreviewIcon, module, viberBrandName, viberAccountName, whatsappAccountName, whatsappContentLen = 0, intl, templateData } = this.props;
|
|
141
141
|
const { formatMessage } = intl;
|
|
142
142
|
const { buttonText, imageURL, messageContent: viberMessageContent } = content || {};
|
|
143
143
|
let smsDetails = {};
|
|
@@ -663,35 +663,46 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
663
663
|
) : ''
|
|
664
664
|
}
|
|
665
665
|
{channel && channel?.toUpperCase() === WHATSAPP ? (
|
|
666
|
-
|
|
667
|
-
<
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
maxHeight: 292,
|
|
677
|
-
marginLeft: 28,
|
|
678
|
-
}}
|
|
679
|
-
>
|
|
666
|
+
<>
|
|
667
|
+
<div className="shell-v2 align-center" id="sms-preview">
|
|
668
|
+
<CapImage
|
|
669
|
+
className="preview-image"
|
|
670
|
+
src={whatsappMobileAndroid}
|
|
671
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
672
|
+
/>
|
|
673
|
+
<div className="whatsapp-brand-name">
|
|
674
|
+
{whatsappAccountName || ''}
|
|
675
|
+
</div>
|
|
680
676
|
<div
|
|
681
|
-
className="
|
|
682
|
-
style={
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
677
|
+
className="msgContainer"
|
|
678
|
+
style={{
|
|
679
|
+
maxHeight: 292,
|
|
680
|
+
marginLeft: 28,
|
|
681
|
+
}}
|
|
682
|
+
>
|
|
683
|
+
<div
|
|
684
|
+
className="message-pop align-left"
|
|
685
|
+
style={whatsappSectionStyle}
|
|
686
|
+
>
|
|
687
|
+
<p
|
|
688
|
+
style={{
|
|
689
|
+
color: CAP_G16,
|
|
690
|
+
margin: '1.5px 6px 1px 7px',
|
|
691
|
+
}}
|
|
692
|
+
>
|
|
693
|
+
{content?.templateMsg || ''}
|
|
694
|
+
</p>
|
|
695
|
+
<div style={{ paddingBottom: CAP_SPACE_08 }}></div>
|
|
696
|
+
</div>
|
|
690
697
|
</div>
|
|
691
698
|
</div>
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
699
|
+
<CapHeading type="h3" style={{ margin: '24px 0px 0px 36px' }}>
|
|
700
|
+
<FormattedMessage {...messages.whatsappMessageLength} values={{ length: 36 + whatsappContentLen }} />
|
|
701
|
+
</CapHeading>
|
|
702
|
+
</>
|
|
703
|
+
) : (
|
|
704
|
+
''
|
|
705
|
+
)}
|
|
695
706
|
{channel && channel.toLowerCase() === FACEBOOK && (
|
|
696
707
|
<div style={{position: 'absolute', left: '80%'}} id="facebook-preview">
|
|
697
708
|
<CapFacebookPreview
|
|
@@ -34,6 +34,10 @@ export default defineMessages({
|
|
|
34
34
|
id: 'app.components.TemplatePreview.whatsappUnsubscribeLength',
|
|
35
35
|
defaultMessage: "Includes 36 characters of (Click {{unsubscribe}} to unsubscribe)",
|
|
36
36
|
},
|
|
37
|
+
whatsappMessageLength: {
|
|
38
|
+
id: 'app.components.TemplatePreview.whatsappMessageLength',
|
|
39
|
+
defaultMessage: "1 Message ({length} characters)",
|
|
40
|
+
},
|
|
37
41
|
smsFormatType: {
|
|
38
42
|
id: 'creatives.componentsV2.TemplatePreview.smsFormatType',
|
|
39
43
|
defaultMessage: 'Message has unicode characters',
|
|
@@ -145,6 +145,7 @@ function SlideBoxContent(props) {
|
|
|
145
145
|
showDisabledFBInfo,
|
|
146
146
|
orgUnitId,
|
|
147
147
|
smsRegister,
|
|
148
|
+
enableNewChannels,
|
|
148
149
|
} = props;
|
|
149
150
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
150
151
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -364,6 +365,7 @@ function SlideBoxContent(props) {
|
|
|
364
365
|
showDisabledFBInfo={showDisabledFBInfo}
|
|
365
366
|
orgUnitId={orgUnitId}
|
|
366
367
|
smsRegister={smsRegister}
|
|
368
|
+
enableNewChannels={enableNewChannels}
|
|
367
369
|
/>
|
|
368
370
|
)}
|
|
369
371
|
{isPreview && (
|
|
@@ -420,8 +420,8 @@ class Creatives extends React.Component {
|
|
|
420
420
|
if (get(template, "value.versions.base")) {
|
|
421
421
|
const mobilpushTemplate = template.value;
|
|
422
422
|
templateData.accountId = get(mobilpushTemplate, 'definition.accountId');
|
|
423
|
-
const type = (get(this.props,"messageDetails.type") || '').toLowerCase();
|
|
424
|
-
if(type === LOYALTY){
|
|
423
|
+
const type = (get(this.props, "messageDetails.type") || '').toLowerCase();
|
|
424
|
+
if (type === LOYALTY) {
|
|
425
425
|
templateData.licenseCode = get(mobilpushTemplate, 'definition.licenseCode');
|
|
426
426
|
}
|
|
427
427
|
const androidContent = get(mobilpushTemplate, 'versions.base.ANDROID');
|
|
@@ -821,7 +821,7 @@ class Creatives extends React.Component {
|
|
|
821
821
|
}
|
|
822
822
|
render() {
|
|
823
823
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
824
|
-
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor, smsRegister} = this.props;
|
|
824
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor, smsRegister, enableNewChannels} = this.props;
|
|
825
825
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
826
826
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
827
827
|
return (
|
|
@@ -902,6 +902,7 @@ class Creatives extends React.Component {
|
|
|
902
902
|
smsRegister={smsRegister}
|
|
903
903
|
messageStrategy={this.props.strategy}
|
|
904
904
|
orgUnitId={this.props.orgUnitId}
|
|
905
|
+
enableNewChannels={enableNewChannels}
|
|
905
906
|
/>
|
|
906
907
|
}
|
|
907
908
|
footer={this.shouldShowFooter() &&
|
|
@@ -50,6 +50,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
50
50
|
isFullMode,
|
|
51
51
|
onChannelChange,
|
|
52
52
|
showDisabledFBInfo,
|
|
53
|
+
enableNewChannels,
|
|
53
54
|
} = props;
|
|
54
55
|
|
|
55
56
|
const defaultPanes = {
|
|
@@ -79,6 +80,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
79
80
|
filteredPanes.push({content: <></>, tab: intl.formatMessage(messages.FTP), key: 'ftp'});
|
|
80
81
|
defaultChannel = 'FTP';
|
|
81
82
|
}
|
|
83
|
+
if (!enableNewChannels.includes('WHATSAPP')) {
|
|
84
|
+
filteredPanes.splice(7, 1);
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
|
|
@@ -834,6 +834,7 @@ export const Whatsapp = (props) => {
|
|
|
834
834
|
<TemplatePreview
|
|
835
835
|
channel={WHATSAPP}
|
|
836
836
|
content={{ templateMsg }}
|
|
837
|
+
whatsappContentLen={isEditFlow ? updatedSmsEditor.join('').length : templateMessage.length}
|
|
837
838
|
whatsappAccountName={accountName}
|
|
838
839
|
/>
|
|
839
840
|
);
|