@capillarytech/creatives-library 6.13.6 → 6.13.8
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/app.js +3 -3
- package/assets/viber.png +0 -0
- package/containers/Templates/index.js +0 -3
- package/index.js +8 -1
- package/package.json +2 -2
- package/reducers.js +2 -0
- package/routes.js +7 -1
- package/services/api.js +5 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +8 -2
- package/v2Components/TemplatePreview/index.js +104 -18
- package/v2Containers/App/constants.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +65 -2
- package/v2Containers/CreativesContainer/constants.js +2 -0
- package/v2Containers/CreativesContainer/index.js +29 -2
- package/v2Containers/Templates/_templates.scss +57 -0
- package/v2Containers/Templates/index.js +59 -6
- package/v2Containers/TemplatesV2/index.js +9 -1
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/_viber.scss +3 -0
- package/v2Containers/Viber/actions.js +74 -0
- package/v2Containers/Viber/constants.js +30 -0
- package/v2Containers/Viber/index.js +707 -0
- package/v2Containers/Viber/messages.js +137 -0
- package/v2Containers/Viber/reducer.js +84 -0
- package/v2Containers/Viber/sagas.js +107 -0
- package/v2Containers/Viber/selectors.js +21 -0
- package/v2Containers/Line/Create/_lineCreate.scss +0 -64
- package/v2Containers/Line/Create/actions.js +0 -94
- package/v2Containers/Line/Create/constants.js +0 -43
- package/v2Containers/Line/Create/index.js +0 -1112
- package/v2Containers/Line/Create/initialSchema.js +0 -378
- package/v2Containers/Line/Create/messages.js +0 -229
- package/v2Containers/Line/Create/reducer.js +0 -99
- package/v2Containers/Line/Create/sagas.js +0 -113
- package/v2Containers/Line/Create/selectors.js +0 -30
- package/v2Containers/Line/CreateWrapper/constants.js +0 -2
- package/v2Containers/Line/CreateWrapper/index.js +0 -117
- package/v2Containers/Line/CreateWrapper/messages.js +0 -55
- package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
- package/v2Containers/Line/Edit/actions.js +0 -79
- package/v2Containers/Line/Edit/constants.js +0 -27
- package/v2Containers/Line/Edit/index.js +0 -1051
- package/v2Containers/Line/Edit/messages.js +0 -173
- package/v2Containers/Line/Edit/reducer.js +0 -83
- package/v2Containers/Line/Edit/sagas.js +0 -81
- package/v2Containers/Line/Edit/selectors.js +0 -29
- package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
- package/v2Containers/Line/Edit/tests/index.test.js +0 -10
- package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
- package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
- package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
package/app.js
CHANGED
|
@@ -39,12 +39,12 @@ const history = syncHistoryWithStore(browserHistory, store, {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const bugSnagErrorCallback = (event) => {
|
|
42
|
-
const { app: { releaseStage } = {},
|
|
43
|
-
const errorMessage =
|
|
42
|
+
const { app: { releaseStage } = {}, originalError } = event || {};
|
|
43
|
+
const errorMessage = originalError && originalError.message;
|
|
44
44
|
if (
|
|
45
45
|
(releaseStage || '').includes('nightly') ||
|
|
46
46
|
process.env.NODE_ENV !== 'production' ||
|
|
47
|
-
ignoredErrorMessages.
|
|
47
|
+
ignoredErrorMessages.includes(errorMessage)
|
|
48
48
|
) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
package/assets/viber.png
ADDED
|
Binary file
|
|
@@ -721,9 +721,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
switch (type) {
|
|
724
|
-
case "getFormData":
|
|
725
|
-
this.getFormData(e);
|
|
726
|
-
break;
|
|
727
724
|
case "startTemplateCreation":
|
|
728
725
|
console.log('Starting to create template');
|
|
729
726
|
//this.getFormData(e);
|
package/index.js
CHANGED
|
@@ -65,6 +65,10 @@ import LineCreate from './v2Containers/Line/Container';
|
|
|
65
65
|
import lineCreateReducer from './v2Containers/Line/Container/reducer';
|
|
66
66
|
import lineCreateSaga from './v2Containers/Line/Container/sagas';
|
|
67
67
|
|
|
68
|
+
import Viber from './v2Containers/Viber';
|
|
69
|
+
import viberReducer from './v2Containers/Viber/reducer';
|
|
70
|
+
import viberSaga from './v2Containers/Viber/sagas';
|
|
71
|
+
|
|
68
72
|
import TemplatesV2 from './v2Containers/TemplatesV2/index';
|
|
69
73
|
|
|
70
74
|
import CreativesContainer from './v2Containers/CreativesContainer';
|
|
@@ -82,7 +86,7 @@ const TemplatesContainer = {Templates, templateReducer, templateSaga};
|
|
|
82
86
|
const SmsCreateContainer = {SmsCreate, smsCreateReducer, smsCreateSaga};
|
|
83
87
|
const SmsEditContainer = {SmsEdit, smsEditReducer, smsEditSaga};
|
|
84
88
|
const EmailContainer = {Email, emailReducer, emailSaga};
|
|
85
|
-
const BeeContainer ={ BeeEditor,beeReducer,beeSaga}
|
|
89
|
+
const BeeContainer = { BeeEditor, beeReducer, beeSaga};
|
|
86
90
|
const CallTaskContainer = {CallTask, callTaskReducer, callTaskSaga};
|
|
87
91
|
const WeChatMapTemplateContainer = {WeChatMapTemplate, weChatMapTemplateReducer, weChatMapTemplateSaga};
|
|
88
92
|
const WeChatRichMediaCreateContainer = {WeChatRichMediaCreate, weChatRichMediaCreateReducer, weChatRichMediaCreateSaga};
|
|
@@ -92,6 +96,8 @@ const MobilePushEditContainer = {MobilepushEdit, mobilepushEditReducer, mobilepu
|
|
|
92
96
|
const LineCreateContainer = {LineCreate, lineCreateReducer, lineCreateSaga};
|
|
93
97
|
const TemplatesV2Container = {TemplatesV2, templateReducer, templateSaga};
|
|
94
98
|
const FacebookContainer = {Facebook, facebookReducer, facebookSaga};
|
|
99
|
+
const ViberContainer = {Viber, viberReducer, viberSaga};
|
|
100
|
+
|
|
95
101
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
96
102
|
|
|
97
103
|
export {default as TagList} from './v2Containers/TagList/index';
|
|
@@ -131,4 +137,5 @@ export { CapContainer,
|
|
|
131
137
|
updateCharCount,
|
|
132
138
|
FacebookContainer,
|
|
133
139
|
GalleryContainer,
|
|
140
|
+
ViberContainer,
|
|
134
141
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "6.13.
|
|
4
|
+
"version": "6.13.8",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@babel/polyfill": "7.4.3",
|
|
16
16
|
"@bugsnag/js": "^7.2.1",
|
|
17
17
|
"@bugsnag/plugin-react": "^7.2.1",
|
|
18
|
-
"@capillarytech/cap-ui-utils": "1.3.
|
|
18
|
+
"@capillarytech/cap-ui-utils": "1.3.4",
|
|
19
19
|
"@mailupinc/bee-plugin": "^1.2.0",
|
|
20
20
|
"babel-cli": "^6.26.0",
|
|
21
21
|
"chalk": "1.1.3",
|
package/reducers.js
CHANGED
|
@@ -9,6 +9,8 @@ import { LOCATION_CHANGE } from 'react-router-redux';
|
|
|
9
9
|
|
|
10
10
|
import languageProviderReducer from 'v2Containers/LanguageProvider/reducer';
|
|
11
11
|
import beeEditorReducer from 'v2Containers/BeeEditor/reducer';
|
|
12
|
+
|
|
13
|
+
|
|
12
14
|
import capReducer from 'containers/Cap/reducer';
|
|
13
15
|
import appReducer from 'containers/App/reducer';
|
|
14
16
|
import createSmsReducer from 'containers/Sms/Create/reducer';
|
package/routes.js
CHANGED
|
@@ -598,7 +598,8 @@ export default function createRoutes(store) {
|
|
|
598
598
|
|
|
599
599
|
importModules.catch(errorLoading);
|
|
600
600
|
},
|
|
601
|
-
},
|
|
601
|
+
},
|
|
602
|
+
{
|
|
602
603
|
path: '/v2(/:channel)',
|
|
603
604
|
name: 'templatesV2',
|
|
604
605
|
getComponent(nextState, cb) {
|
|
@@ -634,6 +635,8 @@ export default function createRoutes(store) {
|
|
|
634
635
|
import('v2Containers/Facebook/reducer'),
|
|
635
636
|
import('v2Containers/Line/Container/sagas'),
|
|
636
637
|
import('v2Containers/Line/Container/reducer'),
|
|
638
|
+
import('v2Containers/Viber/sagas'),
|
|
639
|
+
import('v2Containers/Viber/reducer'),
|
|
637
640
|
]);
|
|
638
641
|
|
|
639
642
|
const renderRoute = loadModule(cb);
|
|
@@ -654,6 +657,7 @@ export default function createRoutes(store) {
|
|
|
654
657
|
galleryReducer, gallerySagas,
|
|
655
658
|
facebookSagas, facebookReducer,
|
|
656
659
|
lineCreateSagas, lineCreateReducer,
|
|
660
|
+
viberSagas, viberReducer,
|
|
657
661
|
]) => {
|
|
658
662
|
injectReducer('templates', reducer.default);
|
|
659
663
|
injectReducer('cap', capReducer.default);
|
|
@@ -670,6 +674,7 @@ export default function createRoutes(store) {
|
|
|
670
674
|
injectReducer('gallery', galleryReducer.default);
|
|
671
675
|
injectReducer('facebook', facebookReducer.default);
|
|
672
676
|
injectReducer('lineCreate', lineCreateReducer.default);
|
|
677
|
+
injectReducer('viber', viberReducer.default);
|
|
673
678
|
injectSagas(gallerySagas.default);
|
|
674
679
|
injectSagas(sagas.default);
|
|
675
680
|
injectSagas(capSagas.default);
|
|
@@ -685,6 +690,7 @@ export default function createRoutes(store) {
|
|
|
685
690
|
injectSagas(weChatRichmediaTemplatesEditSagas.default);
|
|
686
691
|
injectSagas(facebookSagas.default);
|
|
687
692
|
injectSagas(lineCreateSagas.default);
|
|
693
|
+
injectSagas(viberSagas.default);
|
|
688
694
|
renderRoute(component);
|
|
689
695
|
});
|
|
690
696
|
importModules.catch(errorLoading);
|
package/services/api.js
CHANGED
|
@@ -358,6 +358,11 @@ export const createLineTemplate = ({template}) => {
|
|
|
358
358
|
return request(url, getAPICallObject('POST', template));
|
|
359
359
|
};
|
|
360
360
|
|
|
361
|
+
export const createViberTemplate = ({template}) => {
|
|
362
|
+
const url = `${API_ENDPOINT}/templates/VIBER`;
|
|
363
|
+
return request(url, getAPICallObject('POST', template));
|
|
364
|
+
};
|
|
365
|
+
|
|
361
366
|
export const getLocizMessage = async (locale) => {
|
|
362
367
|
const appName = 'creatives_v2';
|
|
363
368
|
const url = `${ARYA_ENDPOINT}/translations/${appName}/${locale}`;
|
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
left: 23%;
|
|
22
22
|
width: 42%;
|
|
23
23
|
height: 336px;
|
|
24
|
-
display: -webkit-box;
|
|
25
|
-
display: -ms-flexbox;
|
|
26
24
|
display: flex;
|
|
27
25
|
|
|
28
26
|
.sms-icon{
|
|
@@ -51,6 +49,14 @@
|
|
|
51
49
|
left: 36px;
|
|
52
50
|
margin-top: -6px;
|
|
53
51
|
}
|
|
52
|
+
}
|
|
53
|
+
&.viber-preview{
|
|
54
|
+
width: 43%;
|
|
55
|
+
.message-pop {
|
|
56
|
+
width: 80%;
|
|
57
|
+
left: 36px;
|
|
58
|
+
margin-top: -6px;
|
|
59
|
+
}
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
.message-pop{
|
|
@@ -16,15 +16,19 @@ import {updateCharCount} from '../../utils/smsCharCountV2';
|
|
|
16
16
|
import messages from './messages';
|
|
17
17
|
import { WECHAT } from '../../v2Containers/CreativesContainer/constants';
|
|
18
18
|
import Carousel from '../Carousel';
|
|
19
|
+
import { VIBER } from '../../v2Containers/App/constants';
|
|
19
20
|
const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
|
|
20
21
|
const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
|
|
21
22
|
const lineMobileAndroid = require('../../assets/line.png');
|
|
23
|
+
const viberMobileAndroid = require('../../assets/viber.png');
|
|
24
|
+
|
|
22
25
|
const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
|
|
23
26
|
const lineStickerPlaceholder = require('../../assets/smiley-placeholder.svg');
|
|
24
27
|
const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
|
|
25
28
|
const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
|
|
26
29
|
const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
|
|
27
|
-
|
|
30
|
+
|
|
31
|
+
import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08, CAP_G06, CAP_G15, CAP_PURPLE01, CAP_G16 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
28
32
|
import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
|
|
29
33
|
|
|
30
34
|
class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
@@ -127,7 +131,8 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
127
131
|
|
|
128
132
|
render() {
|
|
129
133
|
let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
|
|
130
|
-
const { channel, showTestAndPreviewIcon, module} = this.props;
|
|
134
|
+
const { channel, showTestAndPreviewIcon, module } = this.props;
|
|
135
|
+
const { buttonText, imageURL, messageContent: viberMessageContent } = content || {};
|
|
131
136
|
let smsDetails = {};
|
|
132
137
|
// let smsText = '';
|
|
133
138
|
if (this.props.content && this.props.charCounterEnabled) {
|
|
@@ -155,11 +160,11 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
155
160
|
});
|
|
156
161
|
}
|
|
157
162
|
const disablePreviewAndTest = this.props.channel === 'MOBILEPUSH' ? !this.props.content.header : (this.props.channel === 'SMS' ? !this.props.content : false);
|
|
158
|
-
const showTestAndPreview = showTestAndPreviewIcon &&
|
|
163
|
+
const showTestAndPreview = showTestAndPreviewIcon &&
|
|
159
164
|
channel !== WECHAT &&
|
|
160
165
|
['outbound', 'library'].includes(module);
|
|
161
166
|
|
|
162
|
-
const renderLineMultiText = (content)
|
|
167
|
+
const renderLineMultiText = (content) => {
|
|
163
168
|
let textCount = 0;
|
|
164
169
|
return content.map((item) => {
|
|
165
170
|
const { type, messageContent = '' } = item || {};
|
|
@@ -170,12 +175,17 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
170
175
|
{this.props.intl.formatMessage(messages.textMessageLabel)}
|
|
171
176
|
{textCount}: ({messageContent.length}/{1600} {this.props.intl.formatMessage(messages.textMessageCharacter)})
|
|
172
177
|
</p>
|
|
173
|
-
)
|
|
178
|
+
);
|
|
174
179
|
}
|
|
175
|
-
return null
|
|
180
|
+
return null;
|
|
176
181
|
});
|
|
177
|
-
}
|
|
178
|
-
|
|
182
|
+
};
|
|
183
|
+
const viberSectionStyle = {
|
|
184
|
+
"padding": '3.5px 0 0',
|
|
185
|
+
'border-radius': '8px',
|
|
186
|
+
'background-color': CAP_G15,
|
|
187
|
+
'width': '79%',
|
|
188
|
+
};
|
|
179
189
|
const getVideoContent = ({
|
|
180
190
|
video,
|
|
181
191
|
actionUrl,
|
|
@@ -245,7 +255,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
245
255
|
/>
|
|
246
256
|
)
|
|
247
257
|
}
|
|
248
|
-
</div>
|
|
258
|
+
</div>
|
|
249
259
|
);
|
|
250
260
|
|
|
251
261
|
return (
|
|
@@ -393,7 +403,8 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
393
403
|
marginLeft: 40,
|
|
394
404
|
}}
|
|
395
405
|
>
|
|
396
|
-
<div
|
|
406
|
+
<div
|
|
407
|
+
className="sms-icon"
|
|
397
408
|
style={{
|
|
398
409
|
left: 0,
|
|
399
410
|
top: 8,
|
|
@@ -401,7 +412,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
401
412
|
width: 20,
|
|
402
413
|
height: 20,
|
|
403
414
|
background: CAP_COLOR_03,
|
|
404
|
-
paddingRight: 5
|
|
415
|
+
paddingRight: 5,
|
|
405
416
|
}}
|
|
406
417
|
>
|
|
407
418
|
{this.props.LineAccountName}
|
|
@@ -464,7 +475,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
464
475
|
},
|
|
465
476
|
}}
|
|
466
477
|
/>
|
|
467
|
-
</div>
|
|
478
|
+
</div>
|
|
468
479
|
);
|
|
469
480
|
}
|
|
470
481
|
if (type === VIDEO) {
|
|
@@ -495,7 +506,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
495
506
|
},
|
|
496
507
|
}}
|
|
497
508
|
/>
|
|
498
|
-
</div>
|
|
509
|
+
</div>
|
|
499
510
|
);
|
|
500
511
|
}
|
|
501
512
|
if (type === STICKER && selectedSticker) {
|
|
@@ -510,7 +521,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
510
521
|
alignItems: 'center',
|
|
511
522
|
}}
|
|
512
523
|
>
|
|
513
|
-
<CapImage
|
|
524
|
+
<CapImage
|
|
514
525
|
src={selectedSticker.stickerUrl}
|
|
515
526
|
style={{maxWidth: '100%', marginBottom: 5 }}
|
|
516
527
|
rest={{
|
|
@@ -519,11 +530,11 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
519
530
|
marginBottom: 5,
|
|
520
531
|
},
|
|
521
532
|
height: 70,
|
|
522
|
-
onMouseOut: e => (e.currentTarget.src = selectedSticker.stickerUrl),
|
|
523
|
-
onMouseOver: e => (e.currentTarget.src = selectedSticker.animatedStickerUrl ||
|
|
533
|
+
onMouseOut: (e) => (e.currentTarget.src = selectedSticker.stickerUrl),
|
|
534
|
+
onMouseOver: (e) => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
|
|
524
535
|
}}
|
|
525
536
|
/>
|
|
526
|
-
</div>
|
|
537
|
+
</div>
|
|
527
538
|
);
|
|
528
539
|
}
|
|
529
540
|
if ((type === IMAGE_CAROUSEL || type === TEMPLATE) && imageCarousel) {
|
|
@@ -535,7 +546,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
535
546
|
>
|
|
536
547
|
<Carousel imageCarousel={imageCarousel}/>
|
|
537
548
|
</div>
|
|
538
|
-
)
|
|
549
|
+
);
|
|
539
550
|
}
|
|
540
551
|
return null;
|
|
541
552
|
})
|
|
@@ -546,7 +557,82 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
546
557
|
</div>
|
|
547
558
|
) : ''
|
|
548
559
|
}
|
|
560
|
+
{
|
|
561
|
+
channel && channel.toLowerCase() === VIBER ? (
|
|
562
|
+
<div className="shell-v2 align-center" id="sms-preview">
|
|
563
|
+
<CapImage className="preview-image" src={viberMobileAndroid} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
564
|
+
<div
|
|
565
|
+
className="msgContainer viber-preview"
|
|
566
|
+
style={{
|
|
567
|
+
maxHeight: 292,
|
|
568
|
+
marginLeft: 28,
|
|
569
|
+
}}
|
|
570
|
+
>
|
|
571
|
+
<div
|
|
572
|
+
className="sms-icon"
|
|
573
|
+
style={{
|
|
574
|
+
"width": 20,
|
|
575
|
+
"height": 20,
|
|
576
|
+
"margin": '0 4px 277px 0',
|
|
577
|
+
"padding": '6px 2px 7px 3px',
|
|
578
|
+
'border-radius': '4px',
|
|
579
|
+
'background-color': CAP_PURPLE01,
|
|
580
|
+
'font-size': '6px',
|
|
581
|
+
'font-weight': 900,
|
|
582
|
+
"color": CAP_WHITE,
|
|
583
|
+
}}
|
|
584
|
+
>
|
|
585
|
+
{this.props.viberAccountName}
|
|
586
|
+
</div>
|
|
587
|
+
<div
|
|
588
|
+
className="message-pop align-left"
|
|
589
|
+
style={viberSectionStyle}>
|
|
590
|
+
{/* Text Viber preview */}
|
|
591
|
+
<p
|
|
592
|
+
style={{
|
|
593
|
+
'font-size': '10px',
|
|
594
|
+
"color": CAP_G16,
|
|
595
|
+
"margin": '1.5px 6px 1px 7px',
|
|
596
|
+
}}>{viberMessageContent || ''}
|
|
597
|
+
</p>
|
|
598
|
+
{/* Image Viber preview */}
|
|
599
|
+
{imageURL && <CapImage
|
|
600
|
+
src={imageURL}
|
|
601
|
+
alt="brand-name"
|
|
602
|
+
rest={{
|
|
603
|
+
style: {
|
|
604
|
+
maxWidth: '100%',
|
|
605
|
+
marginBottom: 5,
|
|
606
|
+
},
|
|
607
|
+
}}
|
|
608
|
+
/>
|
|
609
|
+
}
|
|
610
|
+
{/* button viber preview */}
|
|
611
|
+
{buttonText && <div
|
|
612
|
+
style={{
|
|
613
|
+
'border-radius': '16px',
|
|
614
|
+
'background-color': CAP_PURPLE01,
|
|
615
|
+
"margin-top": '14px',
|
|
616
|
+
'text-align': 'center',
|
|
617
|
+
"width": '132px',
|
|
618
|
+
"height": '20px',
|
|
619
|
+
"margin-left": "5px",
|
|
620
|
+
}}>
|
|
621
|
+
<p
|
|
622
|
+
style={{ 'font-size': '12px',
|
|
623
|
+
'font-weight': '500',
|
|
624
|
+
"color": CAP_WHITE }}
|
|
625
|
+
>
|
|
626
|
+
{buttonText || ''}</p>
|
|
627
|
+
</div>
|
|
628
|
+
}
|
|
629
|
+
<div style={{ paddingBottom: 32}}></div>
|
|
630
|
+
</div>
|
|
549
631
|
|
|
632
|
+
</div>
|
|
633
|
+
</div>
|
|
634
|
+
) : ''
|
|
635
|
+
}
|
|
550
636
|
</div>
|
|
551
637
|
|
|
552
638
|
</CapColumn>
|
|
@@ -20,7 +20,7 @@ export const TRACK_CREATE_WECHAT = 'createWeChat';
|
|
|
20
20
|
export const TRACK_CREATE_IMAGE = 'createImage';
|
|
21
21
|
export const TRACK_CREATE_LINE = 'createLine';
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
export const VIBER = 'viber';
|
|
24
24
|
export const TRACK_EDIT_SMS = 'editSms';
|
|
25
25
|
export const TRACK_EDIT_EMAIL = 'editEmail';
|
|
26
26
|
export const TRACK_EDIT_MPUSH = 'editMpush';
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
5
6
|
import TemplatesV2 from '../TemplatesV2';
|
|
6
7
|
import TemplatePreview from '../../v2Components/TemplatePreview';
|
|
7
8
|
import SmsCreate from '../Sms/Create';
|
|
@@ -18,6 +19,7 @@ import CallTask from '../CallTask';
|
|
|
18
19
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
19
20
|
import * as constants from './constants';
|
|
20
21
|
import LineContainer from '../Line/Container';
|
|
22
|
+
import Viber from '../Viber';
|
|
21
23
|
const CreativesWrapper = styled.div`
|
|
22
24
|
.ant-popover,
|
|
23
25
|
.ant-notification,
|
|
@@ -32,7 +34,6 @@ function getWechatTemplateType(mode, templateData, weChatTemplateType = '') {
|
|
|
32
34
|
}
|
|
33
35
|
return weChatTemplateType;
|
|
34
36
|
}
|
|
35
|
-
|
|
36
37
|
const getLineType = ({
|
|
37
38
|
slidBoxContent,
|
|
38
39
|
channel,
|
|
@@ -70,6 +71,22 @@ const getLineType = ({
|
|
|
70
71
|
}
|
|
71
72
|
return {};
|
|
72
73
|
};
|
|
74
|
+
const getViber = ({
|
|
75
|
+
slidBoxContent,
|
|
76
|
+
channel,
|
|
77
|
+
isFullMode,
|
|
78
|
+
templateData,
|
|
79
|
+
}) => {
|
|
80
|
+
if ((channel === constants.VIBER || (slidBoxContent === 'editTemplate' && templateData && templateData.type === constants.VIBER)) && slidBoxContent !== 'templates') {
|
|
81
|
+
const isCreate = slidBoxContent === 'createTemplate';
|
|
82
|
+
const isEdit = slidBoxContent === 'editTemplate';
|
|
83
|
+
return {
|
|
84
|
+
isCreate,
|
|
85
|
+
isEdit,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {};
|
|
89
|
+
};
|
|
73
90
|
|
|
74
91
|
function SlideBoxContent(props) {
|
|
75
92
|
const {
|
|
@@ -135,6 +152,15 @@ function SlideBoxContent(props) {
|
|
|
135
152
|
isFullMode,
|
|
136
153
|
templateData,
|
|
137
154
|
});
|
|
155
|
+
const {isCreate: isCreateViber = false,
|
|
156
|
+
isEdit: isEditViber = false } = getViber({
|
|
157
|
+
slidBoxContent,
|
|
158
|
+
channel,
|
|
159
|
+
isFullMode,
|
|
160
|
+
templateData,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
|
|
138
164
|
const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
139
165
|
const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
|
|
140
166
|
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
|
|
@@ -156,7 +182,7 @@ function SlideBoxContent(props) {
|
|
|
156
182
|
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
157
183
|
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
158
184
|
isEditFacebook = slidBoxContent === 'editTemplate' && channel === constants.FACEBOOK;
|
|
159
|
-
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE);
|
|
185
|
+
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE || channel === constants.VIBER);
|
|
160
186
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
161
187
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
162
188
|
}
|
|
@@ -223,6 +249,16 @@ function SlideBoxContent(props) {
|
|
|
223
249
|
return previewContent;
|
|
224
250
|
});
|
|
225
251
|
}
|
|
252
|
+
case constants.VIBER: {
|
|
253
|
+
const template = cloneDeep(templateDataObject);
|
|
254
|
+
const { text = "", imageURL = "", buttonText = "" } = get(template, 'versions.base.content.viber', {});
|
|
255
|
+
template.content = {
|
|
256
|
+
messageContent: text,
|
|
257
|
+
imageURL,
|
|
258
|
+
buttonText,
|
|
259
|
+
};
|
|
260
|
+
return template.content;
|
|
261
|
+
}
|
|
226
262
|
default:
|
|
227
263
|
return get(templateDataObject, `versions.base.content`);
|
|
228
264
|
}
|
|
@@ -500,6 +536,33 @@ function SlideBoxContent(props) {
|
|
|
500
536
|
/>
|
|
501
537
|
)
|
|
502
538
|
}
|
|
539
|
+
{isCreateViber && (
|
|
540
|
+
<Viber
|
|
541
|
+
location={creativesLocationProps}
|
|
542
|
+
onCreateComplete={onCreateComplete}
|
|
543
|
+
isFullMode={isFullMode}
|
|
544
|
+
handleClose={handleClose}
|
|
545
|
+
isGetFormData={isGetFormData}
|
|
546
|
+
getFormSubscriptionData={getFormData}
|
|
547
|
+
onShowTemplates={onShowTemplates}
|
|
548
|
+
templateData={templateData}
|
|
549
|
+
createNew/>
|
|
550
|
+
)}
|
|
551
|
+
|
|
552
|
+
{isEditViber && <Viber
|
|
553
|
+
location={creativesLocationProps}
|
|
554
|
+
params={{
|
|
555
|
+
id: templateData._id,
|
|
556
|
+
}}
|
|
557
|
+
onCreateComplete={onCreateComplete}
|
|
558
|
+
isFullMode={isFullMode}
|
|
559
|
+
handleClose={handleClose}
|
|
560
|
+
isGetFormData={isGetFormData}
|
|
561
|
+
getFormSubscriptionData={getFormData}
|
|
562
|
+
onShowTemplates={onShowTemplates}
|
|
563
|
+
templateData={templateData}
|
|
564
|
+
createNew/> }
|
|
565
|
+
|
|
503
566
|
</CreativesWrapper>
|
|
504
567
|
);
|
|
505
568
|
}
|
|
@@ -13,5 +13,7 @@ export const CALL_TASK = "CALL_TASK";
|
|
|
13
13
|
export const MOBILE_PUSH = "MOBILEPUSH";
|
|
14
14
|
export const WECHAT = "WECHAT";
|
|
15
15
|
export const FACEBOOK = "FACEBOOK";
|
|
16
|
+
export const VIBER = "VIBER";
|
|
17
|
+
|
|
16
18
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
17
19
|
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|
|
@@ -247,6 +247,24 @@ class Creatives extends React.Component {
|
|
|
247
247
|
};
|
|
248
248
|
break;
|
|
249
249
|
}
|
|
250
|
+
case constants.VIBER: {
|
|
251
|
+
const { messageBody, isDefault } = templateData;
|
|
252
|
+
const viberContent = JSON.parse(messageBody || '{}').messages || [{}];
|
|
253
|
+
creativesTemplateData = {
|
|
254
|
+
type: constants.VIBER,
|
|
255
|
+
isDefault,
|
|
256
|
+
edit: true,
|
|
257
|
+
name: "",
|
|
258
|
+
versions: {
|
|
259
|
+
base: {
|
|
260
|
+
content: {
|
|
261
|
+
viber: viberContent,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
250
268
|
default:
|
|
251
269
|
break;
|
|
252
270
|
}
|
|
@@ -332,6 +350,15 @@ class Creatives extends React.Component {
|
|
|
332
350
|
};
|
|
333
351
|
}
|
|
334
352
|
break;
|
|
353
|
+
case constants.VIBER:
|
|
354
|
+
if (template.value) {
|
|
355
|
+
const { versions } = template.value;
|
|
356
|
+
templateData = {
|
|
357
|
+
channel,
|
|
358
|
+
messageBody: JSON.stringify(versions.base.content),
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
break;
|
|
335
362
|
default:
|
|
336
363
|
break;
|
|
337
364
|
}
|
|
@@ -446,8 +473,8 @@ class Creatives extends React.Component {
|
|
|
446
473
|
}
|
|
447
474
|
}
|
|
448
475
|
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
476
|
+
const isLineViberChannel = templateData && [constants.LINE, constants.VIBER].includes(templateData);
|
|
477
|
+
if ([constants.LINE, constants.VIBER].includes(channel) || isLineViberChannel) {
|
|
451
478
|
showFooter = false;
|
|
452
479
|
}
|
|
453
480
|
|
|
@@ -46,6 +46,63 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
.VIBER {
|
|
50
|
+
&.cap-custom-card{
|
|
51
|
+
height: 241px;
|
|
52
|
+
.ant-card-body {
|
|
53
|
+
padding:0px 24px 0px;
|
|
54
|
+
.button-content {
|
|
55
|
+
.ant-card-meta-description {
|
|
56
|
+
min-width: 108px;
|
|
57
|
+
max-width: 160px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
padding: 1px 23px 2px 22px;
|
|
60
|
+
border-radius: 16px;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
background-color:$CAP_PURPLE01;
|
|
64
|
+
color:$CAP_WHITE;
|
|
65
|
+
text-align:center;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.truncate-text-viber{
|
|
69
|
+
.ant-card-meta-description{
|
|
70
|
+
display: -webkit-box;
|
|
71
|
+
-webkit-line-clamp: 9;
|
|
72
|
+
-webkit-box-orient: vertical;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.truncate-text-with-button{
|
|
76
|
+
.ant-card-meta-description{
|
|
77
|
+
-webkit-line-clamp: 8;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.truncate-text-with-image{
|
|
81
|
+
.ant-card-meta-description{
|
|
82
|
+
-webkit-line-clamp: 2;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.no-image .ant-card-meta {
|
|
89
|
+
.ant-card-meta-description {
|
|
90
|
+
word-wrap: break-word;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
&.carousel-img-section {
|
|
96
|
+
.ant-card-body {
|
|
97
|
+
padding: $CAP_SPACE_24 0;
|
|
98
|
+
}
|
|
99
|
+
.ant-card-meta {
|
|
100
|
+
padding: 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|
|
49
106
|
}
|
|
50
107
|
}
|
|
51
108
|
|