@capillarytech/creatives-library 8.0.127-alpha.1 → 8.0.128

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 (67) hide show
  1. package/containers/App/constants.js +0 -1
  2. package/package.json +1 -1
  3. package/services/api.js +1 -1
  4. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +3 -8
  5. package/tests/integration/TemplateCreation/api-response.js +0 -5
  6. package/tests/integration/TemplateCreation/msw-handler.js +63 -42
  7. package/utils/common.js +0 -7
  8. package/utils/commonUtils.js +6 -2
  9. package/v2Components/CapImageUpload/index.js +46 -59
  10. package/v2Components/CapInAppCTA/index.js +0 -1
  11. package/v2Components/CapTagList/index.js +120 -177
  12. package/v2Components/CapVideoUpload/constants.js +0 -3
  13. package/v2Components/CapVideoUpload/index.js +110 -167
  14. package/v2Components/CapVideoUpload/messages.js +0 -16
  15. package/v2Components/Carousel/index.js +13 -15
  16. package/v2Components/ErrorInfoNote/style.scss +0 -1
  17. package/v2Components/MobilePushPreviewV2/index.js +5 -37
  18. package/v2Components/TemplatePreview/_templatePreview.scss +72 -114
  19. package/v2Components/TemplatePreview/index.js +50 -178
  20. package/v2Components/TemplatePreview/messages.js +0 -4
  21. package/v2Containers/CreativesContainer/SlideBoxContent.js +9 -9
  22. package/v2Containers/CreativesContainer/index.js +136 -191
  23. package/v2Containers/InApp/constants.js +0 -1
  24. package/v2Containers/InApp/index.js +13 -13
  25. package/v2Containers/MobilePush/Create/index.js +0 -1
  26. package/v2Containers/MobilePush/commonMethods.js +14 -7
  27. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +5 -5
  28. package/v2Containers/TagList/index.js +10 -56
  29. package/v2Containers/Templates/_templates.scss +1 -101
  30. package/v2Containers/Templates/index.js +35 -147
  31. package/v2Containers/Templates/messages.js +0 -8
  32. package/v2Containers/Templates/sagas.js +0 -2
  33. package/v2Containers/Whatsapp/constants.js +0 -1
  34. package/utils/createPayload.js +0 -272
  35. package/utils/tests/createPayload.test.js +0 -761
  36. package/v2Components/CapMpushCTA/constants.js +0 -25
  37. package/v2Components/CapMpushCTA/index.js +0 -332
  38. package/v2Components/CapMpushCTA/index.scss +0 -95
  39. package/v2Components/CapMpushCTA/messages.js +0 -89
  40. package/v2Components/TemplatePreview/assets/images/Android _ With date and time.svg +0 -29
  41. package/v2Components/TemplatePreview/assets/images/android.svg +0 -9
  42. package/v2Components/TemplatePreview/assets/images/iOS _ With date and time.svg +0 -26
  43. package/v2Components/TemplatePreview/assets/images/ios.svg +0 -9
  44. package/v2Containers/MobilePushNew/actions.js +0 -116
  45. package/v2Containers/MobilePushNew/components/CtaButtons.js +0 -170
  46. package/v2Containers/MobilePushNew/components/MediaUploaders.js +0 -754
  47. package/v2Containers/MobilePushNew/components/PlatformContentFields.js +0 -279
  48. package/v2Containers/MobilePushNew/components/index.js +0 -5
  49. package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +0 -779
  50. package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +0 -2114
  51. package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +0 -343
  52. package/v2Containers/MobilePushNew/constants.js +0 -115
  53. package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +0 -1299
  54. package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -1223
  55. package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +0 -246
  56. package/v2Containers/MobilePushNew/hooks/useUpload.js +0 -726
  57. package/v2Containers/MobilePushNew/index.js +0 -2280
  58. package/v2Containers/MobilePushNew/index.scss +0 -308
  59. package/v2Containers/MobilePushNew/messages.js +0 -226
  60. package/v2Containers/MobilePushNew/reducer.js +0 -160
  61. package/v2Containers/MobilePushNew/sagas.js +0 -198
  62. package/v2Containers/MobilePushNew/selectors.js +0 -55
  63. package/v2Containers/MobilePushNew/tests/reducer.test.js +0 -741
  64. package/v2Containers/MobilePushNew/tests/sagas.test.js +0 -863
  65. package/v2Containers/MobilePushNew/tests/selectors.test.js +0 -425
  66. package/v2Containers/MobilePushNew/tests/utils.test.js +0 -322
  67. package/v2Containers/MobilePushNew/utils.js +0 -33
@@ -3,9 +3,7 @@
3
3
  * CapVideoUpload
4
4
  *
5
5
  */
6
- import React, {
7
- useCallback, useState, Fragment, useRef, useEffect,
8
- } from 'react';
6
+ import React, { useCallback, useState, Fragment, useRef, useEffect } from 'react';
9
7
  import PropTypes from "prop-types";
10
8
  import get from 'lodash/get';
11
9
  import CapDrawer from '@capillarytech/cap-ui-library/CapDrawer';
@@ -21,12 +19,9 @@ import {
21
19
  } from '@capillarytech/cap-ui-library';
22
20
  import messages from './messages';
23
21
  import {bytes2Size, getDecodedFileName} from '../../utils/common';
24
- import {
25
- SUPPORTED_FILE_FORMATS, WHATSAPP, DEFAULT, MAX_DURATION, MOBILEPUSH,
26
- } from './constants';
22
+ import { SUPPORTED_FILE_FORMATS, WHATSAPP, DEFAULT, VIBER_MAX_DURATION } from './constants';
27
23
  import './index.scss';
28
24
  import { VIBER } from '../../v2Containers/CreativesContainer/constants';
29
- import { GIF, VIDEO } from '../../v2Containers/MobilePushNew/constants';
30
25
 
31
26
  function CapVideoUpload(props) {
32
27
  const {
@@ -45,7 +40,6 @@ function CapVideoUpload(props) {
45
40
  showVideoNameAndDuration = true,
46
41
  formClassName = 'video-form',
47
42
  showReUploadButton = true,
48
- mediaType = VIDEO.toLowerCase(),
49
43
  } = props;
50
44
  const [isVideoError, updateVideoErrorMessage] = useState(false);
51
45
  const [isVideo, updateVideoStatus] = useState(false);
@@ -74,7 +68,6 @@ function CapVideoUpload(props) {
74
68
  const _URL = window.URL || window.webkitURL;
75
69
  let incorrectFile = false;
76
70
  const file = files[0];
77
-
78
71
  if (!allowedExtensionsRegex.test(file.name)) {
79
72
  incorrectFile = true;
80
73
  }
@@ -86,7 +79,7 @@ function CapVideoUpload(props) {
86
79
  error: false,
87
80
  isGenerateVideoThumbnail: true,
88
81
  };
89
- submitVideoAction({ file, type: mediaType, fileParams }, incorrectFile);
82
+ submitVideoAction({ file, type: 'video', fileParams }, incorrectFile);
90
83
  if (e) {
91
84
  const event = e;
92
85
  event.target.value = null;
@@ -94,18 +87,10 @@ function CapVideoUpload(props) {
94
87
  }, []);
95
88
 
96
89
  useEffect(() => {
97
- }, [videoData, index]);
98
-
99
- useEffect(() => {
100
- if (!isEmpty(videoData[`uploadedAssetData${index}`])) {
101
- const {
102
- metaInfo: {
103
- secure_file_path: metaVideoSrc = '',
104
- file_name: metaVideoName = '',
105
- preview_image_url: previewImgUrl = '',
106
- } = {},
107
- } = videoData[`uploadedAssetData${index}`] || {};
108
-
90
+ if (videoData[`uploadedAssetData${index}`] && Object.keys(videoData[`uploadedAssetData${index}`]).length) {
91
+ const metaVideoSrc = get(videoData, `uploadedAssetData${index}.metaInfo.secure_file_path`, '');
92
+ const previewImgUrl = get(videoData, `uploadedAssetData${index}.metaInfo.video_file_path_preview`, '');
93
+ const metaVideoName = get(videoData, `uploadedAssetData${index}.metaInfo.name`, '');
109
94
  const metaVideoId = get(videoData, `uploadedAssetData${index}.videoIdResponse.fbVideo.id`, '');
110
95
  const karixFileHandle = get(videoData, `uploadedAssetData${index}.metaInfo.karixFileHandle`, '');
111
96
 
@@ -117,13 +102,14 @@ function CapVideoUpload(props) {
117
102
  videoId: metaVideoId,
118
103
  fileHandle: karixFileHandle,
119
104
  videoDuration: null,
120
- });
105
+ },
106
+ );
121
107
  }
122
108
  }
123
- }, [videoData, index, videoSrc, onVideoUploadUpdateAssestList]);
109
+ }, [videoData[`uploadedAssetData${index}`]]);
124
110
 
125
111
  useEffect(() => {
126
- if (videoData[`assetUploadingVideo_${index}`] && videoData.assetUploading !== false) {
112
+ if (videoData[`assetUploadingVideo_${index}`] && videoData[`assetUploading`] !== false) {
127
113
  const isSpinner = get(videoData, `assetUploadingVideo_${index}`, false);
128
114
  setSpinning(isSpinner);
129
115
  }
@@ -137,12 +123,7 @@ function CapVideoUpload(props) {
137
123
  } = uploadedAssetList || {};
138
124
  if (metaVideoSrc) {
139
125
  updateVideoStatus(true);
140
- } else {
141
- updateVideoStatus(false);
142
126
  }
143
- } else {
144
- // When uploadedAssetList is empty, reset video status to show upload interface
145
- updateVideoStatus(false);
146
127
  }
147
128
  }, [uploadedAssetList]);
148
129
 
@@ -155,7 +136,6 @@ function CapVideoUpload(props) {
155
136
  fileParams,
156
137
  type,
157
138
  } = data;
158
-
159
139
  if (incorrectFile || size > videoSize) {
160
140
  if (errorMessage) {
161
141
  updateVideoErrorMessage(errorMessage);
@@ -175,7 +155,11 @@ function CapVideoUpload(props) {
175
155
 
176
156
  const {
177
157
  formatMessage,
178
- } = intl || {};
158
+ } = intl || {};
159
+
160
+ const capUploaderCustomVideoRequest = useCallback((uploadData) => {
161
+ uploadVideo(undefined, { files: [uploadData.file] });
162
+ }, []);
179
163
 
180
164
  const playVideo = useCallback((e) => {
181
165
  if (e.target.paused && !isPlaying) {
@@ -189,86 +173,78 @@ function CapVideoUpload(props) {
189
173
  }
190
174
  }, [isPlaying]);
191
175
 
192
- const onReUpload = useCallback(() => {
193
- updateVideoStatus(false);
194
- updateVideoDuration(null);
195
- onVideoUploadUpdateAssestList(
196
- index,
197
- {
198
- previewUrl: "",
199
- videoName: "",
200
- videoHeight: "",
201
- videoWidth: "",
202
- videoSrc: "",
203
- videoDuration: null,
204
- videoId: "",
205
- fileHandle: "",
206
- }
207
- );
208
- setTimeout(() => {
209
- const fileInput = document.getElementById("videoFileName");
210
- if (fileInput) {
211
- fileInput.click();
212
- }
213
- }, 100);
214
- }, [index, onVideoUploadUpdateAssestList]);
215
-
216
- const updateMetadataLoaded = useCallback(() => {
217
- const { current: { duration, videoHeight: metaVideoHeight, videoWidth: metaVideoWidth } = {} } = videoEl;
218
- if (duration) {
219
- updateVideoDuration(duration);
220
- if (videoWidth === undefined && videoHeight === undefined) {
221
- if (duration <= MAX_DURATION) {
222
- onVideoUploadUpdateAssestList(index, {
223
- videoSrc,
224
- videoId,
225
- videoName,
226
- videoHeight: metaVideoHeight,
227
- videoWidth: metaVideoWidth,
228
- previewUrl,
229
- fileHandle,
230
- videoDuration: duration,
231
- });
232
- } else {
233
- onReUpload();
234
- updateVideoErrorMessage(formatMessage(messages.videoDurationError));
235
- }
236
- }
237
- }
238
- }, [videoSrc, videoId, videoName, previewUrl, fileHandle, videoWidth, videoHeight, index, onVideoUploadUpdateAssestList, formatMessage, onReUpload]);
239
-
240
- const videoDurationValue = videoDuration ? moment('1900-01-01 00:00:00').add(videoDuration, 'seconds').format("HH.mm.ss") : '';
241
-
242
- const capUploaderCustomVideoRequest = useCallback((uploadData) => {
243
- uploadVideo(undefined, { files: [uploadData.file] });
244
- }, [uploadVideo]);
245
-
246
176
  const getVideoSection = () => {
247
177
  if (!isVideo) {
248
178
  return (
249
- <>
250
- <CapUploader.CapDragger
251
- customRequest={(data) => capUploaderCustomVideoRequest(data)}
252
- className="form-builder-dragger whatsapp-background"
253
- showUploadList={!isVideoError}
254
- >
255
- <CapHeading className="dragger-title" type="h7">
256
- <FormattedMessage {...messages.dragAndDrop} />
257
- </CapHeading>
258
- <CapHeading className="dragger-or" type="label6">
259
- <FormattedMessage {...messages.or} />
260
- </CapHeading>
261
- <CapButton className="dragger-button upload-video" type="secondary">
262
- <FormattedMessage {...messages.selectFromComputer} />
263
- </CapButton>
264
- </CapUploader.CapDragger>
265
- <CapError type="error" className="upload-video-error">
266
- {isVideoError}
267
- </CapError>
268
- </>
179
+ (
180
+ <>
181
+ <CapUploader.CapDragger
182
+ customRequest={(data) => capUploaderCustomVideoRequest(data)}
183
+ className="form-builder-dragger whatsapp-background"
184
+ showUploadList={!isVideoError}
185
+ >
186
+ <CapHeading className="dragger-title" type="h7">
187
+ <FormattedMessage {...messages.dragAndDrop} />
188
+ </CapHeading>
189
+ <CapHeading className="dragger-or" type="label6">
190
+ <FormattedMessage {...messages.or} />
191
+ </CapHeading>
192
+ <CapButton className="dragger-button upload-video" type="secondary">
193
+ <FormattedMessage {...messages.selectFromComputer} />
194
+ </CapButton>
195
+ </CapUploader.CapDragger>
196
+ <CapError type="error" className="upload-video-error">
197
+ {isVideoError}
198
+ </CapError>
199
+ </>
200
+ )
269
201
  );
270
202
  }
203
+ const onReUpload = () => {
204
+ updateVideoStatus(false);
205
+ updateVideoDuration(null);
206
+ onVideoUploadUpdateAssestList(
207
+ index,
208
+ {
209
+ previewUrl: "",
210
+ videoName: "",
211
+ videoHeight: "",
212
+ videoWidth: "",
213
+ videoSrc: "",
214
+ videoDuration: null,
215
+ videoId: "",
216
+ fileHandle: "",
217
+ }
218
+ );
219
+ };
271
220
 
221
+ const updateMetadataLoaded = () => {
222
+ const { current: { duration, videoHeight: metaVideoHeight, videoWidth: metaVideoWidth } = {} } = videoEl;
223
+ if (duration) {
224
+ updateVideoDuration(duration);
225
+ if (videoWidth === undefined && videoHeight === undefined) {
226
+ if (
227
+ channel !== VIBER ||
228
+ (channel === VIBER && duration <= VIBER_MAX_DURATION)
229
+ ) {
230
+ onVideoUploadUpdateAssestList(index, {
231
+ videoSrc,
232
+ videoId,
233
+ videoName,
234
+ videoHeight: metaVideoHeight,
235
+ videoWidth: metaVideoWidth,
236
+ previewUrl,
237
+ fileHandle,
238
+ videoDuration: duration,
239
+ });
240
+ } else {
241
+ onReUpload();
242
+ updateVideoErrorMessage(formatMessage(messages.videoDurationError));
243
+ }
244
+ }
245
+ }
246
+ };
247
+ const videoDurationValue = moment('1900-01-01 00:00:00').add(videoDuration, 'seconds').format("HH.mm.ss"); // to get the duration of video
272
248
  return (
273
249
  <Fragment key={videoSrc}>
274
250
  {showReUploadButton && (
@@ -283,35 +259,21 @@ function CapVideoUpload(props) {
283
259
  </div>
284
260
  )}
285
261
  <div className={showVideoNameAndDuration ? 'video-panel' : 'video-panel-wp'}>
286
- {mediaType === GIF.toLowerCase() ? (
287
- <img
288
- width="230"
289
- src={videoSrc}
290
- alt="GIF preview"
291
- className="line-image-src"
292
- key={`${index}-gif`}
293
- style={{ maxWidth: '230px', maxHeight: '200px', objectFit: 'contain' }}
294
- />
295
- ) : (
296
- <video
297
- width="230"
298
- poster={previewUrl}
299
- className="line-image-src"
300
- key={`${index}-video`}
301
- onLoadedMetadata={updateMetadataLoaded}
302
- onPlaying={() => updateIsPlaying(true)}
303
- onPause={() => updateIsPlaying(false)}
304
- onMouseOver={playVideo}
305
- onMouseOut={pauseVideo}
306
- onFocus={playVideo}
307
- onBlur={pauseVideo}
308
- ref={videoEl}
309
- >
310
- <source src={videoSrc} type="video/mp4" />
311
- <track kind="captions" />
312
- </video>
313
- )}
314
- {showVideoNameAndDuration && (
262
+ <video
263
+ width="230"
264
+ poster={previewUrl}
265
+ className="line-image-src"
266
+ key={`${index}-video`}
267
+ onLoadedMetadata={() => updateMetadataLoaded()}
268
+ onPlaying={() => updateIsPlaying(true)}
269
+ onPause={() => updateIsPlaying(false)}
270
+ onMouseOver={playVideo}
271
+ onMouseOut={pauseVideo}
272
+ ref={videoEl}
273
+ >
274
+ <source src={videoSrc} type="video/mp4" />
275
+ </video>
276
+ {showVideoNameAndDuration &&
315
277
  <div className="video-info">
316
278
  <CapHeading type="h4">
317
279
  {getDecodedFileName(videoName)}
@@ -320,7 +282,7 @@ function CapVideoUpload(props) {
320
282
  {videoDurationValue}
321
283
  </CapHeading>
322
284
  </div>
323
- )}
285
+ }
324
286
  </div>
325
287
  </Fragment>
326
288
  );
@@ -338,24 +300,23 @@ function CapVideoUpload(props) {
338
300
  return (
339
301
  <CapSpin spinning={isSpinning}>
340
302
  <div style={style} className="cap-custom-video-upload">
341
- <form encType="multipart/form-data" id="form" className={formClassName}>
303
+ <form encType="multipart/form-data" id={`form`} className={formClassName}>
342
304
  <input
343
- key="videoFile"
305
+ key={`videoFile`}
344
306
  style={{ display: 'none' }}
345
- id="videoFileName"
307
+ id="fileName"
346
308
  type="file"
347
309
  onChange={(e) => uploadVideo(e, { files: e.target.files })}
348
- accept={mediaType === GIF.toLowerCase() ? '.gif' : (supportedExtensions || "video/*")}
349
- />
310
+ accept={supportedExtensions || "video/*"}
311
+ />
350
312
  {getVideoSection()}
351
313
  <CapDrawer
352
314
  visible={isTemplateDrawerRequired}
353
315
  width={624}
354
316
  onClose={() => updateTemplateDrawerRequirement(false)}
355
- />
317
+ />
356
318
  </form>
357
- {![WHATSAPP, VIBER, MOBILEPUSH].includes(channel)
358
- && (
319
+ {![WHATSAPP, VIBER].includes(channel) &&
359
320
  <>
360
321
  <CapHeading.CapHeadingSpan type="h6" className="video-description">
361
322
  <FormattedMessage {...messages.videoRatioDescription} />
@@ -367,18 +328,15 @@ function CapVideoUpload(props) {
367
328
  <CapHeading.CapHeadingSpan type="h6" className="video-description video-details">
368
329
  <FormattedMessage {...messages.videoSizeDescription} values={{size: bytes2Size(videoSize)}} />
369
330
  </CapHeading.CapHeadingSpan>
370
- </>
371
- )}
372
- {channel === WHATSAPP
373
- && (
331
+ </>}
332
+ {channel === WHATSAPP &&
374
333
  <>
375
334
  {getVideoSizeDescription()}
376
335
  <CapHeading.CapHeadingSpan type="label2" className="whatsapp-format">
377
336
  <FormattedMessage {...messages.channelFileFormat} values={{ format: SUPPORTED_FILE_FORMATS[DEFAULT] }} />
378
337
  </CapHeading.CapHeadingSpan>
379
- </>
380
- )}
381
- {channel === VIBER && (
338
+ </>}
339
+ {channel === VIBER &&
382
340
  <>
383
341
  {getVideoSizeDescription()}
384
342
  <CapHeading.CapHeadingSpan type="label2" className="whatsapp-format">
@@ -387,20 +345,7 @@ function CapVideoUpload(props) {
387
345
  <CapHeading.CapHeadingSpan type="label2" className="video-duration">
388
346
  <FormattedMessage {...messages.viberMaxDuration} />
389
347
  </CapHeading.CapHeadingSpan>
390
- </>
391
- )}
392
- {channel === MOBILEPUSH
393
- && (
394
- <>
395
- {getVideoSizeDescription()}
396
- <CapHeading.CapHeadingSpan type="label2" className="whatsapp-format">
397
- <FormattedMessage {...messages.channelFileFormat} values={{ format: SUPPORTED_FILE_FORMATS.MOBILEPUSH }} />
398
- </CapHeading.CapHeadingSpan>
399
- <CapHeading.CapHeadingSpan type="label2" className="video-duration">
400
- <FormattedMessage {...messages.maxDuration} />
401
- </CapHeading.CapHeadingSpan>
402
- </>
403
- )}
348
+ </>}
404
349
  </div>
405
350
  </CapSpin>
406
351
  );
@@ -421,8 +366,6 @@ CapVideoUpload.propTypes = {
421
366
  channel: PropTypes.string,
422
367
  errorMessage: PropTypes.string,
423
368
  formClassName: PropTypes.string,
424
- showReUploadButton: PropTypes.bool,
425
- mediaType: PropTypes.string,
426
369
  };
427
370
 
428
371
  export default injectIntl(CapVideoUpload);
@@ -63,24 +63,8 @@ export default defineMessages({
63
63
  id: `${scope}.viberMaxDuration`,
64
64
  defaultMessage: 'Max Duration: 600 seconds',
65
65
  },
66
- maxDuration: {
67
- id: `${scope}.maxDuration`,
68
- defaultMessage: 'Max duration: 600 seconds',
69
- },
70
66
  videoDurationError: {
71
67
  id: `${scope}.videoDurationError`,
72
68
  defaultMessage: 'Video duration should not exceed 600 seconds',
73
69
  },
74
- uploadVideo: {
75
- id: `${scope}.uploadVideo`,
76
- defaultMessage: 'Upload Video',
77
- },
78
- reUpload: {
79
- id: `${scope}.reUpload`,
80
- defaultMessage: 'Re-upload',
81
- },
82
- videoDuration: {
83
- id: `${scope}.videoDuration`,
84
- defaultMessage: 'Duration: {duration}',
85
- },
86
70
  });
@@ -1,11 +1,11 @@
1
- import React from "react";
2
- import { Carousel } from 'antd';
1
+ import React, { Component } from "react";
2
+ import { Carousel, Icon } from 'antd';
3
3
  import './style.scss';
4
4
  import CapImage from '@capillarytech/cap-ui-library/CapImage';
5
5
  import CapButton from '@capillarytech/cap-ui-library/CapButton';
6
6
  import CapIcon from '@capillarytech/cap-ui-library/CapIcon';
7
- import { CAP_WHITE } from '@capillarytech/cap-ui-library/styled/variables';
8
7
  const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
8
+ import { CAP_WHITE, CAP_G08 } from '@capillarytech/cap-ui-library/styled/variables';
9
9
 
10
10
  const arrowStyle = {
11
11
  background: 'rgba(0, 0, 0, 0.1)',
@@ -16,12 +16,10 @@ const arrowStyle = {
16
16
  height: 24,
17
17
  width: 24,
18
18
  borderRadius: '50%',
19
- };
19
+ }
20
20
 
21
- const Arrow = (props) => {
22
- const {
23
- className, style, onClick, extraStyle, type,
24
- } = props;
21
+ const Arrow = props => {
22
+ const { className, style, onClick, extraStyle, type } = props
25
23
  return (
26
24
  <CapButton
27
25
  className={className}
@@ -37,8 +35,8 @@ const Arrow = (props) => {
37
35
  type={type}
38
36
  />
39
37
  </CapButton>
40
- );
41
- };
38
+ )
39
+ }
42
40
 
43
41
  const settings = {
44
42
  nextArrow: (
@@ -58,7 +56,7 @@ const settings = {
58
56
  type="chevron-left"
59
57
  />
60
58
  ),
61
- };
59
+ }
62
60
 
63
61
  const CarouselComponent = ({
64
62
  imageCarousel,
@@ -83,11 +81,11 @@ const CarouselComponent = ({
83
81
 
84
82
  return (
85
83
  <div style={{ position: 'relative' }} className={`template-carousel ${imageCarouselLength ? 'single-img' : ''}`}>
86
- <Carousel ref={(node) => (carousel = node)} {...prop} {...settings}>
84
+ <Carousel ref={node => (carousel = node)} {...prop} {...settings}>
87
85
  {
88
86
  imageCarousel.map(({
89
87
  actionLabel,
90
- imageUrl = lineImgPlaceholder,
88
+ imageUrl = lineImgPlaceholder
91
89
  }) => (
92
90
  <div className="carousel-section">
93
91
  <CapImage
@@ -117,6 +115,6 @@ const CarouselComponent = ({
117
115
  </Carousel>
118
116
  </div>
119
117
  );
120
- };
118
+ }
121
119
 
122
- export default CarouselComponent;
120
+ export default CarouselComponent;
@@ -1,7 +1,6 @@
1
1
  @import "~@capillarytech/cap-ui-library/styles/_variables.scss";
2
2
 
3
3
  .error-container {
4
- width: max-content;
5
4
  margin-bottom: $CAP_SPACE_08;
6
5
  margin-top: $CAP_SPACE_12;
7
6
  background-color: $CAP_COLOR_05;
@@ -15,7 +15,6 @@ import { MOBILE_PUSH } from '../../v2Containers/CreativesContainer/constants';
15
15
  import { INAPP } from '../../v2Containers/App/constants';
16
16
  import { ANDROID, IOS } from '../../v2Containers/InApp/constants';
17
17
  import { getCtaObject } from '../../v2Containers/InApp/utils';
18
- import { VIDEO } from '../../v2Containers/MobilePushNew/constants';
19
18
 
20
19
  class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
21
20
  constructor(props) {
@@ -65,40 +64,14 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
65
64
  const androidContent = get(templateData, 'versions.base.ANDROID') || get(templateData, 'androidContent');
66
65
  const iosContent = get(templateData, 'versions.base.IOS') || get(templateData, 'iosContent');
67
66
 
68
- const data = device?.toLowerCase() === "android" ? androidContent : iosContent;
69
- const { title = '', message = '', expandableDetails: { ctas = [], image = '', media = [], carouselData = [] } = {}} = data || {};
70
-
71
- // Handle video/GIF content from expandableDetails.media array (new format)
72
- let bodyVideo = {};
73
- let bodyGif = '';
74
- let bodyImage = image;
75
-
76
- if (media && Array.isArray(media) && media.length > 0) {
77
- const mediaItem = media[0];
78
- if (mediaItem.type === VIDEO) {
79
- // Distinguish between actual video and GIF based on URL extension
80
- if (mediaItem.url && mediaItem.url.toLowerCase().includes('.gif')) {
81
- bodyGif = mediaItem.url;
82
- } else {
83
- bodyVideo = {
84
- videoSrc: mediaItem.url,
85
- videoPreview: mediaItem.url,
86
- };
87
- }
88
- // Clear bodyImage when we have video/GIF content
89
- bodyImage = '';
90
- }
91
- }
92
-
67
+ const data = device === "android" ? androidContent : iosContent;
68
+ const { title = '', message = '', expandableDetails: { ctas = [], image = '' } = {}} = data || {};
93
69
  content = {
94
70
  header: title,
95
71
  bodyText: message,
96
- bodyImage,
97
- bodyVideo,
98
- bodyGif,
72
+ bodyImage: image,
99
73
  actions: [],
100
74
  appName: templateData?.appName,
101
- carouselData,
102
75
  };
103
76
  if (ctas && ctas?.length) {
104
77
  if (device === "android" ) {
@@ -110,7 +83,6 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
110
83
  }
111
84
  return content;
112
85
  }
113
-
114
86
  getPreview(device) {
115
87
  const deviceParam = device === ANDROID.toLowerCase() ? ANDROID : IOS;
116
88
  return (
@@ -123,21 +95,17 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
123
95
  />
124
96
  );
125
97
  }
126
-
127
98
  goToDuplicate() {
128
99
  this.props.onDuplicateClick(this.props.templateData);
129
100
  this.props.handleClose();
130
101
  }
131
-
132
102
  changeDevice(device) {
133
103
  const content = this.setContent(this.props.templateData, device, this.props.channel);
134
104
  this.setState({device, content });
135
105
  }
136
-
137
106
  goToEdit(e, path) {
138
107
  this.props.onEditClick(e, this.props.templateData._id, this.props.templateData.modeType, path);
139
108
  }
140
-
141
109
  render() {
142
110
  const {templateData} = this.props;
143
111
  let hasAndroid;
@@ -153,8 +121,8 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
153
121
  return (
154
122
  <div>
155
123
  <div className="devices">
156
- {!isEmpty(templateData)
157
- && ( hasBothAndroidAndIos ? (
124
+ {!isEmpty(templateData) &&
125
+ ( hasBothAndroidAndIos ? (
158
126
  <CapTab
159
127
  panes={[
160
128
  {