@capillarytech/creatives-library 7.13.5 → 7.13.7
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 +2 -1
- package/routes.js +1 -0
- package/services/api.js +6 -1
- package/utils/cdnTransformation.js +369 -0
- package/utils/tests/__snapshots__/cdnTransformation.test.js.snap +298 -0
- package/utils/tests/cdnTransformation.mockdata.js +301 -0
- package/utils/tests/cdnTransformation.test.js +245 -0
- package/v2Containers/Cap/actions.js +0 -1
- package/v2Containers/CreativesContainer/actions.js +1 -1
- package/v2Containers/CreativesContainer/index.js +6 -1
- package/v2Containers/CreativesContainer/tests/index.test.js +4 -0
- package/v2Containers/Email/index.js +4 -1
- package/v2Containers/Facebook/Advertisement/index.js +4 -4
- package/v2Containers/Line/Container/Image/index.js +5 -4
- package/v2Containers/Line/Container/ImageCarousel/index.js +6 -5
- package/v2Containers/Line/Container/ImageMap/index.js +2 -1
- package/v2Containers/MobilePush/Create/index.js +5 -7
- package/v2Containers/MobilePush/Edit/index.js +4 -3
- package/v2Containers/Rcs/index.js +2 -1
- package/v2Containers/Templates/actions.js +6 -0
- package/v2Containers/Templates/constants.js +4 -0
- package/v2Containers/Templates/sagas.js +23 -0
- package/v2Containers/TemplatesV2/index.js +5 -0
- package/v2Containers/Viber/index.js +11 -2
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +3 -1
- package/v2Containers/Whatsapp/index.js +4 -2
|
@@ -53,9 +53,12 @@ import { GA } from '@capillarytech/cap-ui-utils';
|
|
|
53
53
|
import { CREATE, EDIT, TRACK_CREATE_VIBER, TRACK_EDIT_VIBER } from '../App/constants';
|
|
54
54
|
import { gtmPush } from '../../utils/gtmTrackers';
|
|
55
55
|
import { VIBER } from '../CreativesContainer/constants';
|
|
56
|
+
import { getCdnUrl } from '../../utils/cdnTransformation';
|
|
57
|
+
|
|
56
58
|
const { CapHeadingSpan } = CapHeading;
|
|
57
59
|
const { TextArea } = CapInput;
|
|
58
60
|
|
|
61
|
+
|
|
59
62
|
const Viber = (props) => {
|
|
60
63
|
const {
|
|
61
64
|
intl,
|
|
@@ -78,7 +81,7 @@ const Viber = (props) => {
|
|
|
78
81
|
const { formatMessage } = intl;
|
|
79
82
|
const [isImageError, updateImageErrorMessage] = useState(false);
|
|
80
83
|
const [isImage, updateImageStatus] = useState(false);
|
|
81
|
-
const [imageSrc,
|
|
84
|
+
const [imageSrc, setImageSrc] = useState();
|
|
82
85
|
const [isDrawerRequired, updateDrawerRequirement] = useState(false);
|
|
83
86
|
const [messageContent, updateTextMessageContent] = useState('');
|
|
84
87
|
const [buttonText, updateButtonText] = useState('');
|
|
@@ -92,6 +95,12 @@ const Viber = (props) => {
|
|
|
92
95
|
const [buttonURLErrorMessage, updateButtonURLErrorMessage] = useState(false);
|
|
93
96
|
const [accountName, updateAccountName] = useState("");
|
|
94
97
|
|
|
98
|
+
|
|
99
|
+
const updateImageSrc = React.useCallback((url)=>{
|
|
100
|
+
const newUrl = getCdnUrl({url, channelName: 'VIBER'});
|
|
101
|
+
setImageSrc(newUrl);
|
|
102
|
+
},[]);
|
|
103
|
+
|
|
95
104
|
const StyledHeader = styled(CapHeader)`
|
|
96
105
|
margin-bottom: 14px;
|
|
97
106
|
`;
|
|
@@ -741,4 +750,4 @@ export default withCreatives({
|
|
|
741
750
|
mapStateToProps,
|
|
742
751
|
mapDispatchToProps,
|
|
743
752
|
userAuth: true,
|
|
744
|
-
});
|
|
753
|
+
});
|
|
@@ -32,6 +32,8 @@ import { GA } from '@capillarytech/cap-ui-utils';
|
|
|
32
32
|
import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
|
|
33
33
|
import { gtmPush } from '../../../../utils/gtmTrackers';
|
|
34
34
|
import { WECHAT } from '../../../CreativesContainer/constants';
|
|
35
|
+
import { getCdnUrl } from '../../../../utils/cdnTransformation';
|
|
36
|
+
|
|
35
37
|
export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
36
38
|
constructor(props) {
|
|
37
39
|
super(props);
|
|
@@ -478,7 +480,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
478
480
|
need_open_comment: postCommentsData.need_open_comment,
|
|
479
481
|
only_fans_can_comment: postCommentsData.only_fans_can_comment,
|
|
480
482
|
thumb_media_id: contentData.mediaId,
|
|
481
|
-
image_url: contentData.imageUrl,
|
|
483
|
+
image_url: getCdnUrl({url: contentData.imageUrl, channelName: 'WECHAT'}),
|
|
482
484
|
};
|
|
483
485
|
mediaList.push(filteredContent);
|
|
484
486
|
});
|
|
@@ -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, channelName: 'WHATSAPP',}),
|
|
859
861
|
karixFileHandle,
|
|
860
862
|
}),
|
|
861
863
|
varMapped: !isFullMode ? varMap : {},
|
|
@@ -1439,4 +1441,4 @@ export default withCreatives({
|
|
|
1439
1441
|
mapStateToProps,
|
|
1440
1442
|
mapDispatchToProps,
|
|
1441
1443
|
userAuth: true,
|
|
1442
|
-
});
|
|
1444
|
+
});
|