@capillarytech/creatives-library 7.11.7 → 7.11.9
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/config/app.js +1 -0
- package/index.js +6 -0
- package/package.json +1 -1
- package/routes.js +7 -2
- package/services/api.js +8 -2
- package/v2Components/CapImageUpload/index.js +24 -11
- package/v2Components/CapImageUpload/index.scss +12 -27
- package/v2Components/CapImageUpload/messages.js +9 -4
- package/v2Components/TemplatePreview/_templatePreview.scss +13 -1
- package/v2Components/TemplatePreview/index.js +43 -2
- package/v2Containers/App/constants.js +2 -1
- package/v2Containers/Assets/images/addCreativesIllustration.svg +30 -0
- package/v2Containers/Cap/messages.js +20 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +57 -11
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -0
- package/v2Containers/CreativesContainer/constants.js +1 -0
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/Facebook/Advertisement/index.js +4 -2
- package/v2Containers/Rcs/actions.js +29 -0
- package/v2Containers/Rcs/constants.js +38 -0
- package/v2Containers/Rcs/index.js +939 -0
- package/v2Containers/Rcs/index.scss +54 -0
- package/v2Containers/Rcs/messages.js +109 -0
- package/v2Containers/Rcs/reducer.js +72 -0
- package/v2Containers/Rcs/sagas.js +72 -0
- package/v2Containers/Rcs/selectors.js +8 -0
- package/v2Containers/Rcs/utils.js +37 -0
- package/v2Containers/Templates/_templates.scss +9 -1
- package/v2Containers/Templates/actions.js +2 -1
- package/v2Containers/Templates/constants.js +1 -0
- package/v2Containers/Templates/index.js +234 -174
- package/v2Containers/Templates/messages.js +20 -0
- package/v2Containers/Templates/reducer.js +2 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +520 -80
- package/v2Containers/TemplatesV2/index.js +2 -1
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Whatsapp/index.js +4 -2
- package/v2Containers/Whatsapp/messages.js +0 -13
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +13 -13
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +32 -26
package/config/app.js
CHANGED
|
@@ -17,6 +17,7 @@ const config = {
|
|
|
17
17
|
},
|
|
18
18
|
development: {
|
|
19
19
|
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
20
|
+
//api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
20
21
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
21
22
|
campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
|
|
22
23
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
package/index.js
CHANGED
|
@@ -91,6 +91,10 @@ import Whatsapp from './v2Containers/Whatsapp';
|
|
|
91
91
|
import whatsappReducer from './v2Containers/Whatsapp/reducer';
|
|
92
92
|
import whatsappSaga from './v2Containers/Whatsapp/sagas';
|
|
93
93
|
|
|
94
|
+
import Rcs from './v2Containers/Rcs';
|
|
95
|
+
import rcsReducer from './v2Containers/Rcs/reducer';
|
|
96
|
+
import rcsSaga from './v2Containers/Rcs/sagas';
|
|
97
|
+
|
|
94
98
|
export {default as Ebill} from './v2Containers/Ebill';
|
|
95
99
|
export {default as EbillReducer} from './v2Containers/Ebill/reducer';
|
|
96
100
|
export {default as EbillSaga} from './v2Containers/Ebill/sagas';
|
|
@@ -116,6 +120,7 @@ const ViberContainer = {Viber, viberReducer, viberSaga};
|
|
|
116
120
|
const FacebookPreviewContainer = { FacebookPreview, facebookPreviewReducer, facebookPreviewSaga };
|
|
117
121
|
const SmsTraiContainer = {SmsTraiCreate, SmsTraiCreateReducer, SmsTraiCreateSaga};
|
|
118
122
|
const WhatsappContainer = { Whatsapp, whatsappReducer, whatsappSaga };
|
|
123
|
+
const RcsContainer = { Rcs, rcsReducer, rcsSaga };
|
|
119
124
|
|
|
120
125
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
121
126
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -163,4 +168,5 @@ export { CapContainer,
|
|
|
163
168
|
FacebookPreviewContainer,
|
|
164
169
|
SmsTraiContainer,
|
|
165
170
|
WhatsappContainer,
|
|
171
|
+
RcsContainer,
|
|
166
172
|
};
|
package/package.json
CHANGED
package/routes.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
// about the code splitting business
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { getAsyncInjectors } from 'utils/asyncInjectors';
|
|
7
|
-
import pathConfig from './config/path'
|
|
8
7
|
import * as rootSaga from 'containers/Cap/sagas';
|
|
9
8
|
import * as smsSagas from 'containers/Sms/Create/sagas';
|
|
10
9
|
import * as smsEditSagas from 'containers/Sms/Edit/sagas';
|
|
@@ -14,6 +13,7 @@ import * as emailSagas from 'containers/Email/sagas';
|
|
|
14
13
|
import * as templateSagas from 'containers/Templates/sagas';
|
|
15
14
|
import * as lineSagas from 'containers/Line/Create/sagas';
|
|
16
15
|
import * as languageSaga from './v2Containers/LanguageProvider/sagas';
|
|
16
|
+
import pathConfig from './config/path';
|
|
17
17
|
|
|
18
18
|
import {updateCharCount} from './utils/smsCharCountV2';
|
|
19
19
|
const errorLoading = (err) => {
|
|
@@ -26,7 +26,7 @@ const loadModule = (cb) => (componentModule) => {
|
|
|
26
26
|
|
|
27
27
|
const loadModuleWithProps = (cb) => (ComponentModule, props) => {
|
|
28
28
|
cb(
|
|
29
|
-
null,
|
|
29
|
+
null,
|
|
30
30
|
() => <ComponentModule.default {...props} />
|
|
31
31
|
);
|
|
32
32
|
};
|
|
@@ -662,6 +662,8 @@ export default function createRoutes(store) {
|
|
|
662
662
|
import('v2Containers/SmsTrai/Create/reducer'),
|
|
663
663
|
import('v2Containers/Whatsapp/sagas'),
|
|
664
664
|
import('v2Containers/Whatsapp/reducer'),
|
|
665
|
+
import('v2Containers/Rcs/sagas'),
|
|
666
|
+
import('v2Containers/Rcs/reducer'),
|
|
665
667
|
]);
|
|
666
668
|
|
|
667
669
|
const renderRoute = loadModule(cb);
|
|
@@ -686,6 +688,7 @@ export default function createRoutes(store) {
|
|
|
686
688
|
capFacebookPreviewSagas, capFacebookPreviewReducer,
|
|
687
689
|
smsTraiSagas, smsTraiReducer,
|
|
688
690
|
whatsappSagas, whatsappReducer,
|
|
691
|
+
rcsSagas, rcsReducer,
|
|
689
692
|
]) => {
|
|
690
693
|
injectReducer('templates', reducer.default);
|
|
691
694
|
injectReducer('cap', capReducer.default);
|
|
@@ -706,6 +709,7 @@ export default function createRoutes(store) {
|
|
|
706
709
|
injectReducer('facebookPreview', capFacebookPreviewReducer.default);
|
|
707
710
|
injectReducer('smsTrai', smsTraiReducer.default);
|
|
708
711
|
injectReducer('whatsapp', whatsappReducer.default);
|
|
712
|
+
injectReducer('rcs', rcsReducer.default);
|
|
709
713
|
injectSagas(gallerySagas.default);
|
|
710
714
|
injectSagas(sagas.default);
|
|
711
715
|
injectSagas(capSagas.default);
|
|
@@ -725,6 +729,7 @@ export default function createRoutes(store) {
|
|
|
725
729
|
injectSagas(capFacebookPreviewSagas.default);
|
|
726
730
|
injectSagas(smsTraiSagas.default);
|
|
727
731
|
injectSagas(whatsappSagas.default);
|
|
732
|
+
injectSagas(rcsSagas.default);
|
|
728
733
|
renderRoute(component);
|
|
729
734
|
});
|
|
730
735
|
importModules.catch(errorLoading);
|
package/services/api.js
CHANGED
|
@@ -109,14 +109,14 @@ function request(url, options, handleUnauthorizedStatus) {
|
|
|
109
109
|
}
|
|
110
110
|
const fetchUrl = url.indexOf('?') !== -1 ? `${url}&time=${Date.now()}` : `${url}?time=${Date.now()}`;
|
|
111
111
|
return fetch(fetchUrl, options)
|
|
112
|
-
.then(response => {
|
|
112
|
+
.then((response) => {
|
|
113
113
|
if (response.status === 403 && handleUnauthorizedStatus) {
|
|
114
114
|
showSomethingwentWrong();
|
|
115
115
|
}
|
|
116
116
|
return checkStatus(response);
|
|
117
117
|
})
|
|
118
118
|
.then(parseJSON)
|
|
119
|
-
.catch(error => error);
|
|
119
|
+
.catch((error) => error);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function getAPICallObject(method, body, isFileUpload = false, loadCampaignHeaders = false) {
|
|
@@ -259,6 +259,12 @@ export const createEbillTemplate = ({template}) => {
|
|
|
259
259
|
return request(url, getAPICallObject('POST', template));
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
export const createChannelWiseTemplate = ({ channel, template }) => {
|
|
263
|
+
const url = `${API_ENDPOINT}/templates/${channel}`;
|
|
264
|
+
return request(url, getAPICallObject('POST', template));
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
|
|
262
268
|
export const getTemplateDetails = ({id, channel}) => {
|
|
263
269
|
const url = `${API_ENDPOINT}/templates/${id}/${channel ? channel.toUpperCase() : 'SMS'}`;
|
|
264
270
|
return request(url, getAPICallObject('GET'));
|
|
@@ -19,6 +19,7 @@ import { injectIntl, FormattedMessage, intlShape} from 'react-intl';
|
|
|
19
19
|
import get from 'lodash/get';
|
|
20
20
|
import './index.scss';
|
|
21
21
|
import Gallery from '../../v2Containers/Assets/Gallery';
|
|
22
|
+
import { FACEBOOK, RCS } from "../../v2Containers/CreativesContainer/constants";
|
|
22
23
|
|
|
23
24
|
import messages from './messages';
|
|
24
25
|
function CapImageUpload(props) {
|
|
@@ -38,6 +39,7 @@ function CapImageUpload(props) {
|
|
|
38
39
|
index,
|
|
39
40
|
className,
|
|
40
41
|
imageData,
|
|
42
|
+
channel,
|
|
41
43
|
} = props;
|
|
42
44
|
const {
|
|
43
45
|
formatMessage,
|
|
@@ -55,13 +57,16 @@ function CapImageUpload(props) {
|
|
|
55
57
|
const [isDrawerRequired, updateDrawerRequirement] = useState(false);
|
|
56
58
|
|
|
57
59
|
const {CapHeadingSpan} = CapHeading;
|
|
58
|
-
const ImageComponent = useCallback(
|
|
59
|
-
|
|
60
|
-
className={`image-container upload ${props.ifError ? 'error' : ''}`}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
const ImageComponent = useCallback(
|
|
61
|
+
() => (
|
|
62
|
+
<div className={`image-container upload ${props.ifError ? 'error' : ''}`}>
|
|
63
|
+
{imageSrc !== '' && (
|
|
64
|
+
<CapImage src={imageSrc || ''} alt="upload-image-src" height="400" />
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
[imageSrc],
|
|
69
|
+
);
|
|
65
70
|
|
|
66
71
|
const WithLabel = LabelHOC(ImageComponent);
|
|
67
72
|
|
|
@@ -204,7 +209,7 @@ function CapImageUpload(props) {
|
|
|
204
209
|
<FormattedMessage {...messages.imageReUpload} />
|
|
205
210
|
</CapButton>
|
|
206
211
|
);
|
|
207
|
-
}, [isImageError]);
|
|
212
|
+
}, [isImageError, imageSrc]);
|
|
208
213
|
|
|
209
214
|
return (
|
|
210
215
|
<div style={style} className="cap-custom-image-upload">
|
|
@@ -234,9 +239,16 @@ function CapImageUpload(props) {
|
|
|
234
239
|
<CapHeadingSpan type="label2" className="image-dimension">
|
|
235
240
|
<FormattedMessage {...messages.imageDimenstionDescription} values={{ width: imgWidth, height: imgHeight}}/>
|
|
236
241
|
</CapHeadingSpan>
|
|
237
|
-
|
|
238
|
-
<
|
|
239
|
-
|
|
242
|
+
{channel === FACEBOOK && (
|
|
243
|
+
<CapHeadingSpan type="label2" className="image-aspect-ratio">
|
|
244
|
+
<FormattedMessage {...messages.aspectRatio} />
|
|
245
|
+
</CapHeadingSpan>
|
|
246
|
+
)}
|
|
247
|
+
{channel === RCS && (
|
|
248
|
+
<CapHeadingSpan type="label2" className="image-size">
|
|
249
|
+
<FormattedMessage {...messages.imageSize} />
|
|
250
|
+
</CapHeadingSpan>
|
|
251
|
+
)}
|
|
240
252
|
<CapHeadingSpan type="label2" className="image-format">
|
|
241
253
|
<FormattedMessage {...messages.format} />
|
|
242
254
|
</CapHeadingSpan>
|
|
@@ -261,6 +273,7 @@ CapImageUpload.propTypes = {
|
|
|
261
273
|
updateOnReUpload: PropTypes.func,
|
|
262
274
|
imageData: PropTypes.object,
|
|
263
275
|
index: PropTypes.number,
|
|
276
|
+
channel: PropTypes.string,
|
|
264
277
|
};
|
|
265
278
|
|
|
266
279
|
export default injectIntl(CapImageUpload);
|
|
@@ -3,30 +3,15 @@
|
|
|
3
3
|
$classPrefix: cap-custom-image-upload;
|
|
4
4
|
|
|
5
5
|
.#{$classPrefix} {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.image-format{
|
|
19
|
-
float: right;
|
|
20
|
-
}
|
|
21
|
-
.image-aspect-ratio{
|
|
22
|
-
margin-top: $CAP_SPACE_12;
|
|
23
|
-
margin-left: 64px;
|
|
24
|
-
}
|
|
25
|
-
.image-dimension{
|
|
26
|
-
margin-top: $CAP_SPACE_12;
|
|
27
|
-
margin-right: 46px;
|
|
28
|
-
}
|
|
29
|
-
.image-info-wrapper{
|
|
30
|
-
margin-bottom: 15px;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
6
|
+
.upload-image {
|
|
7
|
+
margin-right: $CAP_SPACE_08;
|
|
8
|
+
}
|
|
9
|
+
.gallery-select {
|
|
10
|
+
margin-left: $CAP_SPACE_08;
|
|
11
|
+
}
|
|
12
|
+
.image-info-wrapper {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
margin-top: 8px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -8,7 +8,7 @@ export default defineMessages({
|
|
|
8
8
|
},
|
|
9
9
|
uploadComputer: {
|
|
10
10
|
id: `${scope}.uploadComputer`,
|
|
11
|
-
defaultMessage: '
|
|
11
|
+
defaultMessage: 'Select from computer',
|
|
12
12
|
},
|
|
13
13
|
or: {
|
|
14
14
|
id: `${scope}.or`,
|
|
@@ -24,7 +24,7 @@ export default defineMessages({
|
|
|
24
24
|
},
|
|
25
25
|
imageReUpload: {
|
|
26
26
|
id: `${scope}.imageReUpload`,
|
|
27
|
-
defaultMessage: '
|
|
27
|
+
defaultMessage: 'Reupload',
|
|
28
28
|
},
|
|
29
29
|
imageDimenstionDescription: {
|
|
30
30
|
id: `${scope}.imageDimenstionDescription`,
|
|
@@ -32,11 +32,12 @@ export default defineMessages({
|
|
|
32
32
|
},
|
|
33
33
|
format: {
|
|
34
34
|
id: `${scope}.format`,
|
|
35
|
-
defaultMessage: 'Format: JPG, PNG',
|
|
35
|
+
defaultMessage: 'Format: JPEG, JPG, PNG',
|
|
36
36
|
},
|
|
37
37
|
imageIncorrectSize: {
|
|
38
38
|
id: `${scope}.imageIncorrectSize`,
|
|
39
|
-
defaultMessage:
|
|
39
|
+
defaultMessage:
|
|
40
|
+
'Please upload the image with correct type, size and dimension',
|
|
40
41
|
},
|
|
41
42
|
imageGallery: {
|
|
42
43
|
id: `${scope}.imageGallery`,
|
|
@@ -46,4 +47,8 @@ export default defineMessages({
|
|
|
46
47
|
id: `${scope}.aspectRatio`,
|
|
47
48
|
defaultMessage: 'Aspect ratio: 1:1',
|
|
48
49
|
},
|
|
50
|
+
imageSize: {
|
|
51
|
+
id: `${scope}.imageSize`,
|
|
52
|
+
defaultMessage: 'Size upto: 2MB',
|
|
53
|
+
},
|
|
49
54
|
});
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
&.line-preview {
|
|
44
44
|
margin-left: $CAP_SPACE_16;
|
|
45
45
|
width: 40%;
|
|
46
|
-
left: 197px;
|
|
47
46
|
|
|
48
47
|
.message-pop {
|
|
49
48
|
width: 80%;
|
|
@@ -78,6 +77,10 @@
|
|
|
78
77
|
font-size: 10px;
|
|
79
78
|
width: 100%;
|
|
80
79
|
font-family: 'open-sans';
|
|
80
|
+
.rcs-image{
|
|
81
|
+
width: 164px;
|
|
82
|
+
height: 123px;
|
|
83
|
+
}
|
|
81
84
|
.message-pop-item{
|
|
82
85
|
padding: 4px;
|
|
83
86
|
background: #3F51B5;
|
|
@@ -88,6 +91,15 @@
|
|
|
88
91
|
&:first-child{
|
|
89
92
|
margin-top: 0;
|
|
90
93
|
}
|
|
94
|
+
&.rcs-content {
|
|
95
|
+
background: $CAP_WHITE;
|
|
96
|
+
color: $CAP_G01;
|
|
97
|
+
margin-top: 0;
|
|
98
|
+
padding: 4px 8px;
|
|
99
|
+
}
|
|
100
|
+
&.rcs-desc:not(:first-child) {
|
|
101
|
+
margin-top: -8px;
|
|
102
|
+
}
|
|
91
103
|
}
|
|
92
104
|
}
|
|
93
105
|
&:not(.sms){
|
|
@@ -17,6 +17,7 @@ import messages from './messages';
|
|
|
17
17
|
import {
|
|
18
18
|
WECHAT,
|
|
19
19
|
WHATSAPP,
|
|
20
|
+
RCS,
|
|
20
21
|
} from '../../v2Containers/CreativesContainer/constants';
|
|
21
22
|
import Carousel from '../Carousel';
|
|
22
23
|
import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
|
|
@@ -160,7 +161,8 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
160
161
|
templateData,
|
|
161
162
|
} = this.props;
|
|
162
163
|
const { formatMessage } = intl;
|
|
163
|
-
const { buttonText, imageURL, messageContent: viberMessageContent } = content || {};
|
|
164
|
+
const { buttonText, imageURL, rcsPreviewContent, messageContent: viberMessageContent } = content || {};
|
|
165
|
+
const { rcsImageSrc, rcsTitle, rcsDesc } = rcsPreviewContent || {};
|
|
164
166
|
let smsDetails = {};
|
|
165
167
|
// let smsText = '';
|
|
166
168
|
if (this.props.content && this.props.charCounterEnabled) {
|
|
@@ -450,6 +452,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
450
452
|
overflow: 'auto',
|
|
451
453
|
flexDirection: 'column',
|
|
452
454
|
marginLeft: 40,
|
|
455
|
+
left: !this.props.showCount && '200px',
|
|
453
456
|
}}
|
|
454
457
|
>
|
|
455
458
|
<div
|
|
@@ -590,7 +593,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
590
593
|
return (
|
|
591
594
|
<div
|
|
592
595
|
style={{
|
|
593
|
-
margin: '
|
|
596
|
+
margin: '6px 0 20px 28px',
|
|
594
597
|
}}
|
|
595
598
|
>
|
|
596
599
|
<Carousel imageCarousel={imageCarousel}/>
|
|
@@ -721,6 +724,44 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
721
724
|
''
|
|
722
725
|
)
|
|
723
726
|
}
|
|
727
|
+
{
|
|
728
|
+
channel?.toUpperCase() === RCS && (
|
|
729
|
+
<>
|
|
730
|
+
<div className='shell-v2 align-center'>
|
|
731
|
+
<CapImage
|
|
732
|
+
className='preview-image'
|
|
733
|
+
src={smsMobileAndroid}
|
|
734
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
735
|
+
/>
|
|
736
|
+
<div className='msg-container sms'>
|
|
737
|
+
<div className='message-pop sms'>
|
|
738
|
+
{rcsImageSrc && (
|
|
739
|
+
<CapImage
|
|
740
|
+
src={rcsImageSrc}
|
|
741
|
+
className='rcs-image'
|
|
742
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
743
|
+
/>
|
|
744
|
+
)}
|
|
745
|
+
{rcsTitle && (
|
|
746
|
+
<CapLabel
|
|
747
|
+
type="label5"
|
|
748
|
+
className='message-pop-item align-left rcs-content'
|
|
749
|
+
fontWeight='bold'
|
|
750
|
+
>
|
|
751
|
+
{rcsTitle}
|
|
752
|
+
</CapLabel>
|
|
753
|
+
)}
|
|
754
|
+
{rcsDesc && (
|
|
755
|
+
<CapLabel type="label5" className='message-pop-item align-left rcs-content rcs-desc'>
|
|
756
|
+
{rcsDesc}
|
|
757
|
+
</CapLabel>
|
|
758
|
+
)}
|
|
759
|
+
</div>
|
|
760
|
+
</div>
|
|
761
|
+
</div>
|
|
762
|
+
</>
|
|
763
|
+
)
|
|
764
|
+
}
|
|
724
765
|
{channel && channel.toLowerCase() === FACEBOOK && (
|
|
725
766
|
<div style={{position: 'absolute', left: '80%'}} id="facebook-preview">
|
|
726
767
|
<CapFacebookPreview
|
|
@@ -48,6 +48,7 @@ export const PREVIEW = 'preview';
|
|
|
48
48
|
export const VIBER = 'viber';
|
|
49
49
|
export const FACEBOOK = 'facebook';
|
|
50
50
|
export const WHATSAPP = 'whatsapp';
|
|
51
|
+
export const RCS = 'rcs';
|
|
51
52
|
|
|
52
53
|
export const TRACK_EDIT_SMS = 'editSms';
|
|
53
54
|
export const TRACK_EDIT_EMAIL = 'editEmail';
|
|
@@ -110,4 +111,4 @@ export const LOYALTY = 'loyalty';
|
|
|
110
111
|
|
|
111
112
|
export const FAILURE = 'FAILURE';
|
|
112
113
|
export const DATE_DISPLAY_FORMAT = 'D MMM YYYY';
|
|
113
|
-
export const TIME_DISPLAY_FORMAT = 'hh:mm A';
|
|
114
|
+
export const TIME_DISPLAY_FORMAT = 'hh:mm A';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg width="152" height="152" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<defs>
|
|
3
|
+
<path id="g6dreh3yza" d="M0 0h135.016v120.429H0z"/>
|
|
4
|
+
<path id="gsany574hc" d="M.661.295h41.938V38H.66z"/>
|
|
5
|
+
</defs>
|
|
6
|
+
<g fill="none" fill-rule="evenodd">
|
|
7
|
+
<g transform="translate(8 13)">
|
|
8
|
+
<mask id="672iuzud9b" fill="#fff">
|
|
9
|
+
<use xlink:href="#g6dreh3yza"/>
|
|
10
|
+
</mask>
|
|
11
|
+
<path d="M58.686 9.812c.251-1.179-.726-2.026-2.046-2.226-.93-.142-1.905.151-2.532.853-.487.546-.837 1.36-.28 2.433 1.11 2.145 4.522.517 4.858-1.06m-11.988 9.282c2.831-2.295 4.63-6.886.88-9.411-3.749-2.525-7.233-.134-7.957.612 0 0-4.629 4.132-3.099 8.799 1.53 4.668 7.345 2.296 10.176 0m56.226 99.867c-15.384-2.74-32.728-1.431-50.612 1.073-17.883 2.503-42.92-6.617-50.79-35.231-7.869-28.615 16.811-46.498 27.184-51.148 4.99-2.237 9.606-4.68 13.055-6.614 3.54-1.985 6.827-4.372 9.867-7.058 28.76-25.409 51.17-22.275 64.708-14.048 14.13 8.585 11.446 29.866 10.373 49.538-1.073 19.672 6.796 27.363 8.227 44.531 1.43 17.169-16.514 21.717-32.012 18.957" fill="#FEC52E" mask="url(#672iuzud9b)"/>
|
|
12
|
+
</g>
|
|
13
|
+
<path d="M59.978 122.446c1.308-4.136 1.96-22.422 1.415-28.719-.655-7.548-1.488-9.112-1.488-9.112h39.168l-1.824 12.781c-.41 4.85-.408 14.685.075 19.522.445 4.46.076 3.3 1.092 7.802l.938 3.02c.694 1.95-.182 6.037-2.251 6.048l-34.775-1.104s-5.592.01-2.35-10.238" fill="#FFF"/>
|
|
14
|
+
<path d="M112.226 84.964c0 3.708-15.394 2.149-33.297 3.009-7.082.339-13.741-.627-19.25-.511-8.053.17-13.964-.63-13.964-2.848 0-3.708 15.29-10.071 33.214-10.071s33.297 6.712 33.297 10.42" fill="#FFF"/>
|
|
15
|
+
<path d="M100.178 82.995c0 2.163-9.869 1.555-21.275 1.555-11.406 0-21.472-.084-21.472-2.247s10.066-5.587 21.472-5.587 21.275 4.116 21.275 6.28M98.095 91.103c.187-.572.542-3.525.542-3.525s-9.2.468-19.354.48c-6.581.007-13.558-.333-18.704-.588 0 0 .464 3.418.533 3.609 0 0 7.018 2.51 20.309 2.29 0 0 10.376-.39 16.674-2.266" fill="#242E3D"/>
|
|
16
|
+
<path d="m121.019 35.042-20.571-8.053a4.146 4.146 0 0 0-5.373 2.35L89.79 42.837a4.147 4.147 0 0 0 2.35 5.373l10.286 4.026-1.712 4.374 6.085-2.661 5.913 2.314a4.146 4.146 0 0 0 5.373-2.35l5.285-13.498a4.148 4.148 0 0 0-2.351-5.373" fill="#E51FA3"/>
|
|
17
|
+
<path fill="#F0DF32" d="m117.453 42.482-18.5-7.243.612-1.568 18.502 7.243zM116.103 45.932l-18.501-7.243.613-1.568 18.502 7.243zM107.9 47.331l-11.863-4.644.614-1.568 11.863 4.644z"/>
|
|
18
|
+
<path d="m31.78 58.548.743.427-.427.745-.745-.427.428-.745zm1.58-2.75.743.426-.79 1.376-.744-.427.79-1.376zm1.578-2.752.745.427-.79 1.375-.744-.427.79-1.375zm1.58-2.752.745.427-.79 1.376-.744-.428.79-1.375zm1.58-2.752.744.427-.789 1.376-.745-.427.79-1.376zm1.218-2.12.744.427-.427.744-.745-.427.428-.744zm-28.148-2.188-2.14 3.728 29.263 16.802 2.145-3.737c-.048-.025-.1-.039-.148-.066a4.026 4.026 0 1 1 4.009-6.982c.048.027.086.065.132.094l2.431-4.234-29.264-16.802-2.426 4.226a4.022 4.022 0 0 1 1.436 5.458 4.022 4.022 0 0 1-5.438 1.513z" fill="#F87D22"/>
|
|
19
|
+
<path fill="#FFF" d="m20.306 48.55-.168-.535 10.203-3.21.169.535zM26.818 49.051a1.32 1.32 0 0 0-1.312 1.437 1.312 1.312 0 0 0 1.43 1.192 1.32 1.32 0 0 0 1.194-1.43 1.32 1.32 0 0 0-1.312-1.199m-.001 3.195c-.96 0-1.781-.735-1.87-1.708a1.881 1.881 0 0 1 1.7-2.04 1.89 1.89 0 0 1 2.04 1.701 1.881 1.881 0 0 1-1.87 2.047M24.77 41.475c-.04 0-.081 0-.121.005a1.306 1.306 0 0 0-.893.469c-.225.27-.332.61-.3.962.032.35.198.668.468.893.27.225.606.332.963.3a1.314 1.314 0 0 0 .724-2.323 1.302 1.302 0 0 0-.841-.306m-.006 3.195a1.873 1.873 0 0 1-1.867-1.709 1.87 1.87 0 0 1 .428-1.372 1.881 1.881 0 0 1 3.313 1.034c.045.499-.107.987-.428 1.372a1.869 1.869 0 0 1-1.446.675"/>
|
|
20
|
+
<g transform="translate(87 101)">
|
|
21
|
+
<mask id="i30xlevwtd" fill="#fff">
|
|
22
|
+
<use xlink:href="#gsany574hc"/>
|
|
23
|
+
</mask>
|
|
24
|
+
<path d="m32.711 1.546 9.648 19.31a2.24 2.24 0 0 1 .091 1.81 2.242 2.242 0 0 1-1.1 1.219L13.578 37.76a2.246 2.246 0 0 1-1.637.15 2.252 2.252 0 0 1-1.393-1.16L.9 17.44a2.252 2.252 0 0 1-.092-1.808 2.255 2.255 0 0 1 1.103-1.224L29.682.533a2.252 2.252 0 0 1 1.64-.147l.053.016a2.249 2.249 0 0 1 1.336 1.144" fill="#279AE0" mask="url(#i30xlevwtd)"/>
|
|
25
|
+
</g>
|
|
26
|
+
<path d="M129.45 123.667a2.24 2.24 0 0 1-1.1 1.218l-27.771 13.876a2.256 2.256 0 0 1-1.637.15l8.995-20.149 21.514 4.905z" fill="#0071BB"/>
|
|
27
|
+
<path d="m118.322 101.386-8.931 20.286-21.584-5.04a2.26 2.26 0 0 1 1.104-1.223l27.77-13.876c.53-.264 1.115-.3 1.64-.147" fill="#00ADEF"/>
|
|
28
|
+
<path d="M77.442 79.348c-.146 3.123-.336 5.54-.402 6.245a57.462 57.462 0 0 1-2.955-.235 92.969 92.969 0 0 0-.75-5.662c-.65-4.085-1.768-9.457-3.57-13.654-3.357-7.833 1.119-10.071 1.119-10.071s3.357-1.12 5.596 4.476c1.409 3.514 1.264 12.623.962 18.9M85.708 79.272a201.88 201.88 0 0 1-1.992 6.165c-.974.046-1.992.067-3.022.067h-.078c.112-.66.492-3.178.761-6.422.347-3.928.515-8.931-.146-13.094-1.32-8.215 3.548-9.188 3.548-9.188s3.503-.212 4.286 5.617c.46 3.415-1.589 11.102-3.357 16.855M123.082 70.491a.259.259 0 0 0-.244-.258 1.77 1.77 0 0 1-1.766-1.747c.002-.012.001-.02.001-.032 0-.143-.11-.26-.254-.26a.252.252 0 0 0-.254.255v.028a1.763 1.763 0 0 1-1.765 1.746.261.261 0 0 0-.224.257c0 .132.098.25.225.266l.002.001c.974 0 1.766.787 1.773 1.762a.259.259 0 0 0 .258.251c.143 0 .243-.114.243-.257v-.082a1.765 1.765 0 0 1 1.757-1.664h.001a.264.264 0 0 0 .247-.266M69.766 43.268a.2.2 0 0 0-.187-.198 1.356 1.356 0 0 1-1.354-1.34c.002-.007 0-.014 0-.023a.194.194 0 1 0-.389-.003v.02a1.352 1.352 0 0 1-1.352 1.338.203.203 0 0 0 0 .4l.002.002a1.36 1.36 0 0 1 1.359 1.35c.004.107.09.192.197.192.11 0 .187-.087.187-.196v-.063a1.353 1.353 0 0 1 1.347-1.275v-.001a.203.203 0 0 0 .19-.203M39.243 95.815a.208.208 0 0 0-.196-.207 1.418 1.418 0 0 1-1.414-1.4c.002-.009 0-.016 0-.026a.205.205 0 0 0-.203-.209.203.203 0 0 0-.203.205c0 .007-.002.016 0 .023a1.414 1.414 0 0 1-1.416 1.4.21.21 0 0 0-.178.205c0 .106.077.2.18.213v.001c.782 0 1.416.631 1.422 1.412.005.112.093.2.207.2.114 0 .194-.09.194-.205 0-.022.002-.045 0-.065a1.414 1.414 0 0 1 1.408-1.334h.002a.212.212 0 0 0 .197-.213" fill="#FFF"/>
|
|
29
|
+
</g>
|
|
30
|
+
</svg>
|
|
@@ -88,7 +88,26 @@ export default defineMessages({
|
|
|
88
88
|
id: `creatives.containersV2.templateNamePlaceholder`,
|
|
89
89
|
defaultMessage: 'Enter template name',
|
|
90
90
|
},
|
|
91
|
-
|
|
91
|
+
"emptyTemplateNameErrorMessage": {
|
|
92
|
+
id: `creatives.containersV2.emptyTemplateNameErrorMessage`,
|
|
93
|
+
defaultMessage: 'Template name cannot be empty',
|
|
94
|
+
},
|
|
95
|
+
"creativeNameLabel": {
|
|
96
|
+
id: `creatives.containersV2.creativeNameLabel`,
|
|
97
|
+
defaultMessage: 'Creative name',
|
|
98
|
+
},
|
|
99
|
+
"addLabels": {
|
|
100
|
+
id: `creatives.containersV2.addLabels`,
|
|
101
|
+
defaultMessage: 'Add labels',
|
|
102
|
+
},
|
|
103
|
+
"preview": {
|
|
104
|
+
id: `creatives.containersV2.preview`,
|
|
105
|
+
defaultMessage: 'Preview',
|
|
106
|
+
},
|
|
107
|
+
"delete": {
|
|
108
|
+
id: `creatives.containersV2.delete`,
|
|
109
|
+
defaultMessage: 'Delete',
|
|
110
|
+
},
|
|
92
111
|
//refresh due to org change messages
|
|
93
112
|
|
|
94
113
|
"refreshOrgText": {
|
|
@@ -22,6 +22,7 @@ import LineContainer from '../Line/Container';
|
|
|
22
22
|
import FTP from '../FTP';
|
|
23
23
|
import Viber from '../Viber';
|
|
24
24
|
import Whatsapp from '../Whatsapp';
|
|
25
|
+
import Rcs from '../Rcs';
|
|
25
26
|
import { getWhatsappContent } from '../Whatsapp/utils';
|
|
26
27
|
import * as commonUtil from '../../utils/common';
|
|
27
28
|
const CreativesWrapper = styled.div`
|
|
@@ -174,9 +175,11 @@ export function SlideBoxContent(props) {
|
|
|
174
175
|
|
|
175
176
|
|
|
176
177
|
const isCreate = slidBoxContent === 'createTemplate';
|
|
178
|
+
const isEdit = slidBoxContent === 'editTemplate';
|
|
177
179
|
const isCreateSms = isCreate && channel === constants.SMS;
|
|
178
180
|
const isCreateFacebook = isCreate && channel === constants.FACEBOOK;
|
|
179
181
|
const isCreateWhatsapp = isCreate && channel === constants.WHATSAPP;
|
|
182
|
+
const isCreateRcs = isCreate && channel === constants.RCS;
|
|
180
183
|
const isCreateMPush = isCreate && channel === constants.MOBILE_PUSH;
|
|
181
184
|
const isCreateCallTask = isCreate && channel === constants.CALL_TASK;
|
|
182
185
|
let isEditSms = false;
|
|
@@ -190,32 +193,34 @@ export function SlideBoxContent(props) {
|
|
|
190
193
|
let isEditFacebook = false;
|
|
191
194
|
let isEditFTP = false;
|
|
192
195
|
let isEditWhatsapp = false;
|
|
196
|
+
let isEditRcs = false;
|
|
193
197
|
const isEmailCreate = isCreate && channel === constants.EMAIL;
|
|
194
198
|
if (templateData && channel) {
|
|
195
199
|
channel = templateData.type;// for edit mode with template data
|
|
196
|
-
isEditSms =
|
|
197
|
-
isEditCallTask =
|
|
198
|
-
isEditMPush =
|
|
199
|
-
isEditEmailWithId =
|
|
200
|
-
isEmailEditWithContent =
|
|
201
|
-
isEditFacebook =
|
|
202
|
-
isEditWhatsapp =
|
|
203
|
-
|
|
200
|
+
isEditSms = isEdit && channel === constants.SMS;
|
|
201
|
+
isEditCallTask = isEdit && channel === constants.CALL_TASK;
|
|
202
|
+
isEditMPush = isEdit && channel === constants.MOBILE_PUSH;
|
|
203
|
+
isEditEmailWithId = isEdit && channel === constants.EMAIL && templateData._id;
|
|
204
|
+
isEmailEditWithContent = isEdit && channel === constants.EMAIL && !templateData._id;
|
|
205
|
+
isEditFacebook = isEdit && channel === constants.FACEBOOK;
|
|
206
|
+
isEditWhatsapp = isEdit && channel === constants.WHATSAPP;
|
|
207
|
+
isEditRcs = isEdit && channel === constants.RCS;
|
|
208
|
+
isPreview = slidBoxContent === 'preview' && [constants.SMS, constants.LINE, constants.WHATSAPP, constants.FACEBOOK, constants.VIBER, constants.RCS].includes(channel);
|
|
204
209
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
205
210
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
206
|
-
isEditFTP =
|
|
211
|
+
isEditFTP = isEdit && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
207
212
|
}
|
|
213
|
+
const isDltEnabled = commonUtil.isTraiDLTEnable(isFullMode, smsRegister);
|
|
208
214
|
|
|
209
215
|
const getChannelPreviewContent = (templateDataObject) => {
|
|
210
216
|
switch (templateDataObject.type.toUpperCase()) {
|
|
211
217
|
case constants.SMS: {
|
|
212
|
-
const isTraiDlt = commonUtil.isTraiDLTEnable(isFullMode, smsRegister);
|
|
213
218
|
const updatedSmsEditor = get(
|
|
214
219
|
templateDataObject,
|
|
215
220
|
`versions.base['updated-sms-editor']`,
|
|
216
221
|
'',
|
|
217
222
|
);
|
|
218
|
-
if (!
|
|
223
|
+
if (!isDltEnabled || updatedSmsEditor === '') {
|
|
219
224
|
return get(templateDataObject, `versions.base['sms-editor']`);
|
|
220
225
|
}
|
|
221
226
|
return updatedSmsEditor.join('');
|
|
@@ -332,11 +337,29 @@ export function SlideBoxContent(props) {
|
|
|
332
337
|
...getWhatsappContent(templateDataObject, true),
|
|
333
338
|
};
|
|
334
339
|
}
|
|
340
|
+
case constants.RCS: {
|
|
341
|
+
const template = cloneDeep(templateDataObject);
|
|
342
|
+
const { description = "", media: {mediaUrl = ""}, title} = get(template, 'versions.base.content.RCS.cardContent[0]', {});
|
|
343
|
+
return {
|
|
344
|
+
rcsPreviewContent: {
|
|
345
|
+
rcsImageSrc: mediaUrl,
|
|
346
|
+
rcsTitle: title,
|
|
347
|
+
rcsDesc: description,
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
335
351
|
default:
|
|
336
352
|
return get(templateDataObject, `versions.base.content`);
|
|
337
353
|
}
|
|
338
354
|
};
|
|
339
355
|
|
|
356
|
+
const rcsCommonProps = {
|
|
357
|
+
isFullMode,
|
|
358
|
+
isDltEnabled,
|
|
359
|
+
smsRegister,
|
|
360
|
+
getDefaultTags: type,
|
|
361
|
+
};
|
|
362
|
+
|
|
340
363
|
return (
|
|
341
364
|
<CreativesWrapper>
|
|
342
365
|
{!isFullMode && slidBoxContent === 'templates' && (
|
|
@@ -715,6 +738,29 @@ export function SlideBoxContent(props) {
|
|
|
715
738
|
}}/>
|
|
716
739
|
)}
|
|
717
740
|
|
|
741
|
+
{isCreateRcs && (<Rcs
|
|
742
|
+
{...rcsCommonProps}
|
|
743
|
+
onCreateComplete={onCreateComplete}
|
|
744
|
+
location={{
|
|
745
|
+
pathname: `/rcs/create`,
|
|
746
|
+
query,
|
|
747
|
+
search: '',
|
|
748
|
+
}} />
|
|
749
|
+
)}
|
|
750
|
+
{isEditRcs && (<Rcs
|
|
751
|
+
{...rcsCommonProps}
|
|
752
|
+
templateData={templateData}
|
|
753
|
+
getFormData={getFormData}
|
|
754
|
+
params={{
|
|
755
|
+
id: templateData._id,
|
|
756
|
+
}}
|
|
757
|
+
location={{
|
|
758
|
+
pathname: `/rcs/edit`,
|
|
759
|
+
query,
|
|
760
|
+
search: '',
|
|
761
|
+
}} />
|
|
762
|
+
)}
|
|
763
|
+
|
|
718
764
|
</CreativesWrapper>
|
|
719
765
|
);
|
|
720
766
|
}
|
|
@@ -57,6 +57,7 @@ export function SlideBoxHeader(props) {
|
|
|
57
57
|
no_communication: 'NO_COMMUNICATION',
|
|
58
58
|
ftp: 'FTP',
|
|
59
59
|
whatsapp: <FormattedMessage {...messages.whatsappTemplate} />,
|
|
60
|
+
rcs: <FormattedMessage {...messages.rcsCreative} />,
|
|
60
61
|
};
|
|
61
62
|
return labels[currentChannel.toLowerCase()];
|
|
62
63
|
};
|
|
@@ -17,6 +17,7 @@ export const FTP = "FTP";
|
|
|
17
17
|
export const NO_COMMUNICATION = "NO_COMMUNICATION";
|
|
18
18
|
export const VIBER = "VIBER";
|
|
19
19
|
export const WHATSAPP = "WHATSAPP";
|
|
20
|
+
export const RCS = "RCS";
|
|
20
21
|
|
|
21
22
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
22
23
|
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|