@capillarytech/creatives-library 7.16.2 → 7.16.3

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 (29) hide show
  1. package/containers/Assets/Gallery/messages.js +1 -1
  2. package/containers/Cap/tests/__snapshots__/index.test.js.snap +4 -4
  3. package/containers/Email/messages.js +1 -1
  4. package/package.json +1 -1
  5. package/translations/en.json +4 -4
  6. package/utils/common.js +13 -0
  7. package/utils/tests/v2Common.test.js +22 -2
  8. package/v2Components/CapDocumentUpload/index.js +6 -3
  9. package/v2Components/CapImageUpload/index.js +4 -2
  10. package/v2Components/CapVideoUpload/index.js +4 -3
  11. package/v2Components/FormBuilder/index.js +5 -3
  12. package/v2Containers/App/constants.js +1 -0
  13. package/v2Containers/Assets/Gallery/index.js +21 -3
  14. package/v2Containers/Assets/Gallery/messages.js +1 -1
  15. package/v2Containers/Cap/messages.js +4 -0
  16. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +4 -4
  17. package/v2Containers/Email/messages.js +1 -1
  18. package/v2Containers/Line/Container/Image/index.js +4 -2
  19. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3397 -12
  20. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +8 -8
  21. package/v2Containers/Line/Container/ImageMap/index.js +4 -2
  22. package/v2Containers/Line/Container/Video/index.js +4 -2
  23. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +68 -68
  24. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +72 -72
  25. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +188 -188
  26. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +16 -16
  27. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +32 -32
  28. package/v2Containers/Viber/index.js +4 -2
  29. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +284 -284
@@ -76,7 +76,7 @@ export default defineMessages({
76
76
  },
77
77
  assetUploadFailed: {
78
78
  id: 'creatives.containers.Assets.Gallery.assetUploadFailed',
79
- defaultMessage: 'Image uploaded failed',
79
+ defaultMessage: 'Image upload failed',
80
80
  },
81
81
  assetDeleteSuccess: {
82
82
  id: 'creatives.containers.Assets.Gallery.assetDeleteSuccess',
@@ -323,7 +323,7 @@ exports[`<Cap /> should render its children 1`] = `
323
323
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
324
324
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
325
325
  "creatives.containers.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
326
- "creatives.containers.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
326
+ "creatives.containers.Assets.Gallery.assetUploadFailed": "Image upload failed",
327
327
  "creatives.containers.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
328
328
  "creatives.containers.Assets.Gallery.backToGallery": "Back to image gallery",
329
329
  "creatives.containers.Assets.Gallery.delete": "Delete",
@@ -470,7 +470,7 @@ exports[`<Cap /> should render its children 1`] = `
470
470
  "creatives.containers.Email.Tags": "Tags",
471
471
  "creatives.containers.Email.alphabetically": "Alphabetically",
472
472
  "creatives.containers.Email.alphabeticallyOption": "Alphabetically",
473
- "creatives.containers.Email.assetUploadFailed": "Image uploaded failed",
473
+ "creatives.containers.Email.assetUploadFailed": "Image upload failed",
474
474
  "creatives.containers.Email.blankTemplate": "Blank template",
475
475
  "creatives.containers.Email.cancel": "Cancel",
476
476
  "creatives.containers.Email.createHeading": "Create email template",
@@ -875,7 +875,7 @@ exports[`<Cap /> should render its children 1`] = `
875
875
  "creatives.containersV2.Assets.Gallery.alphabetically": "Alphabetically",
876
876
  "creatives.containersV2.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
877
877
  "creatives.containersV2.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
878
- "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
878
+ "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image upload failed",
879
879
  "creatives.containersV2.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
880
880
  "creatives.containersV2.Assets.Gallery.backToGallery": "Back to image gallery",
881
881
  "creatives.containersV2.Assets.Gallery.delete": "Delete",
@@ -1133,7 +1133,7 @@ exports[`<Cap /> should render its children 1`] = `
1133
1133
  "creatives.containersV2.Email.alertMessage": "Alert",
1134
1134
  "creatives.containersV2.Email.alphabetically": "Alphabetically",
1135
1135
  "creatives.containersV2.Email.alphabeticallyOption": "Alphabetically",
1136
- "creatives.containersV2.Email.assetUploadFailed": "Image uploaded failed",
1136
+ "creatives.containersV2.Email.assetUploadFailed": "Image upload failed",
1137
1137
  "creatives.containersV2.Email.blankTemplate": "Blank template",
1138
1138
  "creatives.containersV2.Email.cancel": "Cancel",
1139
1139
  "creatives.containersV2.Email.copyPrimaryLanguage": "Copy Primary Language",
@@ -228,7 +228,7 @@ export default defineMessages({
228
228
  },
229
229
  "assetUploadFailed": {
230
230
  id: 'creatives.containers.Email.assetUploadFailed',
231
- defaultMessage: 'Image uploaded failed',
231
+ defaultMessage: 'Image upload failed',
232
232
  },
233
233
  "goBackConfirmation": {
234
234
  id: 'creatives.containers.Email.Create.goBackConfirmation',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.16.2",
4
+ "version": "7.16.3",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -281,7 +281,7 @@
281
281
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
282
282
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
283
283
  "creatives.containers.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
284
- "creatives.containers.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
284
+ "creatives.containers.Assets.Gallery.assetUploadFailed": "Image upload failed",
285
285
  "creatives.containers.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
286
286
  "creatives.containers.Assets.Gallery.backToGallery": "Back to image gallery",
287
287
  "creatives.containers.Assets.Gallery.delete": "Delete",
@@ -428,7 +428,7 @@
428
428
  "creatives.containers.Email.Tags": "Tags",
429
429
  "creatives.containers.Email.alphabetically": "Alphabetically",
430
430
  "creatives.containers.Email.alphabeticallyOption": "Alphabetically",
431
- "creatives.containers.Email.assetUploadFailed": "Image uploaded failed",
431
+ "creatives.containers.Email.assetUploadFailed": "Image upload failed",
432
432
  "creatives.containers.Email.blankTemplate": "Blank template",
433
433
  "creatives.containers.Email.cancel": "Cancel",
434
434
  "creatives.containers.Email.createHeading": "Create email template",
@@ -833,7 +833,7 @@
833
833
  "creatives.containersV2.Assets.Gallery.alphabetically": "Alphabetically",
834
834
  "creatives.containersV2.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
835
835
  "creatives.containersV2.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
836
- "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
836
+ "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image upload failed",
837
837
  "creatives.containersV2.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
838
838
  "creatives.containersV2.Assets.Gallery.backToGallery": "Back to image gallery",
839
839
  "creatives.containersV2.Assets.Gallery.delete": "Delete",
@@ -1091,7 +1091,7 @@
1091
1091
  "creatives.containersV2.Email.alertMessage": "Alert",
1092
1092
  "creatives.containersV2.Email.alphabetically": "Alphabetically",
1093
1093
  "creatives.containersV2.Email.alphabeticallyOption": "Alphabetically",
1094
- "creatives.containersV2.Email.assetUploadFailed": "Image uploaded failed",
1094
+ "creatives.containersV2.Email.assetUploadFailed": "Image upload failed",
1095
1095
  "creatives.containersV2.Email.blankTemplate": "Blank template",
1096
1096
  "creatives.containersV2.Email.cancel": "Cancel",
1097
1097
  "creatives.containersV2.Email.copyPrimaryLanguage": "Copy Primary Language",
package/utils/common.js CHANGED
@@ -262,3 +262,16 @@ export const isTraiDLTEnable = (isFullMode, smsRegister) => {
262
262
  const isTraiDltFeature = isTraiDltFeatureForOrg && isTraiEnableforLib;
263
263
  return isTraiDltFeature;
264
264
  };
265
+
266
+ export function createNewFile(fileObject) {
267
+ const encodedName = fileObject.name.replace(/(.+?)(\.[^.]*$|$)/, (match, name, extension) => {
268
+ const filename = encodeURIComponent(name);
269
+ return filename + extension;
270
+ });
271
+ const { type, ...rest } = fileObject;
272
+ const newFile = new File([fileObject], encodedName, { type, ...rest });
273
+ newFile.uid = fileObject.uid;
274
+
275
+ return newFile;
276
+ }
277
+
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { getObjFromQueryParams } from '../v2common';
3
-
2
+ import { getObjFromQueryParams} from '../v2common';
3
+ import {createNewFile} from '../common';
4
4
  describe('Test v2common container', () => {
5
5
  it('test getObjFromQueryParams', () => {
6
6
  expect(getObjFromQueryParams("?channel=WHATSAPP&mode=CREATE")).toEqual({
@@ -9,3 +9,23 @@ describe('Test v2common container', () => {
9
9
  });
10
10
  });
11
11
  });
12
+
13
+ describe('Test createNewFile function', () => {
14
+ it('should create a new file with encoded name', () => {
15
+ const tempFile = {
16
+ name: '#image.png',
17
+ type: 'image/jpeg',
18
+ size: 2048,
19
+ uid: 'def456',
20
+ };
21
+
22
+ const expectedFile = new File([tempFile], '%23image.png', {
23
+ type: 'image/jpeg',
24
+ size: 2048,
25
+ uid: 'def456',
26
+ });
27
+ const result = createNewFile(tempFile);
28
+ expect(result).toMatchObject(expectedFile);
29
+ });
30
+ });
31
+
@@ -13,6 +13,7 @@ import isEmpty from 'lodash/isEmpty';
13
13
  import './index.scss';
14
14
  import messages from './messages';
15
15
  import { convertPdfToImages } from '../WhatsappDocumentPreview/index';
16
+ import { createNewFile } from '../../utils/common';
16
17
 
17
18
  function CapDocumentUpload(props) {
18
19
  const {
@@ -39,7 +40,7 @@ function CapDocumentUpload(props) {
39
40
  const { secure_file_path = '', karixFileHandle = '', name = '', file_size = ''} = get(docDataObj, 'metaInfo', {});
40
41
  setWhatsappDocParams({
41
42
  ...whatsappDocParams,
42
- whatsappDocName: `${name.slice(0, -13)}.pdf`,
43
+ whatsappDocName: `${decodeURIComponent(name.slice(0, -13))}.pdf`,
43
44
  //sliced to show the actual name of the pdf to the user and in the preview, this remove suffix appended to the name on creatives node side
44
45
  whatsappDocSize: file_size,
45
46
  });
@@ -70,10 +71,11 @@ function CapDocumentUpload(props) {
70
71
  }
71
72
  const _URL = window.URL || window.webkitURL;
72
73
  let incorrectFile = false;
73
- const file = files[0];
74
- if (!allowedExtensionsRegex.test(file.name)) {
74
+ const tempFile = files[0];
75
+ if (!allowedExtensionsRegex.test(tempFile?.name)) {
75
76
  incorrectFile = true;
76
77
  }
78
+ const file = createNewFile(tempFile);
77
79
  const doc = new FileReader();
78
80
  doc.src = _URL.createObjectURL(file);
79
81
  const fileParams = {
@@ -86,6 +88,7 @@ function CapDocumentUpload(props) {
86
88
  ...whatsappDocParams,
87
89
  whatsappDocImg: data?.image,
88
90
  whatsappDocPages: data?.numberOfPages,
91
+ nameEncoded: true,
89
92
  })
90
93
  );
91
94
  submitAction({file, type: 'document', fileParams}, incorrectFile);
@@ -23,6 +23,7 @@ import Gallery from '../../v2Containers/Assets/Gallery';
23
23
  import { FACEBOOK, RCS, WHATSAPP } from "../../v2Containers/CreativesContainer/constants";
24
24
 
25
25
  import messages from './messages';
26
+ import { createNewFile } from '../../utils/common';
26
27
  function CapImageUpload(props) {
27
28
  const {
28
29
  intl,
@@ -79,10 +80,11 @@ function CapImageUpload(props) {
79
80
  }
80
81
  const _URL = window.URL || window.webkitURL;
81
82
  let incorrectFile = false;
82
- const file = files[0];
83
- if (!allowedExtensionsRegex.test(file.name)) {
83
+ const tempFile = files[0];
84
+ if (!allowedExtensionsRegex.test(tempFile?.name)) {
84
85
  incorrectFile = true;
85
86
  }
87
+ const file = createNewFile(tempFile);
86
88
  const img = new Image();
87
89
  img.src = _URL.createObjectURL(file);
88
90
  img.onload = () => {
@@ -18,7 +18,7 @@ import {
18
18
  CapSpin,
19
19
  } from '@capillarytech/cap-ui-library';
20
20
  import messages from './messages';
21
- import {bytes2Size} from '../../utils/common';
21
+ import {bytes2Size, createNewFile} from '../../utils/common';
22
22
  import { WHATSAPP } from './constants';
23
23
  import './index.scss';
24
24
 
@@ -65,10 +65,11 @@ function CapVideoUpload(props) {
65
65
  }
66
66
  const _URL = window.URL || window.webkitURL;
67
67
  let incorrectFile = false;
68
- const file = files[0];
69
- if (!allowedExtensionsRegex.test(file.name)) {
68
+ const tempFile = files[0];
69
+ if (!allowedExtensionsRegex.test(tempFile?.name)) {
70
70
  incorrectFile = true;
71
71
  }
72
+ const file = createNewFile(tempFile);
72
73
  const video = new FileReader();
73
74
  video.src = _URL.createObjectURL(file);
74
75
  const fileParams = {
@@ -30,6 +30,7 @@ import { SMS, LINE } from '../../v2Containers/CreativesContainer/constants';
30
30
  import { validateIfTagClosed } from '../../utils/tagValidations';
31
31
  import globalMessages from '../../v2Containers/Cap/messages';
32
32
  import { convert } from 'html-to-text';
33
+ import { createNewFile } from '../../utils/common';
33
34
  const TabPane = Tabs.TabPane;
34
35
  const {Column} = Table;
35
36
  const {TextArea} = CapInput;
@@ -2161,13 +2162,14 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2161
2162
  e.preventDefault();
2162
2163
  }
2163
2164
  const _URL = window.URL || window.webkitURL;
2164
- const file = files[0];
2165
+ const tempFile = files[0];
2165
2166
  if (val.supportedExtensions) {
2166
2167
  const allowedExtensions = /(\.bmp|\.jpeg|\.png|\.gif|\.jpg)$/i;
2167
- if (!allowedExtensions.exec(file.name)) {
2168
- this.callChildEvent({file, type: 'wrong file'}, val, val.submitAction);
2168
+ if (!allowedExtensions.exec(tempFile?.name)) {
2169
+ this.callChildEvent({tempFile, type: 'wrong file'}, val, val.submitAction);
2169
2170
  }
2170
2171
  }
2172
+ const file = createNewFile(tempFile);
2171
2173
  const img = new Image();
2172
2174
  img.src = _URL.createObjectURL(file);
2173
2175
  img.onload = () => {
@@ -8,6 +8,7 @@ export const GET_SIDEBAR_FAILURE = 'app/App/GET_SIDEBAR_FAILURE';
8
8
 
9
9
  export const getTopbarMenuDataValue = () => ([
10
10
  { label: <FormattedMessage {...globalMessages.campaigns} />, link: '/campaigns/ui/list', key: 'campaigns' },
11
+ { label: <FormattedMessage {...globalMessages.journeys} />, link: '/journeys/ui', key: 'journeys' },
11
12
  { label: <FormattedMessage {...globalMessages.audience} />, link: '/audience-manager/list', key: 'audience' },
12
13
  { label: <FormattedMessage {...globalMessages.incentive} />, link: '/coupons/ui/', key: 'incentive' },
13
14
  { label: <FormattedMessage {...globalMessages.creatives} />, link: '/creatives/ui/v2', key: 'creatives' },
@@ -231,16 +231,18 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
231
231
  const _URL = window.URL || window.webkitURL;
232
232
  for (const file in files) {
233
233
  if (files.hasOwnProperty(file)) {
234
+ const tempFile = files[file];
235
+ const uploadFile = commonUtil.createNewFile(tempFile);
234
236
  const img = new Image();
235
237
  const that = this;
236
- img.src = _URL.createObjectURL(files[file]);
238
+ img.src = _URL.createObjectURL(uploadFile);
237
239
  img.onload = function () {
238
240
  const fileParams = {
239
241
  width: this.width,
240
242
  height: this.height,
241
243
  isGeneratePreview: true,
242
244
  };
243
- that.props.actions.uploadAsset(files[file], 'image', fileParams);
245
+ that.props.actions.uploadAsset(uploadFile, 'image', fileParams);
244
246
  };
245
247
  }
246
248
  }
@@ -307,6 +309,10 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
307
309
  const currentChannel = 'gallery';
308
310
  const { searchLoader, searchText } = this.state;
309
311
  const cardDataList = templates?.length ? _.map(templates, (template) => {
312
+ const nameParts = template.name.split('.');
313
+ if (encodeURIComponent(decodeURIComponent(nameParts[0])) === nameParts[0]) {
314
+ template.name = `${decodeURIComponent(nameParts[0])}.${nameParts[1]}`;
315
+ }
310
316
  const templateData =
311
317
  {
312
318
  key: `${currentChannel}-card-${template.name}`,
@@ -390,9 +396,21 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
390
396
  const by = commonUtil.getUserNameById(parseInt(this.state.selectedAsset.updatedBy, 10), commonUtil.getMergedUserList(this.props.Gallery.userList));
391
397
  const width = this.state.selectedAsset.metaInfo.width;
392
398
  const height = this.state.selectedAsset.metaInfo.height;
399
+ const nameParts = this.state.selectedAsset.name.split('.');
400
+ console.log(this.state.selectedAsset);
401
+ console.log(nameParts);
402
+ let updatedTitle = this.state.selectedAsset.name;
403
+ console.log(nameParts[0]);
404
+ try {
405
+ if (encodeURIComponent(decodeURIComponent(nameParts[0])) === nameParts[0]) {
406
+ updatedTitle = `${decodeURIComponent(nameParts[0])}.${nameParts[1]}`;
407
+ }
408
+ } catch (error) {
409
+ console.log('Error decoding the string:', error);
410
+ }
393
411
  const slideboxHeader = (<div>
394
412
  <CapHeader
395
- title={this.state.selectedAsset.name}
413
+ title={updatedTitle}
396
414
  description={<FormattedMessage
397
415
  {...messages.lastUpdated}
398
416
  values={{on, by }}
@@ -80,7 +80,7 @@ export default defineMessages({
80
80
  },
81
81
  assetUploadFailed: {
82
82
  id: 'creatives.containersV2.Assets.Gallery.assetUploadFailed',
83
- defaultMessage: 'Image uploaded failed',
83
+ defaultMessage: 'Image upload failed',
84
84
  },
85
85
  assetDeleteSuccess: {
86
86
  id: 'creatives.containersV2.Assets.Gallery.assetDeleteSuccess',
@@ -24,6 +24,10 @@ export default defineMessages({
24
24
  id: 'creatives.containersV2.Cap.campaigns',
25
25
  defaultMessage: 'Campaigns',
26
26
  },
27
+ "journeys": {
28
+ id: 'creatives.containersV2.Cap.journeys',
29
+ defaultMessage: 'Journeys',
30
+ },
27
31
  "loyalty": {
28
32
  id: 'creatives.containersV2.Cap.loyalty',
29
33
  defaultMessage: 'Loyalty',
@@ -356,7 +356,7 @@ exports[`<Cap /> should render correct component 1`] = `
356
356
  "creatives.containers.Assets.Gallery.alphabetically": "Alphabetically",
357
357
  "creatives.containers.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
358
358
  "creatives.containers.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
359
- "creatives.containers.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
359
+ "creatives.containers.Assets.Gallery.assetUploadFailed": "Image upload failed",
360
360
  "creatives.containers.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
361
361
  "creatives.containers.Assets.Gallery.backToGallery": "Back to image gallery",
362
362
  "creatives.containers.Assets.Gallery.delete": "Delete",
@@ -503,7 +503,7 @@ exports[`<Cap /> should render correct component 1`] = `
503
503
  "creatives.containers.Email.Tags": "Tags",
504
504
  "creatives.containers.Email.alphabetically": "Alphabetically",
505
505
  "creatives.containers.Email.alphabeticallyOption": "Alphabetically",
506
- "creatives.containers.Email.assetUploadFailed": "Image uploaded failed",
506
+ "creatives.containers.Email.assetUploadFailed": "Image upload failed",
507
507
  "creatives.containers.Email.blankTemplate": "Blank template",
508
508
  "creatives.containers.Email.cancel": "Cancel",
509
509
  "creatives.containers.Email.createHeading": "Create email template",
@@ -908,7 +908,7 @@ exports[`<Cap /> should render correct component 1`] = `
908
908
  "creatives.containersV2.Assets.Gallery.alphabetically": "Alphabetically",
909
909
  "creatives.containersV2.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
910
910
  "creatives.containersV2.Assets.Gallery.assetDeleteSuccess": "Image deleted successfully.",
911
- "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image uploaded failed",
911
+ "creatives.containersV2.Assets.Gallery.assetUploadFailed": "Image upload failed",
912
912
  "creatives.containersV2.Assets.Gallery.assetUploadSuccess": "Image uploaded successfully",
913
913
  "creatives.containersV2.Assets.Gallery.backToGallery": "Back to image gallery",
914
914
  "creatives.containersV2.Assets.Gallery.delete": "Delete",
@@ -1166,7 +1166,7 @@ exports[`<Cap /> should render correct component 1`] = `
1166
1166
  "creatives.containersV2.Email.alertMessage": "Alert",
1167
1167
  "creatives.containersV2.Email.alphabetically": "Alphabetically",
1168
1168
  "creatives.containersV2.Email.alphabeticallyOption": "Alphabetically",
1169
- "creatives.containersV2.Email.assetUploadFailed": "Image uploaded failed",
1169
+ "creatives.containersV2.Email.assetUploadFailed": "Image upload failed",
1170
1170
  "creatives.containersV2.Email.blankTemplate": "Blank template",
1171
1171
  "creatives.containersV2.Email.cancel": "Cancel",
1172
1172
  "creatives.containersV2.Email.copyPrimaryLanguage": "Copy Primary Language",
@@ -232,7 +232,7 @@ export default defineMessages({
232
232
  },
233
233
  "assetUploadFailed": {
234
234
  id: 'creatives.containersV2.Email.assetUploadFailed',
235
- defaultMessage: 'Image uploaded failed',
235
+ defaultMessage: 'Image upload failed',
236
236
  },
237
237
  "noImgInGallery": {
238
238
  id: 'creatives.containersV2.Email.noImgInGallery',
@@ -24,6 +24,7 @@ import {
24
24
  LINE_IMG_SIZE,
25
25
  ALLOWED_EXTENSIONS_REGEX,
26
26
  } from './constants';
27
+ import { createNewFile } from '../../../../utils/common';
27
28
 
28
29
  export const LineImage = ({
29
30
  className,
@@ -172,10 +173,11 @@ export const LineImage = ({
172
173
  }
173
174
  const _URL = window.URL || window.webkitURL;
174
175
  let incorrectFile = false;
175
- const file = files[0];
176
- if (!ALLOWED_EXTENSIONS_REGEX.test(file.name)) {
176
+ const tempFile = files[0];
177
+ if (!ALLOWED_EXTENSIONS_REGEX.test(tempFile?.name)) {
177
178
  incorrectFile = true;
178
179
  }
180
+ const file = createNewFile(tempFile);
179
181
  const img = new Image();
180
182
  img.src = _URL.createObjectURL(file);
181
183
  img.onload = () => {