@capillarytech/creatives-library 7.12.73 → 7.12.75
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
CHANGED
|
@@ -1,114 +1,154 @@
|
|
|
1
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
2
|
+
/* eslint-disable no-unused-expressions */
|
|
1
3
|
import { parse } from 'node-html-parser';
|
|
2
4
|
|
|
3
|
-
// const sample = {
|
|
4
|
-
// versions: {
|
|
5
|
-
// base: {
|
|
6
|
-
// activeTab: "en",
|
|
7
|
-
// en: {
|
|
8
|
-
// "lang_id": 69,
|
|
9
|
-
// "iso_code": "en",
|
|
10
|
-
// "language": "English",
|
|
11
|
-
// "template-content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><!--[if !mso]><!--><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n\t<title></title>\n\t<!--[if !mso]><!--><!--<![endif]-->\n\t<style type=\"text/css\">body {\n margin: 0;\n padding: 0; }\n\ntable,\ntd,\ntr {\n vertical-align: top;\n border-collapse: collapse; }\n\n* {\n line-height: inherit; }\n\na[x-apple-data-detectors=true] {\n color: inherit !important;\n text-decoration: none !important; }\n\t</style>\n\t<style id=\"media-query\" type=\"text/css\">@media (max-width: 520px) {\n .block-grid,\n.col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n\n .block-grid {\n width: 100% !important;\n }\n\n .col {\n width: 100% !important;\n }\n\n .col > div {\n margin: 0 auto;\n }\n\n img.fullwidth,\nimg.fullwidthOnMobile {\n max-width: 100% !important;\n }\n\n .no-stack .col {\n min-width: 0 !important;\n display: table-cell !important;\n }\n\n .no-stack.two-up .col {\n width: 50% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num8 {\n width: 66% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num3 {\n width: 25% !important;\n }\n\n .no-stack .col.num6 {\n width: 50% !important;\n }\n\n .no-stack .col.num9 {\n width: 75% !important;\n }\n\n .video-block {\n max-width: none !important;\n }\n\n .mobile_hide {\n min-height: 0px;\n max-height: 0px;\n max-width: 0px;\n display: none;\n overflow: hidden;\n font-size: 0px;\n }\n\n .desktop_hide {\n display: block !important;\n max-height: none !important;\n }\n}\n\t</style>\n</head>\n<body class=\"clean-body\" style=\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\"><!--[if IE]><div class=\"ie-browser\"><![endif]-->\n<p>asdf</p>\n\n<table bgcolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" class=\"nl-container\" role=\"presentation\" style=\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\" valign=\"top\">\n\t<tbody>\n\t\t<tr style=\"vertical-align:top\" valign=\"top\">\n\t\t\t<td style=\"vertical-align:top; word-break:break-word\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color:#FFFFFF\"><![endif]-->\n\t\t\t<div style=\"background-color:transparent\">\n\t\t\t<div class=\"block-grid\" style=\"background-color:transparent; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\">\n\t\t\t<div style=\"background-color:transparent; border-collapse:collapse; display:table; width:100%\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:transparent;\"><tr><td align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px\"><tr class=\"layout-full-width\" style=\"background-color:transparent\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;\"><![endif]-->\n\t\t\t<div class=\"col num12\" style=\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\">\n\t\t\t<div style=\"width:100% !important\"><!--[if (!mso)&(!IE)]><!-->\n\t\t\t<div style=\"border-bottom:0px solid transparent; border-left:0px solid transparent; border-right:0px solid transparent; border-top:0px solid transparent; padding-bottom:5px; padding-left:0px; padding-right:0px; padding-top:5px\"><!--<![endif]--><!--[if (!mso)&(!IE)]><!--></div>\n\t\t\t<!--<![endif]--></div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>\n\t\t</tr>\n\t</tbody>\n</table>\n<!--[if (IE)]></div><![endif]--></body>\n</html>\n",
|
|
12
|
-
// "drag_drop_id": "",
|
|
13
|
-
// "tabKey": "5",
|
|
14
|
-
// },
|
|
15
|
-
// selectedLanguages: [
|
|
16
|
-
// "en",
|
|
17
|
-
// ],
|
|
18
|
-
// base: true,
|
|
19
|
-
// tabKey: "5",
|
|
20
|
-
// subject: "asdf",
|
|
21
|
-
// },
|
|
22
|
-
// history: [
|
|
23
|
-
// {
|
|
24
|
-
// activeTab: "en",
|
|
25
|
-
// en: {
|
|
26
|
-
// "lang_id": 69,
|
|
27
|
-
// "iso_code": "en",
|
|
28
|
-
// "language": "English",
|
|
29
|
-
// "template-content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">\n<head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><!--[if !mso]><!--><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]-->\n\t<title></title>\n\t<!--[if !mso]><!--><!--<![endif]-->\n\t<style type=\"text/css\">body {\n margin: 0;\n padding: 0; }\n\ntable,\ntd,\ntr {\n vertical-align: top;\n border-collapse: collapse; }\n\n* {\n line-height: inherit; }\n\na[x-apple-data-detectors=true] {\n color: inherit !important;\n text-decoration: none !important; }\n\t</style>\n\t<style id=\"media-query\" type=\"text/css\">@media (max-width: 520px) {\n .block-grid,\n.col {\n min-width: 320px !important;\n max-width: 100% !important;\n display: block !important;\n }\n\n .block-grid {\n width: 100% !important;\n }\n\n .col {\n width: 100% !important;\n }\n\n .col > div {\n margin: 0 auto;\n }\n\n img.fullwidth,\nimg.fullwidthOnMobile {\n max-width: 100% !important;\n }\n\n .no-stack .col {\n min-width: 0 !important;\n display: table-cell !important;\n }\n\n .no-stack.two-up .col {\n width: 50% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num8 {\n width: 66% !important;\n }\n\n .no-stack .col.num4 {\n width: 33% !important;\n }\n\n .no-stack .col.num3 {\n width: 25% !important;\n }\n\n .no-stack .col.num6 {\n width: 50% !important;\n }\n\n .no-stack .col.num9 {\n width: 75% !important;\n }\n\n .video-block {\n max-width: none !important;\n }\n\n .mobile_hide {\n min-height: 0px;\n max-height: 0px;\n max-width: 0px;\n display: none;\n overflow: hidden;\n font-size: 0px;\n }\n\n .desktop_hide {\n display: block !important;\n max-height: none !important;\n }\n}\n\t</style>\n</head>\n<body class=\"clean-body\" style=\"margin: 0; padding: 0; -webkit-text-size-adjust: 100%; background-color: #FFFFFF;\"><!--[if IE]><div class=\"ie-browser\"><![endif]-->\n<p>asdf</p>\n\n<table bgcolor=\"#FFFFFF\" cellpadding=\"0\" cellspacing=\"0\" class=\"nl-container\" role=\"presentation\" style=\"background-color:#ffffff; border-collapse:collapse; border-spacing:0; margin:0 auto; min-width:320px; mso-table-lspace:0pt; mso-table-rspace:0pt; table-layout:fixed; vertical-align:top; width:100%\" valign=\"top\">\n\t<tbody>\n\t\t<tr style=\"vertical-align:top\" valign=\"top\">\n\t\t\t<td style=\"vertical-align:top; word-break:break-word\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td align=\"center\" style=\"background-color:#FFFFFF\"><![endif]-->\n\t\t\t<div style=\"background-color:transparent\">\n\t\t\t<div class=\"block-grid\" style=\"background-color:transparent; margin-bottom:0px; margin-left:0px; margin-right:0px; margin-top:0px; max-width:500px; min-width:320px; overflow-wrap:break-word; word-break:break-word; word-wrap:break-word\">\n\t\t\t<div style=\"background-color:transparent; border-collapse:collapse; display:table; width:100%\"><!--[if (mso)|(IE)]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:transparent;\"><tr><td align=\"center\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width:500px\"><tr class=\"layout-full-width\" style=\"background-color:transparent\"><![endif]--><!--[if (mso)|(IE)]><td align=\"center\" width=\"500\" style=\"background-color:transparent;width:500px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;\" valign=\"top\"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px;\"><![endif]-->\n\t\t\t<div class=\"col num12\" style=\"display:table-cell; max-width:500px; min-width:320px; vertical-align:top; width:500px\">\n\t\t\t<div style=\"width:100% !important\"><!--[if (!mso)&(!IE)]><!-->\n\t\t\t<div style=\"border-bottom:0px solid transparent; border-left:0px solid transparent; border-right:0px solid transparent; border-top:0px solid transparent; padding-bottom:5px; padding-left:0px; padding-right:0px; padding-top:5px\"><!--<![endif]--><!--[if (!mso)&(!IE)]><!--></div>\n\t\t\t<!--<![endif]--></div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--><!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]--></div>\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--[if (mso)|(IE)]></td></tr></table><![endif]--></td>\n\t\t</tr>\n\t</tbody>\n</table>\n<!--[if (IE)]></div><![endif]--></body>\n</html>\n",
|
|
30
|
-
// "drag_drop_id": "",
|
|
31
|
-
// "tabKey": "5",
|
|
32
|
-
// },
|
|
33
|
-
// selectedLanguages: [
|
|
34
|
-
// "en",
|
|
35
|
-
// ],
|
|
36
|
-
// base: true,
|
|
37
|
-
// tabKey: "5",
|
|
38
|
-
// subject: "asdf",
|
|
39
|
-
// },
|
|
40
|
-
// ],
|
|
41
|
-
// },
|
|
42
|
-
// type: "EMAIL",
|
|
43
|
-
// name: "asdf",
|
|
44
|
-
// };
|
|
45
|
-
|
|
46
|
-
|
|
47
5
|
// https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=100,height=100,quality=75,fit=cover,g=top,format=auto/intouch_creative_assets/005710a7-6412-44fe-a19f-e72456b1.jpg
|
|
48
6
|
|
|
49
|
-
const CDN_BASE_URL = `https://storage.crm.n.content-cdn.io
|
|
7
|
+
const CDN_BASE_URL = `https://storage.crm.n.content-cdn.io`;
|
|
8
|
+
const CDN_TRANSFORMATION_URL_SUFFIX = `/cdn-cgi/image/`;
|
|
50
9
|
const QUALITY = 75;
|
|
51
|
-
const regex = /intouch_creative_assets
|
|
10
|
+
const regex = /https:\/\/.*intouch_creative_assets.*(?:jpg|png|jpeg|gif)$/;
|
|
11
|
+
const INTOUCH_CREATIVE_ASSETS = 'intouch_creative_assets';
|
|
52
12
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (isAsset) {
|
|
59
|
-
const height = element.getAttribute('height');
|
|
60
|
-
const width = element.getAttribute('width');
|
|
61
|
-
const [, assetKey] = imageSrc.split(regex);
|
|
13
|
+
/**
|
|
14
|
+
* getCdnUrl : utility function to replace and return s3/cdn url with cdn url.
|
|
15
|
+
*/
|
|
16
|
+
export const getCdnUrl = ({url, height, width, transformationEnabled = false, reduceQuality = true}) => {
|
|
17
|
+
if (!url.includes(INTOUCH_CREATIVE_ASSETS)) return url;
|
|
62
18
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
newUrl +=
|
|
72
|
-
element.setAttribute('src', newUrl);
|
|
19
|
+
const [, assetKey] = url.split(INTOUCH_CREATIVE_ASSETS);
|
|
20
|
+
let newUrl = `${CDN_BASE_URL}`;
|
|
21
|
+
if (transformationEnabled || reduceQuality) {
|
|
22
|
+
newUrl += CDN_TRANSFORMATION_URL_SUFFIX;
|
|
23
|
+
if (height) {
|
|
24
|
+
newUrl += `height=${height},`;
|
|
25
|
+
}
|
|
26
|
+
if (width) {
|
|
27
|
+
newUrl += `width=${width},`;
|
|
73
28
|
}
|
|
74
|
-
|
|
75
|
-
|
|
29
|
+
newUrl += `quality=${QUALITY}`;
|
|
30
|
+
}
|
|
31
|
+
newUrl += `/intouch_creative_assets${assetKey}`;
|
|
32
|
+
return newUrl;
|
|
76
33
|
};
|
|
77
34
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {*} htmlContents
|
|
38
|
+
* @returns htmlContents with updated urls in image tag
|
|
39
|
+
*/
|
|
40
|
+
export const updateImagesInHtml = (htmlContents) => {
|
|
41
|
+
const copiedHtmlContents = htmlContents;
|
|
42
|
+
try {
|
|
43
|
+
const root = parse(htmlContents);
|
|
44
|
+
root.querySelectorAll('img').forEach((element) => {
|
|
45
|
+
const imageSrc = element.getAttribute('src');
|
|
46
|
+
const isAsset = regex.test(imageSrc);
|
|
47
|
+
if (isAsset) {
|
|
48
|
+
const height = element.getAttribute('height');
|
|
49
|
+
const width = element.getAttribute('width');
|
|
50
|
+
const newUrl = getCdnUrl({url: imageSrc, height, width, transformationEnabled: true, reduceQuality: true});
|
|
51
|
+
element.setAttribute('src', newUrl);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
return root.toString();
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.log('An error occured while updating images in html', e);
|
|
57
|
+
return copiedHtmlContents; //return received input directly in case an exception is thrown
|
|
58
|
+
}
|
|
91
59
|
};
|
|
92
60
|
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param {*} contents
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
export const transformEmailTemplates = (contents) => {
|
|
67
|
+
const contentsCopy = cloneDeep(contents);
|
|
68
|
+
try {
|
|
69
|
+
const base = contentsCopy?.versions?.base;
|
|
70
|
+
const languages = base?.selectedLanguages;
|
|
71
|
+
languages?.forEach((lang) => {
|
|
72
|
+
const htmlContents = base?.[lang]?.['template-content'];
|
|
73
|
+
const newHtmlContents = updateImagesInHtml(htmlContents);
|
|
74
|
+
base[lang]['template-content'] = newHtmlContents;
|
|
75
|
+
});
|
|
76
|
+
return contentsCopy;
|
|
77
|
+
} catch (e) {
|
|
78
|
+
console.log('Some error has occured while transforming email templates', e);
|
|
79
|
+
return contents; //return received input directly in case an exception is thrown
|
|
80
|
+
}
|
|
81
|
+
};
|
|
93
82
|
|
|
94
|
-
// export const
|
|
95
|
-
//
|
|
96
|
-
// switch(channel){
|
|
97
|
-
// case 'EMAIL':
|
|
98
|
-
// newTemplateData = transformEmailTemplates(templateData);
|
|
99
|
-
// break;
|
|
100
|
-
// default:
|
|
101
|
-
// break;
|
|
102
|
-
// }
|
|
103
|
-
// return newTemplateData;
|
|
83
|
+
// export const transformRcsTemplates = (contents) => {
|
|
84
|
+
// const contentsCopy = cloneDeep(contents);
|
|
104
85
|
// }
|
|
105
86
|
|
|
106
87
|
|
|
107
88
|
// {
|
|
108
|
-
// "
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
// "
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
89
|
+
// "name": "test 1",
|
|
90
|
+
// "versions": {
|
|
91
|
+
// "base": {
|
|
92
|
+
// "content": {
|
|
93
|
+
// "RCS": {
|
|
94
|
+
// "cardContent": [
|
|
95
|
+
// {
|
|
96
|
+
// "title": "asdf",
|
|
97
|
+
// "description": "asdf",
|
|
98
|
+
// "mediaType": "NONE"
|
|
99
|
+
// }
|
|
100
|
+
// ],
|
|
101
|
+
// "cardSettings": {
|
|
102
|
+
// "cardOrientation": "VERTICAL"
|
|
103
|
+
// },
|
|
104
|
+
// "cardType": "STANDALONE",
|
|
105
|
+
// "contentType": "RICHCARD",
|
|
106
|
+
// "smsFallBackContent": {
|
|
107
|
+
// "message": ""
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
// },
|
|
113
|
+
// "type": "RCS"
|
|
114
|
+
// }
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
// {
|
|
118
|
+
// "name": "test 2",
|
|
119
|
+
// "versions": {
|
|
120
|
+
// "base": {
|
|
121
|
+
// "content": {
|
|
122
|
+
// "RCS": {
|
|
123
|
+
// "cardContent": [
|
|
124
|
+
// {
|
|
125
|
+
// "title": "asdfasdf",
|
|
126
|
+
// "description": "asdfadsf",
|
|
127
|
+
// "mediaType": "IMAGE",
|
|
128
|
+
// "suggestions": [
|
|
129
|
+
// {
|
|
130
|
+
// "type": "CTA",
|
|
131
|
+
// "text": "fasdf",
|
|
132
|
+
// "url": "https://www.google.com"
|
|
133
|
+
// }
|
|
134
|
+
// ],
|
|
135
|
+
// "media": {
|
|
136
|
+
// "mediaUrl": "https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/820a9ff9-ad5b-410e-b471-75c2e1a9.jpg",
|
|
137
|
+
// "height": "MEDIUM"
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
140
|
+
// ],
|
|
141
|
+
// "cardSettings": {
|
|
142
|
+
// "cardOrientation": "VERTICAL"
|
|
143
|
+
// },
|
|
144
|
+
// "cardType": "STANDALONE",
|
|
145
|
+
// "contentType": "RICHCARD",
|
|
146
|
+
// "smsFallBackContent": {
|
|
147
|
+
// "message": "asdf"
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
// },
|
|
153
|
+
// "type": "RCS"
|
|
154
|
+
// }
|
|
@@ -454,9 +454,6 @@ export class Creatives extends React.Component {
|
|
|
454
454
|
|
|
455
455
|
getCreativesData = (channel, template, templateRecords) => {
|
|
456
456
|
//from creatives to consumers
|
|
457
|
-
console.log('hello channel', channel)
|
|
458
|
-
console.log('hello template', template)
|
|
459
|
-
console.log('hello templateRecords', templateRecords)
|
|
460
457
|
let templateData = { channel };
|
|
461
458
|
switch (channel) {
|
|
462
459
|
case constants.SMS:
|
|
@@ -500,7 +497,6 @@ export class Creatives extends React.Component {
|
|
|
500
497
|
delete templateData.html_content;
|
|
501
498
|
delete templateData.subject;
|
|
502
499
|
}
|
|
503
|
-
console.log('final template data: ', templateData)
|
|
504
500
|
break;
|
|
505
501
|
case constants.MOBILE_PUSH:
|
|
506
502
|
if (get(template, "value.versions.base")) {
|
|
@@ -706,7 +702,6 @@ export class Creatives extends React.Component {
|
|
|
706
702
|
default:
|
|
707
703
|
break;
|
|
708
704
|
}
|
|
709
|
-
const newTemplateData = updateUrlInTemplate(channel, templateData);
|
|
710
705
|
return templateData;
|
|
711
706
|
};
|
|
712
707
|
getSlideBoxContent({mode, templateData, isFullMode}) {
|
|
@@ -81,6 +81,9 @@ import Templates from '../Templates';
|
|
|
81
81
|
import SmsTraiEdit from '../SmsTrai/Edit';
|
|
82
82
|
import TagList from '../TagList';
|
|
83
83
|
import { validateTags } from '../../utils/tagValidations';
|
|
84
|
+
|
|
85
|
+
import { getCdnUrl } from '../../utils/cdnTransformation';
|
|
86
|
+
|
|
84
87
|
const { Group: CapCheckboxGroup } = CapCheckbox;
|
|
85
88
|
export const Rcs = (props) => {
|
|
86
89
|
const {
|
|
@@ -900,7 +903,7 @@ export const Rcs = (props) => {
|
|
|
900
903
|
...(suggestions.length > 0 && { suggestions }),
|
|
901
904
|
...(!isMediaTypeNone && {
|
|
902
905
|
media: {
|
|
903
|
-
mediaUrl: rcsImageSrc,
|
|
906
|
+
mediaUrl: getCdnUrl({url: rcsImageSrc}),
|
|
904
907
|
height: MEDIUM,
|
|
905
908
|
},
|
|
906
909
|
}),
|
|
@@ -74,6 +74,8 @@ import {
|
|
|
74
74
|
PHONE_NUMBER,
|
|
75
75
|
WEBSITE,
|
|
76
76
|
} from '../../v2Components/CapWhatsappCTA/constants';
|
|
77
|
+
import { getCdnUrl } from '../../utils/cdnTransformation';
|
|
78
|
+
|
|
77
79
|
let varMap = {};
|
|
78
80
|
let editContent = {};
|
|
79
81
|
let tagValidationResponse = {};
|
|
@@ -855,7 +857,7 @@ export const Whatsapp = (props) => {
|
|
|
855
857
|
}),
|
|
856
858
|
mediaType: templateMediaType,
|
|
857
859
|
...(isMediaTypeImage && {
|
|
858
|
-
imageUrl: whatsappImageSrc,
|
|
860
|
+
imageUrl: getCdnUrl({url: whatsappImageSrc}),
|
|
859
861
|
karixFileHandle,
|
|
860
862
|
}),
|
|
861
863
|
varMapped: !isFullMode ? varMap : {},
|