@capillarytech/creatives-library 7.7.0 → 7.7.3
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/index.js +3 -3
- 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/index.js +1 -0
- package/v2Containers/App/constants.js +11 -0
- package/v2Containers/Cap/index.js +23 -29
- package/v2Containers/CapFacebookPreview/index.js +9 -9
- package/v2Containers/CapFacebookPreview/index.scss +15 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +16 -1
- package/v2Containers/CreativesContainer/index.js +122 -12
- package/v2Containers/Email/index.js +14 -3
- package/v2Containers/EmailWrapper/index.js +10 -3
- package/v2Containers/Facebook/Advertisement/index.js +72 -36
- package/v2Containers/Facebook/Advertisement/index.scss +1 -1
- package/v2Containers/Facebook/Facebook.style.js +1 -1
- package/v2Containers/Facebook/constants.js +4 -0
- package/v2Containers/Facebook/index.js +198 -122
- package/v2Containers/Facebook/messages.js +24 -4
- package/v2Containers/Line/Container/index.js +32 -4
- 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 +43 -27
- package/v2Containers/Templates/messages.js +1 -1
- package/v2Containers/Templates/reducer.js +4 -2
- package/v2Containers/TemplatesV2/index.js +23 -6
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/index.js +19 -3
- package/v2Containers/WeChat/MapTemplates/index.js +12 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +11 -2
|
@@ -21,13 +21,14 @@ import messages from './messages';
|
|
|
21
21
|
import * as charCount from '../../../utils/smsCharCount';
|
|
22
22
|
import {checkUnicode, updateCharCount} from '../../../utils/smsCharCountV2';
|
|
23
23
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
24
|
+
import { gtmPush } from '../../../utils/gtmTrackers';
|
|
24
25
|
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
25
26
|
import {SMS} from '../../CreativesContainer/constants';
|
|
26
27
|
// import callNativeEvent from '../../../utils/callNativeEvent';
|
|
27
28
|
import {showError} from '../commonMethods';
|
|
28
29
|
import withCreatives from '../../../hoc/withCreatives';
|
|
29
30
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
30
|
-
import { TRACK_CREATE_SMS } from '../../App/constants';
|
|
31
|
+
import { CREATE, TRACK_CREATE_SMS } from '../../App/constants';
|
|
31
32
|
export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
32
33
|
constructor(props) {
|
|
33
34
|
super(props);
|
|
@@ -203,11 +204,22 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
203
204
|
this.setState({currentTab: data});
|
|
204
205
|
}
|
|
205
206
|
onCreateTemplateComplete = (editResponse) => {
|
|
206
|
-
GA.timeTracker.stopTimer(TRACK_CREATE_SMS, {
|
|
207
|
+
const timeTaken = GA.timeTracker.stopTimer(TRACK_CREATE_SMS, {
|
|
207
208
|
category: 'Creatives',
|
|
208
209
|
action: TRACK_CREATE_SMS,
|
|
209
210
|
});
|
|
211
|
+
const {
|
|
212
|
+
formData
|
|
213
|
+
} = this.state;
|
|
210
214
|
if (editResponse.templateId) {
|
|
215
|
+
gtmPush('creativeDetails', {
|
|
216
|
+
id: editResponse.templateId,
|
|
217
|
+
name: formData?.['template-name'],
|
|
218
|
+
channel: SMS,
|
|
219
|
+
timeTaken,
|
|
220
|
+
content: formData?.base?.['sms-editor'],
|
|
221
|
+
mode: CREATE
|
|
222
|
+
});
|
|
211
223
|
this.resetSchema();
|
|
212
224
|
this.setState({
|
|
213
225
|
formData: {},
|
|
@@ -21,12 +21,14 @@ import {checkUnicode, updateCharCount} from '../../../utils/smsCharCountV2';
|
|
|
21
21
|
import '../Create/_smsCreate.scss';
|
|
22
22
|
import messages from './messages';
|
|
23
23
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
24
|
+
import { gtmPush } from '../../../utils/gtmTrackers';
|
|
24
25
|
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
25
26
|
// import callNativeEvent from '../../../utils/callNativeEvent';
|
|
26
27
|
import {showError} from '../commonMethods';
|
|
27
28
|
import withCreatives from '../../../hoc/withCreatives';
|
|
28
|
-
import { TRACK_EDIT_SMS } from '../../App/constants';
|
|
29
|
+
import { EDIT, TRACK_EDIT_SMS } from '../../App/constants';
|
|
29
30
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
31
|
+
import { SMS } from '../../CreativesContainer/constants';
|
|
30
32
|
export class Edit extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
31
33
|
constructor(props) {
|
|
32
34
|
super(props);
|
|
@@ -220,11 +222,22 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
220
222
|
this.setState({currentTab: data});
|
|
221
223
|
}
|
|
222
224
|
onUpdateTemplateComplete = (editResponse) => {
|
|
223
|
-
GA.timeTracker.stopTimer(TRACK_EDIT_SMS, {
|
|
225
|
+
const timeTaken = GA.timeTracker.stopTimer(TRACK_EDIT_SMS, {
|
|
224
226
|
category: 'Creatives',
|
|
225
227
|
action: TRACK_EDIT_SMS,
|
|
226
228
|
});
|
|
229
|
+
const {
|
|
230
|
+
formData
|
|
231
|
+
} = this.state;
|
|
227
232
|
if (editResponse.templateId) {
|
|
233
|
+
gtmPush('creativeDetails', {
|
|
234
|
+
id: editResponse.templateId,
|
|
235
|
+
name: formData?.['template-name'],
|
|
236
|
+
channel: SMS,
|
|
237
|
+
timeTaken,
|
|
238
|
+
content: formData?.base?.['sms-editor'],
|
|
239
|
+
mode: EDIT
|
|
240
|
+
})
|
|
228
241
|
this.resetSchema();
|
|
229
242
|
this.setState({
|
|
230
243
|
formData: {},
|
|
@@ -62,6 +62,8 @@ 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';
|
|
66
|
+
|
|
65
67
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
66
68
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
67
69
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
@@ -321,7 +323,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
321
323
|
}
|
|
322
324
|
const fbSetting = get(nextProps.Templates, 'campaignSettings.accountSettings.socialAccountSettings.facebookAccountSettings', []);
|
|
323
325
|
const { accountName = "",
|
|
324
|
-
|
|
326
|
+
orgUnitFacebookPageSettingsMap = {},
|
|
325
327
|
} = fbSetting[0] || {};
|
|
326
328
|
let pageAccessToken = false;
|
|
327
329
|
if (!isEmpty(orgUnitFacebookPageSettingsMap)) {
|
|
@@ -454,7 +456,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
454
456
|
this.setState({previewTemplate: nextProps.Templates.templateDetails});
|
|
455
457
|
}
|
|
456
458
|
|
|
457
|
-
if (nextProps.Templates.weCrmAccounts !== undefined && nextProps.Templates.weCrmAccounts.length === 1 && this.state.defaultAccount && (['wechat'
|
|
459
|
+
if (nextProps.Templates.weCrmAccounts !== undefined && nextProps.Templates.weCrmAccounts.length === 1 && this.state.defaultAccount && (['wechat'].indexOf(this.state.channel.toLowerCase()) > -1)) {
|
|
458
460
|
const paramsDefault = {
|
|
459
461
|
name: this.state.searchText,
|
|
460
462
|
sortBy: this.state.sortBy,
|
|
@@ -464,9 +466,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
464
466
|
paramsDefault.wecrmToken = nextProps.Templates.weCrmAccounts[0].configs.wecrm_token;
|
|
465
467
|
paramsDefault.originalId = nextProps.Templates.weCrmAccounts[0].sourceAccountIdentifier;
|
|
466
468
|
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
469
|
}
|
|
471
470
|
this.setState({defaultAccount: false, activeMode: TEMPLATES_MODE, selectedAccount: nextProps.Templates.weCrmAccounts[0].name });
|
|
472
471
|
this.getAllTemplates({params: paramsDefault}, true);
|
|
@@ -511,7 +510,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
511
510
|
}
|
|
512
511
|
|
|
513
512
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
514
|
-
|
|
513
|
+
|
|
515
514
|
this.getAllTemplates({params, resetPage: true});
|
|
516
515
|
});
|
|
517
516
|
}
|
|
@@ -1139,9 +1138,17 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1139
1138
|
const channel = this.state.channel.toLowerCase();
|
|
1140
1139
|
//const keyType = ev.key && ev.key.toLowerCase() !== undefined ? ev.state.toLowerCase() : '';
|
|
1141
1140
|
let routeParams = {};
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1141
|
+
const {fbAdManager} = this.props;
|
|
1142
|
+
const isLibraryMode = this.isEnabledInLibraryModule("callCreateFromProps");
|
|
1143
|
+
if (!isLibraryMode) {
|
|
1144
|
+
timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
|
|
1145
|
+
}
|
|
1146
|
+
if (isLibraryMode) {
|
|
1147
|
+
if (this.props.fbAdManager === CREATIVE) {
|
|
1148
|
+
this.props.createNew(fbAdManager);
|
|
1149
|
+
} else {
|
|
1150
|
+
this.props.createNew();
|
|
1151
|
+
}
|
|
1145
1152
|
} else if (ev.key && (ev.key.toLowerCase() === "text" || ev.key.toLowerCase() === "image")) {
|
|
1146
1153
|
routeParams = {
|
|
1147
1154
|
pathname: `/${channel === 'line' ? 'line' : 'mobilepush'}/create/${ev.key.toLowerCase()}`,
|
|
@@ -1359,7 +1366,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1359
1366
|
};
|
|
1360
1367
|
|
|
1361
1368
|
handleEditClick(e, template, modeType, path, options) {
|
|
1362
|
-
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1363
1369
|
if (modeType && modeType !== undefined) {
|
|
1364
1370
|
this.setState({modeType});
|
|
1365
1371
|
}
|
|
@@ -1412,8 +1418,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1412
1418
|
}
|
|
1413
1419
|
}
|
|
1414
1420
|
if (this.isEnabledInLibraryModule("callSelectFromProps")) {
|
|
1415
|
-
this.props.onSelectTemplate(id);
|
|
1421
|
+
this.props.onSelectTemplate(this.selectTemplate(id), this.props.fbAdManager);
|
|
1416
1422
|
} else {
|
|
1423
|
+
timeTracker.startTimer(CHANNEL_EDIT_TRACK_MAPPING[this.state.channel.toLowerCase()]);
|
|
1417
1424
|
if (this.state.channel.toLowerCase() === 'ebill') {
|
|
1418
1425
|
pathName = `/ebill/edit/${id}`;
|
|
1419
1426
|
}
|
|
@@ -1424,6 +1431,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1424
1431
|
}
|
|
1425
1432
|
}
|
|
1426
1433
|
|
|
1434
|
+
selectTemplate = (id) => find(this.props.TemplatesList, {_id: id})
|
|
1435
|
+
|
|
1436
|
+
|
|
1427
1437
|
handlePreviewClick(template, modeType) {
|
|
1428
1438
|
this.togglePreview();
|
|
1429
1439
|
const templateInfo = cloneDeep(template);
|
|
@@ -1801,9 +1811,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1801
1811
|
const isWechatChannel = channel === WECHAT;
|
|
1802
1812
|
const isMobilePushChannel = channel === MOBILE_PUSH;
|
|
1803
1813
|
const isLineChannel = channel === LINE;
|
|
1814
|
+
const isFacebookChannel = channel === FACEBOOK;
|
|
1804
1815
|
|
|
1805
1816
|
|
|
1806
|
-
if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts)) {
|
|
1817
|
+
if ((isWechatChannel || isMobilePushChannel || isLineChannel) && !isEmpty(weCrmAccounts) && !isFacebookChannel ) {
|
|
1807
1818
|
forEach(weCrmAccounts, (account) => {
|
|
1808
1819
|
if ((isWechatChannel && account.configs && account.configs.is_wecrm_enabled) || isMobilePushChannel || isLineChannel) {
|
|
1809
1820
|
if (query.type === 'embedded' && (!query.module || (query.module && query.module !== 'library'))) {
|
|
@@ -1943,28 +1954,33 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1943
1954
|
render() {
|
|
1944
1955
|
const isFullMode = this.isFullMode();
|
|
1945
1956
|
const { activeMode, channel, wechatFilter, lineFilter } = this.state;
|
|
1946
|
-
let
|
|
1957
|
+
let showFbAds = false;
|
|
1947
1958
|
if (channel.toLowerCase() === FACEBOOK_CHANNEL) {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
pageAccessToken
|
|
1959
|
+
const campaignSettings = this.props.Templates.campaignSettings;
|
|
1960
|
+
if (campaignSettings && isEmpty(campaignSettings?.accountSettings)) {
|
|
1961
|
+
showFbAds = true;
|
|
1962
|
+
} else if (!isEmpty(campaignSettings?.accountSettings)) {
|
|
1963
|
+
const fbSetting = get(this.props.Templates, 'campaignSettings.accountSettings.socialAccountSettings.facebookAccountSettings', []);
|
|
1964
|
+
const { orgUnitFacebookPageSettingsMap = {} } = fbSetting[0] || {};
|
|
1965
|
+
let pageAccessToken = false;
|
|
1966
|
+
if (!isEmpty(orgUnitFacebookPageSettingsMap)) {
|
|
1967
|
+
Object.values(orgUnitFacebookPageSettingsMap).forEach((obj) => {
|
|
1968
|
+
if (obj.pageAccessToken) {
|
|
1969
|
+
pageAccessToken = true;
|
|
1970
|
+
}
|
|
1971
|
+
});
|
|
1972
|
+
if (!pageAccessToken) {
|
|
1973
|
+
showFbAds = true;
|
|
1958
1974
|
}
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
showForFacebook = false;
|
|
1975
|
+
} else {
|
|
1976
|
+
showFbAds = true;
|
|
1962
1977
|
}
|
|
1963
1978
|
}
|
|
1964
1979
|
}
|
|
1980
|
+
|
|
1965
1981
|
const showForViber = (![VIBER_CHANNEL, FACEBOOK_CHANNEL].includes(channel.toLowerCase()) ||
|
|
1966
1982
|
(channel.toLowerCase() === VIBER_CHANNEL && !this.props.isFullMode && isEmpty(get(this.props, 'Templates.selectedViberAccount', {}))) ||
|
|
1967
|
-
(channel.toLowerCase() === FACEBOOK_CHANNEL &&
|
|
1983
|
+
(channel.toLowerCase() === FACEBOOK_CHANNEL && showFbAds)
|
|
1968
1984
|
);
|
|
1969
1985
|
|
|
1970
1986
|
|
|
@@ -372,6 +372,6 @@ export default defineMessages({
|
|
|
372
372
|
},
|
|
373
373
|
"noAccountsPresentFacebook": {
|
|
374
374
|
id: `${scope}.noAccountsPresentFacebook`,
|
|
375
|
-
defaultMessage: "Facebook
|
|
375
|
+
defaultMessage: "Please setup the Facebook account & Facebook page to start creating content in Capillary's FB content creator.",
|
|
376
376
|
},
|
|
377
377
|
});
|
|
@@ -9,7 +9,7 @@ import * as types from './constants';
|
|
|
9
9
|
|
|
10
10
|
const initialState = fromJS({
|
|
11
11
|
getAllTemplatesInProgress: false,
|
|
12
|
-
fetchingOrgLevelCampaignSettings:
|
|
12
|
+
fetchingOrgLevelCampaignSettings: false,
|
|
13
13
|
templates: [],
|
|
14
14
|
deleteResponse: {},
|
|
15
15
|
deleteTemplateInProgress: false,
|
|
@@ -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)
|
|
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
|
|
|
10
10
|
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
11
11
|
import { createStructuredSelector } from 'reselect';
|
|
12
12
|
import { bindActionCreators } from 'redux';
|
|
13
|
-
import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon } from '@capillarytech/cap-ui-library';
|
|
13
|
+
import { CapTab, CapCustomCard, CapButton, CapHeader, CapSpin, CapIcon, CapTooltip } from '@capillarytech/cap-ui-library';
|
|
14
14
|
import { find, get } from 'lodash';
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
|
16
16
|
import Helmet from 'react-helmet';
|
|
@@ -45,6 +45,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
45
45
|
channelsToDisable = [],
|
|
46
46
|
isFullMode,
|
|
47
47
|
onChannelChange,
|
|
48
|
+
showDisabledFBInfo,
|
|
48
49
|
} = props;
|
|
49
50
|
|
|
50
51
|
const defaultPanes = {
|
|
@@ -80,6 +81,15 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
80
81
|
if (channelsToDisable.includes(pane.key)) {
|
|
81
82
|
// eslint-disable-next-line no-param-reassign
|
|
82
83
|
pane.disabled = true;
|
|
84
|
+
if (pane.key === 'facebook' && showDisabledFBInfo) {
|
|
85
|
+
pane.tab = (<CapTooltip
|
|
86
|
+
title={
|
|
87
|
+
intl.formatMessage(messages.facebookDisableinfo)
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
{intl.formatMessage(messages.facebook)}
|
|
91
|
+
</CapTooltip>);
|
|
92
|
+
}
|
|
83
93
|
}
|
|
84
94
|
return pane;
|
|
85
95
|
});
|
|
@@ -148,13 +158,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
148
158
|
);
|
|
149
159
|
|
|
150
160
|
getFacebookComponent = () => {
|
|
151
|
-
const { messageDetails, cap, onFacebookSubmit,
|
|
161
|
+
const { messageDetails, cap, onFacebookSubmit, messageStrategy, showDisabledFBInfo, orgUnitId } = this.props;
|
|
152
162
|
return (
|
|
153
163
|
<Facebook
|
|
154
164
|
{...this.props}
|
|
155
165
|
messageDetails={messageDetails}
|
|
156
166
|
cap={cap}
|
|
157
167
|
onFacebookSubmit={onFacebookSubmit}
|
|
168
|
+
messageStrategy={messageStrategy}
|
|
169
|
+
showDisabledFBInfo={showDisabledFBInfo}
|
|
170
|
+
orgUnitId={orgUnitId}
|
|
158
171
|
/>
|
|
159
172
|
);
|
|
160
173
|
}
|
|
@@ -178,19 +191,21 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
178
191
|
getTemplatesComponent(channel) {
|
|
179
192
|
// const templates = this.props.Templates[`${channel}Templates`];
|
|
180
193
|
let query = {};
|
|
181
|
-
|
|
194
|
+
const {isFullMode, messageStrategy} = this.props;
|
|
195
|
+
if (!isFullMode) {
|
|
182
196
|
query = {type: 'embedded', module: 'library'};
|
|
183
197
|
switch (channel) {
|
|
184
198
|
case 'line':
|
|
185
199
|
return this.getLineComponent();
|
|
186
200
|
case 'ftp':
|
|
187
201
|
return this.getFTPComponent();
|
|
188
|
-
case 'facebook':
|
|
189
|
-
return this.getFacebookComponent();
|
|
190
202
|
default:
|
|
191
203
|
break;
|
|
192
204
|
}
|
|
193
205
|
}
|
|
206
|
+
if (messageStrategy !== "X_ENGAGE" && channel === 'facebook' && !isFullMode) {
|
|
207
|
+
return this.getFacebookComponent();
|
|
208
|
+
}
|
|
194
209
|
const location = {pathname: `/${channel}`, search: '', query};
|
|
195
210
|
switch (channel) {
|
|
196
211
|
case 'call_task':
|
|
@@ -205,9 +220,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
205
220
|
router={this.props.router}
|
|
206
221
|
isFullMode={this.props.isFullMode}
|
|
207
222
|
createNew={this.props.createNew}
|
|
208
|
-
onSelectTemplate={
|
|
223
|
+
onSelectTemplate={this.props.onSelectTemplate}
|
|
209
224
|
renderNewCardGrid={this.getTemplateDataForGrid}
|
|
210
225
|
handlePeviewTemplate={this.props.handlePeviewTemplate}
|
|
226
|
+
messageStrategy={this.props.messageStrategy}
|
|
211
227
|
/>);
|
|
212
228
|
}
|
|
213
229
|
}
|
|
@@ -287,6 +303,7 @@ TemplatesV2.propTypes = {
|
|
|
287
303
|
cap: PropTypes.object,
|
|
288
304
|
authData: PropTypes.object,
|
|
289
305
|
FTPMode: PropTypes.string,
|
|
306
|
+
messageStrategy: PropTypes.string,
|
|
290
307
|
};
|
|
291
308
|
|
|
292
309
|
TemplatesV2.defaultProps = {
|
|
@@ -66,4 +66,8 @@ export default defineMessages({
|
|
|
66
66
|
id: 'creatives.containersV2.TemplatesV2.line',
|
|
67
67
|
defaultMessage: 'Line',
|
|
68
68
|
},
|
|
69
|
+
facebookDisableinfo: {
|
|
70
|
+
id: `creatives.containersV2.TemplatesV2.facebookDisableinfo`,
|
|
71
|
+
defaultMessage: 'Please integrate Facebook Ad page ID & username to enable this option.',
|
|
72
|
+
},
|
|
69
73
|
});
|
|
@@ -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,
|