@capillarytech/creatives-library 7.7.0 → 7.7.1
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 +4 -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/Facebook/Advertisement/index.js +9 -2
- 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 -7
- package/v2Containers/Templates/reducer.js +3 -1
- package/v2Containers/Viber/index.js +19 -3
- package/v2Containers/WeChat/MapTemplates/index.js +12 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +11 -2
|
@@ -454,7 +454,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
454
454
|
this.setState({previewTemplate: nextProps.Templates.templateDetails});
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
if (nextProps.Templates.weCrmAccounts !== undefined && nextProps.Templates.weCrmAccounts.length === 1 && this.state.defaultAccount && (['wechat'
|
|
457
|
+
if (nextProps.Templates.weCrmAccounts !== undefined && nextProps.Templates.weCrmAccounts.length === 1 && this.state.defaultAccount && (['wechat'].indexOf(this.state.channel.toLowerCase()) > -1)) {
|
|
458
458
|
const paramsDefault = {
|
|
459
459
|
name: this.state.searchText,
|
|
460
460
|
sortBy: this.state.sortBy,
|
|
@@ -464,9 +464,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
464
464
|
paramsDefault.wecrmToken = nextProps.Templates.weCrmAccounts[0].configs.wecrm_token;
|
|
465
465
|
paramsDefault.originalId = nextProps.Templates.weCrmAccounts[0].sourceAccountIdentifier;
|
|
466
466
|
nextProps.actions.setWeChatAccount(nextProps.Templates.weCrmAccounts[0]);
|
|
467
|
-
} else if (this.state.channel.toLowerCase() === 'mobilepush') {
|
|
468
|
-
nextProps.actions.setWeChatAccount(nextProps.Templates.weCrmAccounts[0]);
|
|
469
|
-
paramsDefault.accountId = nextProps.Templates.weCrmAccounts[0].id;
|
|
470
467
|
}
|
|
471
468
|
this.setState({defaultAccount: false, activeMode: TEMPLATES_MODE, selectedAccount: nextProps.Templates.weCrmAccounts[0].name });
|
|
472
469
|
this.getAllTemplates({params: paramsDefault}, true);
|
|
@@ -1139,8 +1136,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1139
1136
|
const channel = this.state.channel.toLowerCase();
|
|
1140
1137
|
//const keyType = ev.key && ev.key.toLowerCase() !== undefined ? ev.state.toLowerCase() : '';
|
|
1141
1138
|
let routeParams = {};
|
|
1142
|
-
|
|
1143
|
-
if
|
|
1139
|
+
const isLibraryMode = this.isEnabledInLibraryModule("callCreateFromProps");
|
|
1140
|
+
if(!isLibraryMode) {
|
|
1141
|
+
timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
|
|
1142
|
+
}
|
|
1143
|
+
if (isLibraryMode) {
|
|
1144
1144
|
this.props.createNew();
|
|
1145
1145
|
} else if (ev.key && (ev.key.toLowerCase() === "text" || ev.key.toLowerCase() === "image")) {
|
|
1146
1146
|
routeParams = {
|
|
@@ -1359,7 +1359,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1359
1359
|
};
|
|
1360
1360
|
|
|
1361
1361
|
handleEditClick(e, template, modeType, path, options) {
|
|
1362
|
-
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1363
1362
|
if (modeType && modeType !== undefined) {
|
|
1364
1363
|
this.setState({modeType});
|
|
1365
1364
|
}
|
|
@@ -1414,6 +1413,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1414
1413
|
if (this.isEnabledInLibraryModule("callSelectFromProps")) {
|
|
1415
1414
|
this.props.onSelectTemplate(id);
|
|
1416
1415
|
} else {
|
|
1416
|
+
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1417
1417
|
if (this.state.channel.toLowerCase() === 'ebill') {
|
|
1418
1418
|
pathName = `/ebill/edit/${id}`;
|
|
1419
1419
|
}
|
|
@@ -67,7 +67,9 @@ function templatesReducer(state = initialState, action) {
|
|
|
67
67
|
case types.GET_WECRM_ACCOUNTS_REQUEST:
|
|
68
68
|
return state
|
|
69
69
|
.set('fetchingWeCrmAccounts', true)
|
|
70
|
-
.set('weCrmAccountFetchingError', false)
|
|
70
|
+
.set('weCrmAccountFetchingError', false)
|
|
71
|
+
.remove('selectedWeChatAccount')
|
|
72
|
+
.remove('weCrmAccounts');
|
|
71
73
|
case types.GET_WECRM_ACCOUNTS_SUCCESS:
|
|
72
74
|
return state
|
|
73
75
|
.set('fetchingWeCrmAccounts', false)
|
|
@@ -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,
|