@capillarytech/creatives-library 8.0.92 → 8.0.94
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/containers/Templates/constants.js +7 -0
- package/containers/Templates/index.js +43 -24
- package/package.json +1 -1
- package/services/api.js +1 -7
- package/services/tests/api.test.js +1 -5
- package/v2Components/CapImageUpload/index.js +10 -13
- package/v2Components/CapVideoUpload/index.js +9 -12
- package/v2Components/CapWhatsappCTA/messages.js +0 -4
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -20
- package/v2Components/TemplatePreview/index.js +105 -160
- package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +6 -6
- package/v2Containers/CreativesContainer/index.js +5 -92
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +0 -1
- package/v2Containers/Templates/_templates.scss +0 -47
- package/v2Containers/Templates/index.js +5 -55
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +156 -177
- package/v2Containers/Whatsapp/constants.js +1 -87
- package/v2Containers/Whatsapp/index.js +189 -707
- package/v2Containers/Whatsapp/index.scss +1 -52
- package/v2Containers/Whatsapp/messages.js +2 -38
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +91371 -30860
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +0 -6
- package/v2Containers/Whatsapp/tests/utils.test.js +1 -80
- package/v2Containers/Whatsapp/utils.js +0 -34
- package/v2Containers/mockdata.js +0 -2
- package/v2Components/CapWhatsappCarouselButton/constant.js +0 -56
- package/v2Components/CapWhatsappCarouselButton/index.js +0 -446
- package/v2Components/CapWhatsappCarouselButton/index.scss +0 -39
- package/v2Components/CapWhatsappCarouselButton/tests/index.test.js +0 -237
- package/v2Components/TemplatePreview/assets/images/empty_image_preview.svg +0 -4
- package/v2Components/TemplatePreview/assets/images/empty_video_preview.svg +0 -4
|
@@ -43,3 +43,10 @@ export const RESET_TEMPLATE = "app/containers/Templates/RESET_TEMPLATE";
|
|
|
43
43
|
export const RESET_TEMPLATE_DATA = "app/containers/Templates/RESET_TEMPLATE_DATA";
|
|
44
44
|
export const RESET_UPLOAD_DATA = "app/containers/Templates/RESET_UPLOAD_DATA";
|
|
45
45
|
export const CLEAR_TEMPLATE_STORE_DATA = "app/containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export const TRUE = 'true';
|
|
49
|
+
export const FALSE = 'false';
|
|
50
|
+
export const EMAIL = 'email';
|
|
51
|
+
export const TYPE_EMBEDDED = 'embedded';
|
|
52
|
+
export const DEFAULT = 'default';
|
|
@@ -57,6 +57,7 @@ import lineCreateReducer from '../Line/Create/reducer';
|
|
|
57
57
|
import { ebillSaga } from '../Ebill/sagas';
|
|
58
58
|
import { lineCreateSaga } from '../Line/Create/sagas';
|
|
59
59
|
import { duplicateMPushSaga } from '../MobilePush/Create/sagas';
|
|
60
|
+
import { DEFAULT, FALSE, TRUE, TYPE_EMBEDDED } from './constants';
|
|
60
61
|
|
|
61
62
|
const MenuItem = Menu.Item;
|
|
62
63
|
const Option = Select.Option;
|
|
@@ -914,31 +915,49 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
914
915
|
|
|
915
916
|
handleEdmDefaultTemplateSelection = (isSelected, id) => {
|
|
916
917
|
if (isSelected) {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
|
|
918
|
+
const template = _.find(this.props.Templates.cmsTemplates, (template) => {
|
|
919
|
+
return template?.versions && template?.versions?.base && template?.versions?.base?.drag_drop_id === id;
|
|
920
|
+
});
|
|
921
|
+
const {type,module = DEFAULT} = this.props?.location?.query;
|
|
922
|
+
const isLanguageSupport = this.props?.location?.query?.isLanguageSupport === TRUE;
|
|
923
|
+
const isEdmSupport = this.props?.location?.query?.isEdmSupport !== FALSE;
|
|
922
924
|
let getQuery = '';
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
925
|
+
|
|
926
|
+
if (template) {
|
|
927
|
+
this.props.actions.setEdmTemplate({
|
|
928
|
+
...template,
|
|
929
|
+
isEdmSupport,
|
|
930
|
+
isLanguageSupport,
|
|
931
|
+
projectId: template?.versions?.base?.drag_drop_id,
|
|
932
|
+
});
|
|
933
|
+
|
|
934
|
+
if (this.state.channel && this.state.channel.toLowerCase() === EMAIL) {
|
|
935
|
+
getQuery = (type === TYPE_EMBEDDED) ? {
|
|
936
|
+
type: TYPE_EMBEDDED,
|
|
937
|
+
module,
|
|
938
|
+
isLanguageSupport: isLanguageSupport ? 1 : 0,
|
|
939
|
+
isEdmSupport: isEdmSupport ? 1 : 0,
|
|
940
|
+
projectId: template?.versions?.base?.drag_drop_id,
|
|
941
|
+
} : {
|
|
942
|
+
module,
|
|
943
|
+
isLanguageSupport: isLanguageSupport ? 1 : 0,
|
|
944
|
+
isEdmSupport: isEdmSupport ? 1 : 0,
|
|
945
|
+
projectId: template?.versions?.base?.drag_drop_id,
|
|
946
|
+
};
|
|
947
|
+
} else {
|
|
948
|
+
getQuery = (type === TYPE_EMBEDDED) ? {type: TYPE_EMBEDDED, module} : {module};
|
|
949
|
+
}
|
|
934
950
|
|
|
935
|
-
|
|
936
|
-
|
|
951
|
+
if (this.isEnabledInLibraryModule("callCreateFromProps")) {
|
|
952
|
+
this.props.createNew();
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
937
955
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
956
|
+
this.props.router.push({
|
|
957
|
+
pathname: `/${this.state.channel.toLowerCase()}/create`,
|
|
958
|
+
search: commonUtil.createQueryString(getQuery),
|
|
959
|
+
});
|
|
960
|
+
}
|
|
942
961
|
}
|
|
943
962
|
};
|
|
944
963
|
|
|
@@ -1128,7 +1147,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1128
1147
|
const imgSrc = template && template.versions && template.versions.base ? template.versions.base.preview_http_url : '';
|
|
1129
1148
|
const ifPreviewGenerated = template && template.versions && template.versions.base ? template.versions.base.isPreviewGenerated : 0;
|
|
1130
1149
|
content = <img src={imgSrc || ''} alt={this.props.intl.formatMessage(messages.previewGenerateText)} width="100%" height="100%"/>;
|
|
1131
|
-
|
|
1150
|
+
|
|
1132
1151
|
temp.content = (
|
|
1133
1152
|
<div
|
|
1134
1153
|
className="sms-template-content">
|
|
@@ -1136,7 +1155,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1136
1155
|
{content}
|
|
1137
1156
|
</div>
|
|
1138
1157
|
{!layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={(e) => this.handleEditClick(e, template._id)} className="edit-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectButton) : this.props.intl.formatMessage(messages.editButton)}</CapButton> : ''}
|
|
1139
|
-
{layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={(event) =>{this.handleEdmDefaultTemplateSelection(true, template.
|
|
1158
|
+
{layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={(event) =>{this.handleEdmDefaultTemplateSelection(true, template.versions.base.drag_drop_id); event.stopPropagation();}} className="select-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectDefaultButton) : this.props.intl.formatMessage(messages.selectDefaultButton)}</CapButton> : ''}
|
|
1140
1159
|
{!layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={() => this.handlePreviewClick(template)} className="preview-button" type="cancel">{this.props.intl.formatMessage(messages.previewButton)}</CapButton> : ''}
|
|
1141
1160
|
</div>);
|
|
1142
1161
|
} else if (this.state.channel.toLowerCase() === 'mobilepush') {
|
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -524,13 +524,7 @@ export const checkBulkDuplicates = (data) => {
|
|
|
524
524
|
export const createWhatsappTemplate = ({payload, gupshupMediaFile }) => {
|
|
525
525
|
const data = new FormData();
|
|
526
526
|
data.append('payload', JSON.stringify(payload));
|
|
527
|
-
|
|
528
|
-
gupshupMediaFile.forEach((file, index) => {
|
|
529
|
-
data.append(`gupshupMediaFile_${index}`, file);
|
|
530
|
-
});
|
|
531
|
-
} else {
|
|
532
|
-
data.append('gupshupMediaFile', gupshupMediaFile);
|
|
533
|
-
}
|
|
527
|
+
data.append('gupshupMediaFile', gupshupMediaFile);
|
|
534
528
|
const url = `${API_ENDPOINT}/templates/WHATSAPP`;
|
|
535
529
|
return request(url, getAPICallObject('POST', data, true));
|
|
536
530
|
};
|
|
@@ -86,11 +86,7 @@ describe('uploadFile -- whatsapp image upload', () => {
|
|
|
86
86
|
describe('createWhatsappTemplate -- Test with valid responses', () => {
|
|
87
87
|
it('Should return correct response', () =>
|
|
88
88
|
expect(
|
|
89
|
-
createWhatsappTemplate(
|
|
90
|
-
).toEqual(Promise.resolve()));
|
|
91
|
-
it('Should return correct response when single file is present', () =>
|
|
92
|
-
expect(
|
|
93
|
-
createWhatsappTemplate({gupshupMediaFile: sampleFile, payload: mockData.createWhatsappPayload}),
|
|
89
|
+
createWhatsappTemplate(sampleFile, mockData.createWhatsappPayload),
|
|
94
90
|
).toEqual(Promise.resolve()));
|
|
95
91
|
});
|
|
96
92
|
|
|
@@ -44,7 +44,6 @@ function CapImageUpload(props) {
|
|
|
44
44
|
imageData,
|
|
45
45
|
channel,
|
|
46
46
|
channelSpecificStyle,
|
|
47
|
-
showReUploadButton = true,
|
|
48
47
|
} = props;
|
|
49
48
|
const {
|
|
50
49
|
formatMessage,
|
|
@@ -225,18 +224,16 @@ function CapImageUpload(props) {
|
|
|
225
224
|
</>
|
|
226
225
|
);
|
|
227
226
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
);
|
|
239
|
-
}
|
|
227
|
+
return (
|
|
228
|
+
<CapButton
|
|
229
|
+
className="dragger-button re-upload"
|
|
230
|
+
type="flat"
|
|
231
|
+
onClick={onReUpload}
|
|
232
|
+
style={channelSpecificStyle ? { marginTop: '-16px'} : {}}
|
|
233
|
+
>
|
|
234
|
+
<FormattedMessage {...messages.imageReUpload} />
|
|
235
|
+
</CapButton>
|
|
236
|
+
);
|
|
240
237
|
}, [isImageError, imageSrc]);
|
|
241
238
|
|
|
242
239
|
return (
|
|
@@ -39,7 +39,6 @@ function CapVideoUpload(props) {
|
|
|
39
39
|
errorMessage,
|
|
40
40
|
showVideoNameAndDuration = true,
|
|
41
41
|
formClassName = 'video-form',
|
|
42
|
-
showReUploadButton = true,
|
|
43
42
|
} = props;
|
|
44
43
|
const [isVideoError, updateVideoErrorMessage] = useState(false);
|
|
45
44
|
const [isVideo, updateVideoStatus] = useState(false);
|
|
@@ -247,17 +246,15 @@ function CapVideoUpload(props) {
|
|
|
247
246
|
const videoDurationValue = moment('1900-01-01 00:00:00').add(videoDuration, 'seconds').format("HH.mm.ss"); // to get the duration of video
|
|
248
247
|
return (
|
|
249
248
|
<Fragment key={videoSrc}>
|
|
250
|
-
{
|
|
251
|
-
<
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
</div>
|
|
260
|
-
)}
|
|
249
|
+
<div style={{ overflow: 'hidden' }}>
|
|
250
|
+
<CapButton
|
|
251
|
+
className="dragger-button video-reupload"
|
|
252
|
+
type="flat"
|
|
253
|
+
onClick={onReUpload}
|
|
254
|
+
>
|
|
255
|
+
<FormattedMessage {...messages.imageReUpload} />
|
|
256
|
+
</CapButton>
|
|
257
|
+
</div>
|
|
261
258
|
<div className={showVideoNameAndDuration ? 'video-panel' : 'video-panel-wp'}>
|
|
262
259
|
<video
|
|
263
260
|
width="230"
|
|
@@ -567,10 +567,6 @@
|
|
|
567
567
|
font-size: 10px;
|
|
568
568
|
font-family: 'open-sans';
|
|
569
569
|
}
|
|
570
|
-
&.message-pop-carousel {
|
|
571
|
-
position: relative;
|
|
572
|
-
margin-right: $CAP_SPACE_04;
|
|
573
|
-
}
|
|
574
570
|
}
|
|
575
571
|
}
|
|
576
572
|
.android-push-message-Container, .iphone-push-message-Container{
|
|
@@ -751,22 +747,6 @@
|
|
|
751
747
|
width: 153px;
|
|
752
748
|
}
|
|
753
749
|
}
|
|
754
|
-
|
|
755
|
-
.msg-container-carousel {
|
|
756
|
-
display: flex;
|
|
757
|
-
flex-direction: column;
|
|
758
|
-
.scroll-container {
|
|
759
|
-
overflow-x: auto;
|
|
760
|
-
display: flex;
|
|
761
|
-
padding-top: $CAP_SPACE_06;
|
|
762
|
-
padding-right: $CAP_SPACE_06;
|
|
763
|
-
white-space: nowrap;
|
|
764
|
-
scrollbar-width: none; // Hide scrollbar in Firefox
|
|
765
|
-
&::-webkit-scrollbar {
|
|
766
|
-
display: none; // Hide scrollbar in Chrome/Safari/Opera
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
750
|
}
|
|
771
751
|
|
|
772
752
|
.align-center {
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
CAP_PURPLE01,
|
|
21
21
|
CAP_G16,
|
|
22
22
|
CAP_SPACE_08,
|
|
23
|
-
CAP_SPACE_04,
|
|
24
23
|
} from '@capillarytech/cap-ui-library/styled/variables';
|
|
25
24
|
import isEmpty from 'lodash/isEmpty';
|
|
26
25
|
import './_templatePreview.scss';
|
|
@@ -44,16 +43,14 @@ import inAppMobileIOSModal from './assets/images/inapp_mobile_ios_modal.svg';
|
|
|
44
43
|
import inAppMobileIOSTop from './assets/images/inapp_mobile_ios_top.svg';
|
|
45
44
|
import inAppMobileIOSBottom from './assets/images/inapp_mobile_ios_bottom.svg';
|
|
46
45
|
import inAppMobileIOSFull from './assets/images/inapp_mobile_ios_full.svg';
|
|
47
|
-
import whatsappImageEmptyPreview from './assets/images/empty_image_preview.svg';
|
|
48
|
-
import whatsappVideoEmptyPreview from './assets/images/empty_video_preview.svg';
|
|
49
46
|
import videoPlay from '../../assets/videoPlay.svg';
|
|
50
47
|
import zaloMessage from '../../v2Containers/Zalo/messages';
|
|
51
48
|
import { handlePreviewInNewTab } from '../../utils/common';
|
|
52
49
|
import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
|
|
53
50
|
import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
|
|
54
51
|
import WhatsappStatusContainer from '../WhatsappStatusContainer';
|
|
55
|
-
import { getWhatsappQuickReply
|
|
56
|
-
import { QUICK_REPLY, WHATSAPP_CATEGORIES
|
|
52
|
+
import { getWhatsappQuickReply } from '../../v2Containers/Whatsapp/utils';
|
|
53
|
+
import { QUICK_REPLY, WHATSAPP_CATEGORIES } from '../../v2Containers/Whatsapp/constants';
|
|
57
54
|
import { ANDROID, INAPP_MESSAGE_LAYOUT_TYPES } from '../../v2Containers/InApp/constants';
|
|
58
55
|
|
|
59
56
|
const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
|
|
@@ -216,7 +213,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
216
213
|
iosActions = _.map(content.actions, (action) => {
|
|
217
214
|
if (action.label) {
|
|
218
215
|
return (<div className="actions" key={`action-${action.label}`}>
|
|
219
|
-
|
|
216
|
+
<span className="action">{action.label.toUpperCase()}</span>
|
|
220
217
|
</div>);
|
|
221
218
|
}
|
|
222
219
|
return undefined;
|
|
@@ -256,15 +253,6 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
256
253
|
'width': '88%',
|
|
257
254
|
'left': 0,
|
|
258
255
|
};
|
|
259
|
-
const carouselWhatsappSectionStyle = {
|
|
260
|
-
'padding': `${CAP_SPACE_04} 0 ${CAP_SPACE_08}`,
|
|
261
|
-
'border-radius': '0.428rem',
|
|
262
|
-
'background-color': CAP_WHITE,
|
|
263
|
-
'width': '10.4rem',
|
|
264
|
-
'cursor': 'pointer',
|
|
265
|
-
'flex-shrink': 0,
|
|
266
|
-
'left': 0,
|
|
267
|
-
};
|
|
268
256
|
const getVideoContent = ({
|
|
269
257
|
video,
|
|
270
258
|
actionUrl,
|
|
@@ -286,53 +274,53 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
286
274
|
>
|
|
287
275
|
{
|
|
288
276
|
video
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
277
|
+
? (
|
|
278
|
+
<>
|
|
279
|
+
<video style={{ opacity: 0.5, width: '100%' }}>
|
|
280
|
+
<source src={video} type="video/mp4" />
|
|
281
|
+
</video>
|
|
282
|
+
<div
|
|
283
|
+
style={{
|
|
284
|
+
position: 'absolute',
|
|
285
|
+
display: 'flex',
|
|
286
|
+
flexDirection: 'column',
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
<CapButton
|
|
290
|
+
className="preview-video-btn"
|
|
291
|
+
type="flat"
|
|
300
292
|
>
|
|
301
|
-
<CapButton
|
|
302
|
-
className="preview-video-btn"
|
|
303
|
-
type="flat"
|
|
304
|
-
>
|
|
305
293
|
<CapIcon type="play"/>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
294
|
+
<FormattedMessage {...messages.playVideo} />
|
|
295
|
+
</CapButton>
|
|
296
|
+
{
|
|
297
|
+
actionUrl
|
|
298
|
+
? (
|
|
299
|
+
<CapButton
|
|
300
|
+
className="preview-video-btn"
|
|
301
|
+
type="flat"
|
|
302
|
+
>
|
|
315
303
|
<CapIcon type="reply" style={{ fontSize: 18 }}/>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
304
|
+
<FormattedMessage {...messages.showDetails} />
|
|
305
|
+
</CapButton>
|
|
306
|
+
)
|
|
307
|
+
: null
|
|
308
|
+
}
|
|
309
|
+
</div>
|
|
310
|
+
</>
|
|
311
|
+
)
|
|
312
|
+
: (
|
|
313
|
+
<CapImage
|
|
314
|
+
src={lineVideoPlaceholder}
|
|
315
|
+
alt="brand-name"
|
|
316
|
+
rest={{
|
|
317
|
+
style: {
|
|
318
|
+
width: 126,
|
|
319
|
+
marginBottom: 5,
|
|
320
|
+
},
|
|
321
|
+
}}
|
|
322
|
+
/>
|
|
323
|
+
)
|
|
336
324
|
}
|
|
337
325
|
</div>
|
|
338
326
|
);
|
|
@@ -348,10 +336,10 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
348
336
|
renderArray.push(
|
|
349
337
|
<CapLabel type="label21" className="whatsapp-cta-preview">
|
|
350
338
|
{type !== WHATSAPP_CATEGORIES.authentication && <CapIcon
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
339
|
+
type={
|
|
340
|
+
(ctaType || type) === 'PHONE_NUMBER' ? 'call' : 'launch'
|
|
341
|
+
}
|
|
342
|
+
size="xs"
|
|
355
343
|
/>}
|
|
356
344
|
{text}
|
|
357
345
|
</CapLabel>,
|
|
@@ -442,42 +430,42 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
442
430
|
{this.props.showCount &&
|
|
443
431
|
channel &&
|
|
444
432
|
channel.toLowerCase() !== FACEBOOK && (
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
<FormattedMessage
|
|
449
|
-
{...messages.charactersTotal}
|
|
450
|
-
values={{
|
|
451
|
-
smsCount: smsDetails.parts,
|
|
452
|
-
charCount: smsDetails.chars_used,
|
|
453
|
-
}}
|
|
454
|
-
/>
|
|
455
|
-
{smsDetails.unicode && (
|
|
456
|
-
<FormattedMessage {...messages.smsFormatType} />
|
|
457
|
-
)}
|
|
458
|
-
</CapHeading>
|
|
459
|
-
)}
|
|
460
|
-
{smsDetails.optoutUrlPresent && (
|
|
461
|
-
<CapHeading type="h6">
|
|
462
|
-
<FormattedMessage
|
|
463
|
-
{...messages.optoutCharactersTotal}
|
|
464
|
-
values={{ optoutUrlLength: smsDetails.optouturlLength }}
|
|
465
|
-
/>
|
|
466
|
-
</CapHeading>
|
|
467
|
-
)}
|
|
468
|
-
{channel?.toLowerCase() === WHATSAPP.toLowerCase() ? (
|
|
469
|
-
<>
|
|
470
|
-
<WhatsappStatusContainer template={templateData} />
|
|
471
|
-
<CapHeading type="h3" className="margin-t-12">
|
|
433
|
+
<CapColumn span={16}>
|
|
434
|
+
{channel && channel.toLowerCase() === "sms" && (
|
|
435
|
+
<CapHeading type="h3">
|
|
472
436
|
<FormattedMessage
|
|
473
|
-
{...messages.
|
|
474
|
-
values={{
|
|
437
|
+
{...messages.charactersTotal}
|
|
438
|
+
values={{
|
|
439
|
+
smsCount: smsDetails.parts,
|
|
440
|
+
charCount: smsDetails.chars_used,
|
|
441
|
+
}}
|
|
475
442
|
/>
|
|
443
|
+
{smsDetails.unicode && (
|
|
444
|
+
<FormattedMessage {...messages.smsFormatType} />
|
|
445
|
+
)}
|
|
476
446
|
</CapHeading>
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
447
|
+
)}
|
|
448
|
+
{smsDetails.optoutUrlPresent && (
|
|
449
|
+
<CapHeading type="h6">
|
|
450
|
+
<FormattedMessage
|
|
451
|
+
{...messages.optoutCharactersTotal}
|
|
452
|
+
values={{ optoutUrlLength: smsDetails.optouturlLength }}
|
|
453
|
+
/>
|
|
454
|
+
</CapHeading>
|
|
455
|
+
)}
|
|
456
|
+
{channel?.toLowerCase() === WHATSAPP.toLowerCase() ? (
|
|
457
|
+
<>
|
|
458
|
+
<WhatsappStatusContainer template={templateData} />
|
|
459
|
+
<CapHeading type="h3" className="margin-t-12">
|
|
460
|
+
<FormattedMessage
|
|
461
|
+
{...messages.whatsappMessageLength}
|
|
462
|
+
values={{ length: whatsappUpdatedLen }}
|
|
463
|
+
/>
|
|
464
|
+
</CapHeading>
|
|
465
|
+
</>
|
|
466
|
+
) : null}
|
|
467
|
+
</CapColumn>
|
|
468
|
+
)}
|
|
481
469
|
<CapColumn span={this.props.showCount ? 8 : 24}>
|
|
482
470
|
{showTestAndPreview && (
|
|
483
471
|
<div className="test-and-preview-container">
|
|
@@ -640,9 +628,9 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
640
628
|
)}
|
|
641
629
|
{content.actions.filter((action) => action.label)
|
|
642
630
|
.length ? (
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
631
|
+
<div className="actions">
|
|
632
|
+
{_.map(
|
|
633
|
+
content.actions,
|
|
646
634
|
(action) =>
|
|
647
635
|
!!action.label && (
|
|
648
636
|
<span
|
|
@@ -652,11 +640,11 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
652
640
|
{action.label && action.label.toUpperCase()}
|
|
653
641
|
</span>
|
|
654
642
|
)
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
643
|
+
)}
|
|
644
|
+
</div>
|
|
645
|
+
) : (
|
|
646
|
+
""
|
|
647
|
+
)}
|
|
660
648
|
</div>
|
|
661
649
|
) : (
|
|
662
650
|
<div className="message-pop align-left">
|
|
@@ -992,14 +980,14 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
992
980
|
<CapLabel className="whatsapp-brand-name">
|
|
993
981
|
{whatsappUpdatedAccountName || ""}
|
|
994
982
|
</CapLabel>
|
|
995
|
-
<div className=
|
|
983
|
+
<div className="msg-container whatsapp-message-container">
|
|
996
984
|
<div
|
|
997
|
-
className=
|
|
985
|
+
className="message-pop align-left"
|
|
998
986
|
style={whatsappSectionStyle}
|
|
999
987
|
>
|
|
1000
988
|
<div className="whatsapp-content">
|
|
1001
|
-
{content?.showUrlPreview
|
|
1002
|
-
|
|
989
|
+
{content?.showUrlPreview &&
|
|
990
|
+
renderUrlPreview(content?.metaTagsDetails)}
|
|
1003
991
|
{content?.whatsappImageSrc && (
|
|
1004
992
|
<CapImage
|
|
1005
993
|
src={content.whatsappImageSrc}
|
|
@@ -1038,49 +1026,6 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1038
1026
|
{renderQuickReplyPreview()}
|
|
1039
1027
|
</div>
|
|
1040
1028
|
</div>
|
|
1041
|
-
{content?.carouselData && (
|
|
1042
|
-
<div className="scroll-container">
|
|
1043
|
-
{content?.carouselData?.map((data, index) => (
|
|
1044
|
-
<div
|
|
1045
|
-
key={`carousel-${index}-${data?.bodyText}`}
|
|
1046
|
-
className="message-pop align-left message-pop-carousel"
|
|
1047
|
-
style={carouselWhatsappSectionStyle}>
|
|
1048
|
-
<div className="whatsapp-content">
|
|
1049
|
-
{content?.carouselMediaType === "image" && (
|
|
1050
|
-
<CapImage
|
|
1051
|
-
src={data?.imageSrc ? data?.imageSrc : whatsappImageEmptyPreview}
|
|
1052
|
-
className="whatsapp-image"
|
|
1053
|
-
alt={formatMessage(messages.previewGenerated)}
|
|
1054
|
-
/>
|
|
1055
|
-
)}
|
|
1056
|
-
{content?.carouselMediaType === "video" && (
|
|
1057
|
-
<CapTooltip
|
|
1058
|
-
title={formatMessage(messages.videoPreviewTooltip)}
|
|
1059
|
-
>
|
|
1060
|
-
<div className="video-preview">
|
|
1061
|
-
<CapImage
|
|
1062
|
-
src={data?.videoPreviewImg ? data?.videoPreviewImg : whatsappVideoEmptyPreview}
|
|
1063
|
-
className="whatsapp-image"
|
|
1064
|
-
alt={formatMessage(messages.previewGenerated)}
|
|
1065
|
-
/>
|
|
1066
|
-
<div className="icon-position">
|
|
1067
|
-
<CapImage
|
|
1068
|
-
className="video-icon"
|
|
1069
|
-
src={videoPlay}
|
|
1070
|
-
/>
|
|
1071
|
-
</div>
|
|
1072
|
-
</div>
|
|
1073
|
-
</CapTooltip>
|
|
1074
|
-
)}
|
|
1075
|
-
<CapLabel type="label5">
|
|
1076
|
-
{content?.isEditFlow ? data?.updatedBodyText?.join("") : data?.bodyText}
|
|
1077
|
-
</CapLabel>
|
|
1078
|
-
{getWhatsappCarouselButtonView(data?.buttons, true)}
|
|
1079
|
-
</div>
|
|
1080
|
-
</div>
|
|
1081
|
-
))}
|
|
1082
|
-
</div>
|
|
1083
|
-
)}
|
|
1084
1029
|
</div>
|
|
1085
1030
|
</div>
|
|
1086
1031
|
<CapHeading
|
|
@@ -1260,21 +1205,21 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1260
1205
|
{ctaData &&
|
|
1261
1206
|
!isEmpty(ctaData) &&
|
|
1262
1207
|
ctaData[0]?.text !== "" && (
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1208
|
+
<CapButton
|
|
1209
|
+
type="primary"
|
|
1210
|
+
className={`inapp-button-${templateLayoutType}-${device} ${
|
|
1266
1211
|
mediaPreview?.inAppImageSrcAndroid
|
|
1267
1212
|
? ""
|
|
1268
1213
|
: `without-image-button-${templateLayoutType}-android`
|
|
1269
|
-
|
|
1214
|
+
} ${
|
|
1270
1215
|
mediaPreview?.inAppImageSrcIos
|
|
1271
1216
|
? ""
|
|
1272
1217
|
: `without-image-button-${templateLayoutType}-ios`
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1218
|
+
}`}
|
|
1219
|
+
>
|
|
1220
|
+
{ctaData[0]?.text}
|
|
1221
|
+
</CapButton>
|
|
1222
|
+
)}
|
|
1278
1223
|
</div>
|
|
1279
1224
|
</div>
|
|
1280
1225
|
</div>
|