@capillarytech/creatives-library 7.6.12 → 7.6.13
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 +5 -0
- package/index.html +2 -2
- package/package.json +2 -2
- package/services/api.js +2 -0
- package/utils/gtmTrackers/gtmEvents/creativeDetails.js +41 -0
- package/utils/gtmTrackers/index.js +17 -0
- package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/v2Containers/App/constants.js +11 -0
- package/v2Containers/Cap/index.js +23 -29
- package/v2Containers/Email/index.js +14 -3
- package/v2Containers/EmailWrapper/index.js +10 -3
- package/v2Containers/Line/Container/index.js +32 -4
- package/v2Containers/Line/Create/_lineCreate.scss +64 -0
- package/v2Containers/Line/Create/actions.js +94 -0
- package/v2Containers/Line/Create/constants.js +43 -0
- package/v2Containers/Line/Create/index.js +1132 -0
- package/v2Containers/Line/Create/initialSchema.js +378 -0
- package/v2Containers/Line/Create/messages.js +229 -0
- package/v2Containers/Line/Create/reducer.js +99 -0
- package/v2Containers/Line/Create/sagas.js +113 -0
- package/v2Containers/Line/Create/selectors.js +30 -0
- package/v2Containers/Line/CreateWrapper/constants.js +2 -0
- package/v2Containers/Line/CreateWrapper/index.js +117 -0
- package/v2Containers/Line/CreateWrapper/messages.js +55 -0
- package/v2Containers/Line/Edit/_lineEdit.scss +23 -0
- package/v2Containers/Line/Edit/actions.js +79 -0
- package/v2Containers/Line/Edit/constants.js +27 -0
- package/v2Containers/Line/Edit/index.js +1051 -0
- package/v2Containers/Line/Edit/messages.js +173 -0
- package/v2Containers/Line/Edit/reducer.js +83 -0
- package/v2Containers/Line/Edit/sagas.js +81 -0
- package/v2Containers/Line/Edit/selectors.js +29 -0
- package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
- package/v2Containers/Line/Edit/tests/index.test.js +10 -0
- package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
- package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
- package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
- package/v2Containers/MobilePush/Create/index.js +25 -4
- package/v2Containers/MobilePush/Edit/index.js +27 -5
- package/v2Containers/MobilePush/Edit/sagas.js +1 -1
- package/v2Containers/MobilePush/commonMethods.js +19 -1
- package/v2Containers/Sms/Create/index.js +14 -2
- package/v2Containers/Sms/Edit/index.js +15 -2
- package/v2Containers/Templates/index.js +7 -4
- package/v2Containers/Viber/index.js +19 -3
- package/v2Containers/WeChat/MapTemplates/index.js +12 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +11 -2
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
} from '../App/constants';
|
|
63
63
|
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, VIBER, FACEBOOK } from '../CreativesContainer/constants';
|
|
64
64
|
|
|
65
|
-
import {CREATIVE} from '../Facebook/constants'
|
|
65
|
+
import {CREATIVE} from '../Facebook/constants';
|
|
66
66
|
|
|
67
67
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
68
68
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
@@ -1139,8 +1139,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1139
1139
|
//const keyType = ev.key && ev.key.toLowerCase() !== undefined ? ev.state.toLowerCase() : '';
|
|
1140
1140
|
let routeParams = {};
|
|
1141
1141
|
const {fbAdManager} = this.props;
|
|
1142
|
-
|
|
1143
|
-
if (
|
|
1142
|
+
const isLibraryMode = this.isEnabledInLibraryModule("callCreateFromProps");
|
|
1143
|
+
if (!isLibraryMode) {
|
|
1144
|
+
timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
|
|
1145
|
+
}
|
|
1146
|
+
if (isLibraryMode) {
|
|
1144
1147
|
if (this.props.fbAdManager === CREATIVE) {
|
|
1145
1148
|
this.props.createNew(fbAdManager);
|
|
1146
1149
|
} else {
|
|
@@ -1363,7 +1366,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1363
1366
|
};
|
|
1364
1367
|
|
|
1365
1368
|
handleEditClick(e, template, modeType, path, options) {
|
|
1366
|
-
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1367
1369
|
if (modeType && modeType !== undefined) {
|
|
1368
1370
|
this.setState({modeType});
|
|
1369
1371
|
}
|
|
@@ -1418,6 +1420,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1418
1420
|
if (this.isEnabledInLibraryModule("callSelectFromProps")) {
|
|
1419
1421
|
this.props.onSelectTemplate(this.selectTemplate(id), this.props.fbAdManager);
|
|
1420
1422
|
} else {
|
|
1423
|
+
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1421
1424
|
if (this.state.channel.toLowerCase() === 'ebill') {
|
|
1422
1425
|
pathName = `/ebill/edit/${id}`;
|
|
1423
1426
|
}
|
|
@@ -49,6 +49,10 @@ import {
|
|
|
49
49
|
VIBER_IMG_SIZE,
|
|
50
50
|
charLimit,
|
|
51
51
|
} from './constants';
|
|
52
|
+
import { GA } from '@capillarytech/cap-ui-utils';
|
|
53
|
+
import { CREATE, EDIT, TRACK_CREATE_VIBER, TRACK_EDIT_VIBER } from '../App/constants';
|
|
54
|
+
import { gtmPush } from '../../utils/gtmTrackers';
|
|
55
|
+
import { VIBER } from '../CreativesContainer/constants';
|
|
52
56
|
const { CapHeadingSpan } = CapHeading;
|
|
53
57
|
const { TextArea } = CapInput;
|
|
54
58
|
|
|
@@ -562,7 +566,7 @@ const Viber = (props) => {
|
|
|
562
566
|
};
|
|
563
567
|
};
|
|
564
568
|
|
|
565
|
-
const createCallback = (errorMessage, isEdit) => {
|
|
569
|
+
const createCallback = ({errorMessage, resp}, isEdit) => {
|
|
566
570
|
if (!errorMessage) {
|
|
567
571
|
CapNotification.success({
|
|
568
572
|
message: isEdit ? formatMessage(messages.viberEditNotification) : formatMessage(messages.viberCreateNotification),
|
|
@@ -572,6 +576,18 @@ const Viber = (props) => {
|
|
|
572
576
|
} else {
|
|
573
577
|
actions.clearCreateResponse();
|
|
574
578
|
}
|
|
579
|
+
const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_VIBER : TRACK_CREATE_VIBER, {
|
|
580
|
+
category: 'Creatives',
|
|
581
|
+
action: isEdit ? TRACK_EDIT_VIBER : TRACK_CREATE_VIBER,
|
|
582
|
+
});
|
|
583
|
+
gtmPush('creativeDetails', {
|
|
584
|
+
id: resp.templateId._id || resp.templateId,
|
|
585
|
+
name: messageTitle,
|
|
586
|
+
channel: VIBER,
|
|
587
|
+
timeTaken,
|
|
588
|
+
content: messageContent,
|
|
589
|
+
mode: isEdit ? EDIT : CREATE
|
|
590
|
+
});
|
|
575
591
|
} else {
|
|
576
592
|
CapNotification.error({
|
|
577
593
|
message: errorMessage,
|
|
@@ -583,7 +599,7 @@ const Viber = (props) => {
|
|
|
583
599
|
actions.createTemplate(
|
|
584
600
|
formatSubmitPayload(),
|
|
585
601
|
(resp, errorMessage) => {
|
|
586
|
-
createCallback(errorMessage);
|
|
602
|
+
createCallback({resp, errorMessage});
|
|
587
603
|
onCreateComplete();
|
|
588
604
|
}
|
|
589
605
|
);
|
|
@@ -596,7 +612,7 @@ const Viber = (props) => {
|
|
|
596
612
|
_id: params.id,
|
|
597
613
|
},
|
|
598
614
|
(resp, errorMessage) => {
|
|
599
|
-
createCallback(errorMessage, true);
|
|
615
|
+
createCallback({resp, errorMessage}, true);
|
|
600
616
|
onCreateComplete();
|
|
601
617
|
});
|
|
602
618
|
};
|
|
@@ -30,7 +30,9 @@ import * as templateActions from '../../Templates/actions';
|
|
|
30
30
|
import './_mapTemplates.scss';
|
|
31
31
|
import withCreatives from '../../../hoc/withCreatives';
|
|
32
32
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
33
|
-
import { TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../App/constants';
|
|
33
|
+
import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../App/constants';
|
|
34
|
+
import { gtmPush } from '../../../utils/gtmTrackers';
|
|
35
|
+
import { WECHAT } from '../../CreativesContainer/constants';
|
|
34
36
|
|
|
35
37
|
const SELECT_TEMPLATE_MODE = "selectTemplate";
|
|
36
38
|
const MAP_TEMPLATE_MODE = "mapTemplateMode";
|
|
@@ -1172,12 +1174,19 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
1172
1174
|
getFormData(this.getFormData(obj));
|
|
1173
1175
|
}, 0);
|
|
1174
1176
|
}
|
|
1175
|
-
GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
|
|
1177
|
+
const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
|
|
1176
1178
|
category: 'Creatives',
|
|
1177
1179
|
action: isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT,
|
|
1178
1180
|
label : 'MapTemplates',
|
|
1179
1181
|
});
|
|
1180
|
-
|
|
1182
|
+
gtmPush('creativeDetails', {
|
|
1183
|
+
id: response.templateId._id || response.templateId,
|
|
1184
|
+
name: obj?.versions?.base?.Title,
|
|
1185
|
+
channel: `${WECHAT} Maptemplate`,
|
|
1186
|
+
timeTaken,
|
|
1187
|
+
content: this.state.formData?.base?.['sms-editor'],
|
|
1188
|
+
mode: isEdit ? EDIT : CREATE
|
|
1189
|
+
});
|
|
1181
1190
|
});
|
|
1182
1191
|
}
|
|
1183
1192
|
|
|
@@ -29,7 +29,9 @@ import noImage from '../../../../assets/noImage.png';
|
|
|
29
29
|
import Pagination from '../../../../v2Components/Pagination';
|
|
30
30
|
import { CAP_SPACE_08, CAP_SPACE_12, CAP_SPACE_16 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
31
31
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
32
|
-
import { TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
|
|
32
|
+
import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
|
|
33
|
+
import { gtmPush } from '../../../../utils/gtmTrackers';
|
|
34
|
+
import { WECHAT } from '../../../CreativesContainer/constants';
|
|
33
35
|
export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
34
36
|
constructor(props) {
|
|
35
37
|
super(props);
|
|
@@ -556,11 +558,18 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
556
558
|
// CapNotification.success({
|
|
557
559
|
// message: this.props.intl.formatMessage(messages.saveSuccess),
|
|
558
560
|
// });
|
|
559
|
-
GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
|
|
561
|
+
const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
|
|
560
562
|
category: 'Creatives',
|
|
561
563
|
action: isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT,
|
|
562
564
|
label: 'RichMedia',
|
|
563
565
|
});
|
|
566
|
+
gtmPush('creativeDetails', {
|
|
567
|
+
id: response.templateId._id || response.templateId,
|
|
568
|
+
name: saveObj?.name,
|
|
569
|
+
channel: `${WECHAT} Richmedia`,
|
|
570
|
+
timeTaken,
|
|
571
|
+
mode: isEdit ? EDIT : CREATE
|
|
572
|
+
});
|
|
564
573
|
if (getFormData) {
|
|
565
574
|
getFormData(this.getFormData({
|
|
566
575
|
mediaId: response.mediaId,
|