@capillarytech/creatives-library 7.6.1 → 7.6.2
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/assets/DeviceForEmail.png +0 -0
- package/components/CapTagList/index.js +5 -5
- package/components/Card/index.js +1 -1
- package/components/Ckeditor/index.js +5 -5
- package/components/CustomPopOver/index.js +3 -3
- package/components/Edmeditor/index.js +4 -4
- package/components/EmailPreview/index.js +1 -1
- package/components/PreviewSideBar/index.js +3 -3
- package/components/Sidebar/index.js +1 -1
- package/components/SmsTest/index.js +4 -4
- package/components/TemplatePreview/index.js +2 -2
- package/components/Toastr/index.js +1 -1
- package/config/app.js +2 -0
- package/containers/Assets/Gallery/index.js +2 -2
- package/containers/Assets/Gallery/sagas.js +1 -1
- package/containers/Cap/actions.js +2 -2
- package/containers/Cap/reducer.js +1 -1
- package/containers/Cap/sagas.js +3 -3
- package/containers/Cap/selectors.js +1 -1
- package/containers/Ebill/actions.js +1 -1
- package/containers/Ebill/index.js +34 -34
- package/containers/Ebill/sagas.js +3 -3
- package/containers/Email/actions.js +2 -2
- package/containers/Email/index.js +171 -171
- package/containers/Email/reducer.js +1 -1
- package/containers/Email/sagas.js +6 -6
- package/containers/LanguageProvider/actions.js +1 -1
- package/containers/Line/Create/actions.js +5 -5
- package/containers/Line/Create/index.js +37 -37
- package/containers/Line/Create/sagas.js +7 -7
- package/containers/Line/Edit/actions.js +3 -3
- package/containers/Line/Edit/index.js +24 -24
- package/containers/Line/Edit/sagas.js +4 -4
- package/containers/MobilePush/Create/actions.js +2 -2
- package/containers/MobilePush/Create/index.js +35 -35
- package/containers/MobilePush/Create/sagas.js +2 -2
- package/containers/MobilePush/Edit/actions.js +3 -3
- package/containers/MobilePush/Edit/index.js +32 -32
- package/containers/MobilePush/Edit/sagas.js +5 -5
- package/containers/Sms/Create/actions.js +2 -2
- package/containers/Sms/Create/index.js +57 -57
- package/containers/Sms/Create/sagas.js +2 -2
- package/containers/Sms/Edit/actions.js +3 -3
- package/containers/Sms/Edit/index.js +44 -44
- package/containers/Sms/Edit/sagas.js +3 -3
- package/containers/TagList/index.js +9 -9
- package/containers/Templates/actions.js +5 -5
- package/containers/Templates/index.js +44 -44
- package/containers/Templates/sagas.js +5 -5
- package/containers/WeChat/MapTemplates/actions.js +1 -1
- package/containers/WeChat/MapTemplates/index.js +34 -34
- package/containers/WeChat/MapTemplates/sagas.js +2 -2
- package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
- package/index.js +6 -0
- package/package.json +1 -1
- package/reducers.js +2 -1
- package/routes.js +5 -0
- package/services/api.js +43 -14
- package/utils/authWrapper.js +2 -2
- package/utils/common.js +13 -1
- package/utils/smsCharCount.js +5 -5
- package/v2Components/CapTagList/index.js +1 -1
- package/v2Components/CapVideoUpload/index.js +14 -6
- package/v2Components/Card/index.js +1 -1
- package/v2Components/Ckeditor/index.js +5 -5
- package/v2Components/CustomPopOver/index.js +3 -3
- package/v2Components/Edmeditor/index.js +4 -4
- package/v2Components/EmailMobilePreview/index.js +4 -4
- package/v2Components/EmailPreviewV2/index.js +4 -4
- package/v2Components/FormBuilder/index.js +3 -3
- package/v2Components/PreviewSideBar/index.js +3 -3
- package/v2Components/SmsTest/index.js +4 -4
- package/v2Components/TemplatePreview/index.js +24 -3
- package/v2Components/Toastr/index.js +1 -1
- package/v2Containers/App/constants.js +21 -0
- package/v2Containers/Assets/Gallery/sagas.js +1 -1
- package/v2Containers/Cap/actions.js +1 -1
- package/v2Containers/Cap/index.js +2 -2
- package/v2Containers/Cap/messages.js +30 -0
- package/v2Containers/Cap/reducer.js +1 -1
- package/v2Containers/Cap/sagas.js +3 -3
- package/v2Containers/Cap/selectors.js +1 -1
- package/v2Containers/CapFacebookPreview/actions.js +3 -15
- package/v2Containers/CapFacebookPreview/constants.js +3 -11
- package/v2Containers/CapFacebookPreview/index.js +6 -6
- package/v2Containers/CapFacebookPreview/reducer.js +3 -9
- package/v2Containers/CapFacebookPreview/sagas.js +6 -65
- package/v2Containers/CreativesContainer/SlideBoxContent.js +64 -1
- package/v2Containers/CreativesContainer/index.js +19 -8
- package/v2Containers/Ebill/actions.js +1 -1
- package/v2Containers/Ebill/index.js +34 -34
- package/v2Containers/Ebill/sagas.js +3 -3
- package/v2Containers/Email/reducer.js +1 -1
- package/v2Containers/EmailWrapper/index.js +4 -4
- package/v2Containers/Facebook/Advertisement/index.js +38 -15
- package/v2Containers/Facebook/Advertisement/index.scss +9 -0
- package/v2Containers/Facebook/Advertisement/messages.js +2 -2
- package/v2Containers/Facebook/actions.js +63 -0
- package/v2Containers/Facebook/constants.js +25 -1
- package/v2Containers/Facebook/index.js +135 -107
- package/v2Containers/Facebook/reducer.js +98 -1
- package/v2Containers/Facebook/sagas.js +147 -0
- package/v2Containers/Facebook/selectors.js +10 -0
- package/v2Containers/LanguageProvider/actions.js +1 -1
- package/v2Containers/Line/Container/Video/index.js +38 -41
- package/v2Containers/Line/Container/actions.js +5 -5
- package/v2Containers/Line/Container/sagas.js +4 -4
- package/v2Containers/MobilePush/Create/actions.js +2 -2
- package/v2Containers/MobilePush/Create/index.js +1 -1
- package/v2Containers/MobilePush/Create/sagas.js +2 -2
- package/v2Containers/MobilePush/Edit/actions.js +3 -3
- package/v2Containers/MobilePush/Edit/index.js +26 -26
- package/v2Containers/MobilePush/Edit/sagas.js +5 -5
- package/v2Containers/Sms/Create/index.js +4 -4
- package/v2Containers/TagList/index.js +6 -6
- package/v2Containers/Templates/_templates.scss +26 -0
- package/v2Containers/Templates/actions.js +18 -5
- package/v2Containers/Templates/constants.js +8 -0
- package/v2Containers/Templates/index.js +139 -11
- package/v2Containers/Templates/messages.js +8 -4
- package/v2Containers/Templates/reducer.js +22 -0
- package/v2Containers/Templates/sagas.js +30 -5
- package/v2Containers/TemplatesV2/index.js +13 -13
- package/v2Containers/Viber/actions.js +2 -2
- package/v2Containers/Viber/index.js +2 -1
- package/v2Containers/Viber/sagas.js +2 -2
- package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
- package/v2Containers/WeChat/MapTemplates/index.js +19 -19
- package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
|
@@ -46,7 +46,6 @@ export const LineVideo = ({
|
|
|
46
46
|
updateUploadedAssetList,
|
|
47
47
|
deleteUploadedImgList,
|
|
48
48
|
}) => {
|
|
49
|
-
|
|
50
49
|
if (activeKey !== 'video') {
|
|
51
50
|
return null;
|
|
52
51
|
}
|
|
@@ -118,7 +117,7 @@ export const LineVideo = ({
|
|
|
118
117
|
updateVideoDuration(videoDuration);
|
|
119
118
|
updateActionUrl(linkUri || actionUrl);
|
|
120
119
|
updateActionLabel(videoActionLabel);
|
|
121
|
-
updateSelectedAction(selectedAction || (
|
|
120
|
+
updateSelectedAction(selectedAction || (videoActionLabel ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON));
|
|
122
121
|
updateTitle(altText);
|
|
123
122
|
if (videoPreviewUrl) {
|
|
124
123
|
updateImagePreview(videoPreviewUrl);
|
|
@@ -224,11 +223,9 @@ export const LineVideo = ({
|
|
|
224
223
|
messageType: 'videoSrc',
|
|
225
224
|
});
|
|
226
225
|
}
|
|
227
|
-
}
|
|
226
|
+
};
|
|
228
227
|
|
|
229
|
-
const checkAction = useCallback((label = actionLabel, url = actionUrl, type = selectedAction) =>
|
|
230
|
-
return type === DISPLAY_ACTION_BUTTON ? (url && label && !updateActionLabelError(label) && !updateActionUrlError(url)) : true;
|
|
231
|
-
}, [actionLabel, actionUrl, selectedAction]);
|
|
228
|
+
const checkAction = useCallback((label = actionLabel, url = actionUrl, type = selectedAction) => type === DISPLAY_ACTION_BUTTON ? (url && label && !updateActionLabelError(label) && !updateActionUrlError(url)) : true, [actionLabel, actionUrl, selectedAction]);
|
|
232
229
|
|
|
233
230
|
const submitVideoAction = useCallback((data, incorrectFile) => {
|
|
234
231
|
const {
|
|
@@ -305,7 +302,7 @@ export const LineVideo = ({
|
|
|
305
302
|
selectedAction,
|
|
306
303
|
messageType: 'videoSrc',
|
|
307
304
|
});
|
|
308
|
-
}
|
|
305
|
+
};
|
|
309
306
|
|
|
310
307
|
const onReUpload = () => {
|
|
311
308
|
updateVideoStatus(false);
|
|
@@ -332,24 +329,24 @@ export const LineVideo = ({
|
|
|
332
329
|
selectedAction,
|
|
333
330
|
messageType: 'videoSrc',
|
|
334
331
|
});
|
|
335
|
-
}
|
|
332
|
+
};
|
|
336
333
|
|
|
337
334
|
const onSelectTemplate = useCallback((event) => {
|
|
338
335
|
event.stopPropagation();
|
|
339
336
|
updateTemplateDrawerRequirement(true);
|
|
340
|
-
}, [])
|
|
337
|
+
}, []);
|
|
341
338
|
|
|
342
339
|
const playVideo = (e) => {
|
|
343
340
|
if (e.target.paused && !isPlaying) {
|
|
344
341
|
e.target.play();
|
|
345
342
|
}
|
|
346
|
-
}
|
|
343
|
+
};
|
|
347
344
|
|
|
348
345
|
const pauseVideo = (e) => {
|
|
349
346
|
if (!e.target.paused && isPlaying) {
|
|
350
347
|
e.target.pause();
|
|
351
348
|
}
|
|
352
|
-
}
|
|
349
|
+
};
|
|
353
350
|
|
|
354
351
|
const getVideoSection = () => {
|
|
355
352
|
if (!isVideo) {
|
|
@@ -412,7 +409,7 @@ export const LineVideo = ({
|
|
|
412
409
|
onMouseOut={pauseVideo}
|
|
413
410
|
ref={videoEl}
|
|
414
411
|
>
|
|
415
|
-
|
|
412
|
+
<source src={videoSrc} type="video/mp4" />
|
|
416
413
|
</video>
|
|
417
414
|
<div style={{ marginLeft: CAP_SPACE_24 }}>
|
|
418
415
|
<CapHeading type="h6">
|
|
@@ -425,7 +422,7 @@ export const LineVideo = ({
|
|
|
425
422
|
</div>
|
|
426
423
|
</Fragment>
|
|
427
424
|
);
|
|
428
|
-
}
|
|
425
|
+
};
|
|
429
426
|
|
|
430
427
|
const onTitleChange = ({ target: { value } }) => {
|
|
431
428
|
updateTitle(value);
|
|
@@ -451,7 +448,7 @@ export const LineVideo = ({
|
|
|
451
448
|
selectedAction,
|
|
452
449
|
messageType: 'videoSrc',
|
|
453
450
|
});
|
|
454
|
-
}
|
|
451
|
+
};
|
|
455
452
|
|
|
456
453
|
const onChangeSelectedAction = () => {
|
|
457
454
|
event.stopPropagation();
|
|
@@ -474,7 +471,7 @@ export const LineVideo = ({
|
|
|
474
471
|
selectedAction: value,
|
|
475
472
|
messageType: 'videoSrc',
|
|
476
473
|
});
|
|
477
|
-
}
|
|
474
|
+
};
|
|
478
475
|
|
|
479
476
|
const updateActionLabelError = (value = '') => {
|
|
480
477
|
if (value.length > MAX_ACTION_LABEL_LENGTH) {
|
|
@@ -486,7 +483,7 @@ export const LineVideo = ({
|
|
|
486
483
|
} else {
|
|
487
484
|
updateActionLabelErrorMessage();
|
|
488
485
|
}
|
|
489
|
-
}
|
|
486
|
+
};
|
|
490
487
|
|
|
491
488
|
const updateActionUrlError = (value) => {
|
|
492
489
|
if (value === '') {
|
|
@@ -498,7 +495,7 @@ export const LineVideo = ({
|
|
|
498
495
|
} else {
|
|
499
496
|
updateActionUrlErrorMessage();
|
|
500
497
|
}
|
|
501
|
-
}
|
|
498
|
+
};
|
|
502
499
|
|
|
503
500
|
const onActionLabelChange = ({ target: { value } }) => {
|
|
504
501
|
updateActionLabel(value);
|
|
@@ -520,7 +517,7 @@ export const LineVideo = ({
|
|
|
520
517
|
selectedAction,
|
|
521
518
|
messageType: 'videoSrc',
|
|
522
519
|
});
|
|
523
|
-
}
|
|
520
|
+
};
|
|
524
521
|
|
|
525
522
|
const onActionUrlChange = ({ target: { value } }) => {
|
|
526
523
|
updateActionUrl(value);
|
|
@@ -542,10 +539,9 @@ export const LineVideo = ({
|
|
|
542
539
|
selectedAction,
|
|
543
540
|
messageType: 'videoSrc',
|
|
544
541
|
});
|
|
545
|
-
}
|
|
542
|
+
};
|
|
546
543
|
|
|
547
|
-
const getActionSection = () =>
|
|
548
|
-
return (
|
|
544
|
+
const getActionSection = () => (
|
|
549
545
|
<>
|
|
550
546
|
<CapHeading type="h6" style={{ marginTop: CAP_SPACE_12 }}>
|
|
551
547
|
<FormattedMessage {...messages.actionButtonLabel} />
|
|
@@ -558,12 +554,12 @@ export const LineVideo = ({
|
|
|
558
554
|
options={[
|
|
559
555
|
{
|
|
560
556
|
label: 'Hide',
|
|
561
|
-
value: HIDE_ACTION_BUTTON
|
|
557
|
+
value: HIDE_ACTION_BUTTON,
|
|
562
558
|
},
|
|
563
559
|
{
|
|
564
560
|
label: 'Display',
|
|
565
|
-
value: DISPLAY_ACTION_BUTTON
|
|
566
|
-
}
|
|
561
|
+
value: DISPLAY_ACTION_BUTTON,
|
|
562
|
+
},
|
|
567
563
|
]}
|
|
568
564
|
/>
|
|
569
565
|
{
|
|
@@ -593,18 +589,18 @@ export const LineVideo = ({
|
|
|
593
589
|
: null
|
|
594
590
|
}
|
|
595
591
|
</>
|
|
596
|
-
)
|
|
597
|
-
}
|
|
592
|
+
);
|
|
598
593
|
|
|
599
594
|
const getLineVideoSection = () => {
|
|
600
595
|
if (!isCreateNew) {
|
|
601
596
|
return (
|
|
602
|
-
<div
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
597
|
+
<div
|
|
598
|
+
className="form-builder-dragger" style={{
|
|
599
|
+
textAlign: 'center',
|
|
600
|
+
border: `1px dashed ${CAP_G06}`,
|
|
601
|
+
minHeight: 120,
|
|
602
|
+
padding: 60,
|
|
603
|
+
}}>
|
|
608
604
|
<CapHeader
|
|
609
605
|
className="choice-title"
|
|
610
606
|
size="regular"
|
|
@@ -634,7 +630,8 @@ export const LineVideo = ({
|
|
|
634
630
|
>
|
|
635
631
|
<FormattedMessage {...messages.textMessageSelectTemplate} />
|
|
636
632
|
</CapButton>
|
|
637
|
-
</div>
|
|
633
|
+
</div>
|
|
634
|
+
);
|
|
638
635
|
} else {
|
|
639
636
|
return (
|
|
640
637
|
<>
|
|
@@ -652,7 +649,7 @@ export const LineVideo = ({
|
|
|
652
649
|
</>
|
|
653
650
|
);
|
|
654
651
|
}
|
|
655
|
-
}
|
|
652
|
+
};
|
|
656
653
|
|
|
657
654
|
const setNewContent = useCallback(() => updateCreateNew(true), []);
|
|
658
655
|
|
|
@@ -688,9 +685,9 @@ export const LineVideo = ({
|
|
|
688
685
|
updateVideoDuration(videoDuration);
|
|
689
686
|
updateActionUrl(linkUri);
|
|
690
687
|
updateActionLabel(label);
|
|
691
|
-
updateSelectedAction(
|
|
688
|
+
updateSelectedAction(label ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON);
|
|
692
689
|
updateTitle(altText);
|
|
693
|
-
}
|
|
690
|
+
};
|
|
694
691
|
|
|
695
692
|
const getLineVideoDrawerContent = () => {
|
|
696
693
|
const lineTextTemplates = Templates.templates;
|
|
@@ -699,8 +696,8 @@ export const LineVideo = ({
|
|
|
699
696
|
}
|
|
700
697
|
|
|
701
698
|
const cardDataList = [];
|
|
702
|
-
lineTextTemplates.forEach(template => {
|
|
703
|
-
|
|
699
|
+
lineTextTemplates.forEach((template) => {
|
|
700
|
+
const templateData = {};
|
|
704
701
|
const {
|
|
705
702
|
content: {
|
|
706
703
|
messages: [{
|
|
@@ -780,7 +777,7 @@ export const LineVideo = ({
|
|
|
780
777
|
/>
|
|
781
778
|
</form>
|
|
782
779
|
</div>
|
|
783
|
-
)
|
|
784
|
-
}
|
|
780
|
+
);
|
|
781
|
+
};
|
|
785
782
|
|
|
786
|
-
export default injectIntl(withStyles(LineVideo, style));
|
|
783
|
+
export default injectIntl(withStyles(LineVideo, style));
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as types from './constants';
|
|
8
8
|
|
|
9
9
|
export function createTemplate(template, callback) {
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
return {
|
|
12
12
|
type: types.CREATE_TEMPLATE_REQUEST,
|
|
13
13
|
template,
|
|
@@ -16,7 +16,7 @@ export function createTemplate(template, callback) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function clearCreateResponse() {
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
return {
|
|
21
21
|
type: types.CLEAR_CREATE_RESPONSE_REQUEST,
|
|
22
22
|
};
|
|
@@ -50,7 +50,7 @@ export function clearAsset(templateType) {
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
export function editTemplate(template, callback) {
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
return {
|
|
55
55
|
type: types.EDIT_TEMPLATE_REQUEST,
|
|
56
56
|
template,
|
|
@@ -59,7 +59,7 @@ export function editTemplate(template, callback) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export function getTemplateDetails(id, callback) {
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
return {
|
|
64
64
|
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
65
65
|
id,
|
|
@@ -69,7 +69,7 @@ export function getTemplateDetails(id, callback) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export function clearEditResponse() {
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
return {
|
|
74
74
|
type: types.CLEAR_EDIT_RESPONSE_REQUEST,
|
|
75
75
|
};
|
|
@@ -34,13 +34,13 @@ export function* uploadAsset(file, assetType, fileParams ) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function* watchCreateTemplate() {
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
const watcher = yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
|
|
39
39
|
yield take(LOCATION_CHANGE);
|
|
40
40
|
yield cancel(watcher);
|
|
41
41
|
}
|
|
42
42
|
function* watchUploadAsset() {
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
const watcher = yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
45
45
|
yield take(LOCATION_CHANGE);
|
|
46
46
|
yield cancel(watcher);
|
|
@@ -70,7 +70,7 @@ export function* editTemplate({ template, callback }) {
|
|
|
70
70
|
|
|
71
71
|
export function* getTemplateDetails(id) {
|
|
72
72
|
try {
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
const result = yield call(Api.getTemplateDetails, id);
|
|
75
75
|
// const sidebar = result.response.sidebar;
|
|
76
76
|
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
@@ -84,7 +84,7 @@ export function* getTemplateDetails(id) {
|
|
|
84
84
|
|
|
85
85
|
export function* getLineTemplatesList(params) {
|
|
86
86
|
try {
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
|
|
89
89
|
yield put({ type: types.GET_LINE_TEMPLATES_LIST_SUCCESS, data: result.response.templates, templateData: result.response.mapped});
|
|
90
90
|
} catch (error) {
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
import * as types from './constants';
|
|
8
8
|
|
|
9
9
|
export function createTemplate(template, callback) {
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
return {
|
|
12
12
|
type: types.CREATE_TEMPLATE_REQUEST, template, callback,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function clearCreateResponse() {
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
return {
|
|
19
19
|
type: types.CLEAR_CREATE_RESPONSE_REQUEST,
|
|
20
20
|
};
|
|
@@ -9,7 +9,7 @@ import * as types from './constants';
|
|
|
9
9
|
export function* createTemplate(template) {
|
|
10
10
|
let errorMsg;
|
|
11
11
|
try {
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
const result = yield call(Api.createMobilePushTemplate, template);
|
|
14
14
|
if (result.message) {
|
|
15
15
|
errorMsg = result.message;
|
|
@@ -43,7 +43,7 @@ export function* getIosCtas(licenseCode) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function* watchCreateTemplate() {
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
const watcher = yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
|
|
48
48
|
yield take(LOCATION_CHANGE);
|
|
49
49
|
yield cancel(watcher);
|
|
@@ -14,14 +14,14 @@ export function defaultAction() {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function editTemplate(template, callback) {
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
return {
|
|
19
19
|
type: types.EDIT_TEMPLATE_REQUEST, template, callback,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function getTemplateDetails(id) {
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
return {
|
|
26
26
|
type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
|
|
27
27
|
};
|
|
@@ -41,7 +41,7 @@ export function uploadAsset(file, assetType, fileParams, mode) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
export function clearEditResponse() {
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
return {
|
|
46
46
|
type: types.CLEAR_EDIT_RESPONSE_REQUEST,
|
|
47
47
|
};
|
|
@@ -58,7 +58,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
58
58
|
this.getLinkTypeFields = getLinkTypeFields.bind(this);
|
|
59
59
|
}
|
|
60
60
|
componentWillMount() {
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
this.props.actions.getWeCrmAccounts("mobilepush");
|
|
63
63
|
if (!this.props.Templates.selectedWeChatAccount && this.props.location.query.type !== 'embedded') {
|
|
64
64
|
const type = this.props.location.query.type;
|
|
@@ -74,7 +74,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
74
74
|
version: "v2",
|
|
75
75
|
};
|
|
76
76
|
this.props.globalActions.fetchSchemaForEntity(query);
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
componentDidMount() {
|
|
@@ -106,7 +106,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
106
106
|
}
|
|
107
107
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
108
108
|
if (this.props.location.query.type === 'embedded' && !nextProps.Edit.fetchingWeCrmAccounts && !_.isEqual(this.props.Edit.weCrmAccounts, nextProps.Edit.weCrmAccounts) && (!selectedWeChatAccount || _.isEmpty(selectedWeChatAccount))) {
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
this.setMobilePushAccountOptions(nextProps.Edit.weCrmAccounts);
|
|
111
111
|
}
|
|
112
112
|
if (!_.isEmpty(nextProps.Edit.selectedWeChatAccount) && !_.isEqual(this.props.Edit.selectedWeChatAccount, nextProps.Edit.selectedWeChatAccount) && (this.props.location.query.type === 'embedded') && this.props.location.query.module === "loyalty") {
|
|
@@ -190,7 +190,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
onFormDataChange = (formData, tabCount, currentTab, inputField) => {
|
|
193
|
-
|
|
193
|
+
|
|
194
194
|
const newFormData = _.cloneDeep(formData);
|
|
195
195
|
const {templateCta} = this.state;
|
|
196
196
|
if (!_.isEmpty(templateCta) && this.state.currentTab === 2) {
|
|
@@ -256,12 +256,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
256
256
|
};
|
|
257
257
|
|
|
258
258
|
onTabChange = (data) => {
|
|
259
|
-
|
|
259
|
+
|
|
260
260
|
this.setState({currentTab: data});
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
onTagSelect = (data, currentTab, srcComp) => {
|
|
264
|
-
|
|
264
|
+
|
|
265
265
|
const editorId = srcComp.target;
|
|
266
266
|
this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
|
|
267
267
|
document.getElementById(editorId).focus();
|
|
@@ -272,7 +272,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
onUpdateTemplateComplete = () => {
|
|
275
|
-
|
|
275
|
+
|
|
276
276
|
const label = this.props.location.pathname.indexOf('image') >= 0 ? 'image' : 'text';
|
|
277
277
|
GA.timeTracker.stopTimer(TRACK_EDIT_MPUSH, {
|
|
278
278
|
category: 'Creatives',
|
|
@@ -598,13 +598,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
598
598
|
getMappedEvent = (id, event) => {
|
|
599
599
|
const map = this.state.eventsMap;
|
|
600
600
|
if (!map[id] || !map[id][event]) {
|
|
601
|
-
|
|
601
|
+
|
|
602
602
|
}
|
|
603
603
|
return map[id][event];
|
|
604
604
|
};
|
|
605
605
|
|
|
606
606
|
getCurrentWindow = (e) => {
|
|
607
|
-
|
|
607
|
+
|
|
608
608
|
const response = {
|
|
609
609
|
action: e.action,
|
|
610
610
|
value: 'edit',
|
|
@@ -614,13 +614,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
614
614
|
};
|
|
615
615
|
|
|
616
616
|
getFormData = (e) => {
|
|
617
|
-
|
|
617
|
+
|
|
618
618
|
const response = {
|
|
619
619
|
action: "getFormData",
|
|
620
620
|
value: this.getTransformedData(this.state.formData),
|
|
621
621
|
validity: this.state.isFormValid,
|
|
622
622
|
};
|
|
623
|
-
|
|
623
|
+
|
|
624
624
|
this.setState({checkValidation: true}, this.showError);
|
|
625
625
|
if (e) {
|
|
626
626
|
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
@@ -630,7 +630,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
630
630
|
|
|
631
631
|
|
|
632
632
|
setEditState(data, schema) {
|
|
633
|
-
|
|
633
|
+
|
|
634
634
|
const tabCount = Object.keys(data.versions.base).length;
|
|
635
635
|
const formData = {};
|
|
636
636
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === "loyalty") {
|
|
@@ -770,7 +770,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
770
770
|
formData[0].base = true;
|
|
771
771
|
// formData[0].tabKey = '1';
|
|
772
772
|
// formData[1].tabKey = '2';
|
|
773
|
-
|
|
773
|
+
|
|
774
774
|
this.setState({templateCta}, () => {
|
|
775
775
|
this.getSchemaForFormData(formData, schema);
|
|
776
776
|
this.setState({tabCount, formData, editData: data, currentTab: 1}, () => {
|
|
@@ -1356,7 +1356,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1356
1356
|
|
|
1357
1357
|
|
|
1358
1358
|
startTemplateCreation = (data) => {
|
|
1359
|
-
|
|
1359
|
+
|
|
1360
1360
|
if (!this.state.isContentEditLoaded && this.state.fullSchema && this.props.Edit.weCrmAccounts) {
|
|
1361
1361
|
const schema = JSON.stringify(data).indexOf("BIG_PICTURE") > -1 ? this.state.fullSchema.imageSchema : this.state.fullSchema.textSchema;
|
|
1362
1362
|
this.setMobilePushAccountOptions(this.props.Edit.weCrmAccounts, data.content.accId);
|
|
@@ -1372,7 +1372,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1372
1372
|
}
|
|
1373
1373
|
};
|
|
1374
1374
|
discardValues = () => {
|
|
1375
|
-
|
|
1375
|
+
|
|
1376
1376
|
this.resetSchema();
|
|
1377
1377
|
this.setState({
|
|
1378
1378
|
formData: {},
|
|
@@ -1398,7 +1398,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1398
1398
|
|
|
1399
1399
|
};
|
|
1400
1400
|
moveToTemplates = () => {
|
|
1401
|
-
|
|
1401
|
+
|
|
1402
1402
|
const modalContent = {
|
|
1403
1403
|
title: this.props.intl.formatMessage(messages.alertMessage),
|
|
1404
1404
|
body: this.props.intl.formatMessage(messages.goBackTemporaryChangesLost),
|
|
@@ -1473,17 +1473,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1473
1473
|
};
|
|
1474
1474
|
|
|
1475
1475
|
saveFormData = (formData) => {
|
|
1476
|
-
|
|
1476
|
+
|
|
1477
1477
|
const obj = this.getTransformedData(formData);
|
|
1478
|
-
|
|
1478
|
+
|
|
1479
1479
|
this.props.actions.editTemplate(obj, this.onUpdateTemplateComplete);
|
|
1480
1480
|
};
|
|
1481
1481
|
handleFrameTasks = (e) => {
|
|
1482
|
-
//
|
|
1482
|
+
//
|
|
1483
1483
|
const type = e.data;
|
|
1484
|
-
|
|
1484
|
+
|
|
1485
1485
|
if (typeof type === 'object') {
|
|
1486
|
-
//
|
|
1486
|
+
//
|
|
1487
1487
|
const action = type.action;
|
|
1488
1488
|
switch (action) {
|
|
1489
1489
|
case "startTemplateCreation":
|
|
@@ -1504,15 +1504,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1504
1504
|
this.getFormData(e);
|
|
1505
1505
|
break;
|
|
1506
1506
|
case "startTemplateCreation":
|
|
1507
|
-
|
|
1507
|
+
|
|
1508
1508
|
//this.getFormData(e);
|
|
1509
1509
|
break;
|
|
1510
1510
|
case "moveToTemplates":
|
|
1511
|
-
|
|
1511
|
+
|
|
1512
1512
|
this.moveToTemplates();
|
|
1513
1513
|
break;
|
|
1514
1514
|
case "validateContent":
|
|
1515
|
-
|
|
1515
|
+
|
|
1516
1516
|
this.validateContent(e);
|
|
1517
1517
|
break;
|
|
1518
1518
|
default:
|
|
@@ -1721,7 +1721,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1721
1721
|
tempContainer = this.injectContainer(tempContainer);
|
|
1722
1722
|
return tempContainer;
|
|
1723
1723
|
});
|
|
1724
|
-
|
|
1724
|
+
|
|
1725
1725
|
this.setState({schema, loadingContentEdit: false}, () => {
|
|
1726
1726
|
this.removeStandAlone();
|
|
1727
1727
|
});
|
|
@@ -1742,7 +1742,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1742
1742
|
this.setState({ schema });
|
|
1743
1743
|
};
|
|
1744
1744
|
handleOnTagsContextChange = (data) => {
|
|
1745
|
-
|
|
1745
|
+
|
|
1746
1746
|
const query = {
|
|
1747
1747
|
layout: 'mobilepush',
|
|
1748
1748
|
type: 'TAG',
|
|
@@ -8,9 +8,9 @@ import * as types from './constants';
|
|
|
8
8
|
export function* editTemplate(template) {
|
|
9
9
|
let errorMsg;
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
const result = yield call(Api.createMobilePushTemplate, template);
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
if (result.message || result.status.code === 500) {
|
|
15
15
|
errorMsg = result.message;
|
|
16
16
|
}
|
|
@@ -23,7 +23,7 @@ export function* editTemplate(template) {
|
|
|
23
23
|
|
|
24
24
|
export function* getTemplateDetails(id) {
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
const result = yield call(Api.getTemplateDetails, id);
|
|
28
28
|
// const sidebar = result.response.sidebar;
|
|
29
29
|
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
@@ -50,7 +50,7 @@ export function* getIosCtas(licenseCode) {
|
|
|
50
50
|
|
|
51
51
|
export function* getMobilepushTemplatesList(params) {
|
|
52
52
|
try {
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
|
|
55
55
|
yield put({ type: types.GET_MOBILEPUSH_TEMPLATES_LIST_SUCCESS, data: result.response.templates, templateData: result.response.mapped});
|
|
56
56
|
} catch (error) {
|
|
@@ -59,7 +59,7 @@ export function* getMobilepushTemplatesList(params) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export function* fetchWeCrmAccounts(action) {
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
try {
|
|
64
64
|
const result = yield call(Api.fetchWeCrmAccounts, action.source);
|
|
65
65
|
yield [
|
|
@@ -752,11 +752,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
startTemplateCreation(data) {
|
|
755
|
-
|
|
755
|
+
|
|
756
756
|
if (data.edit) {
|
|
757
|
-
|
|
757
|
+
|
|
758
758
|
const ifUnicode = checkUnicode(data.content ? data.content : '');
|
|
759
|
-
|
|
759
|
+
|
|
760
760
|
const content = data.content;
|
|
761
761
|
const id = _.uniqueId();
|
|
762
762
|
const tempData = {
|
|
@@ -772,7 +772,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
772
772
|
this.setState({tabKey: ''});
|
|
773
773
|
});
|
|
774
774
|
} else {
|
|
775
|
-
|
|
775
|
+
|
|
776
776
|
this.setState({injectedTags: data.tags});
|
|
777
777
|
}
|
|
778
778
|
this.props.globalActions.setInjectedTags(data.tags);
|