@capillarytech/creatives-library 7.6.8 → 7.6.10
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/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/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/package.json +1 -1
- package/services/api.js +13 -13
- package/utils/authWrapper.js +2 -2
- package/utils/smsCharCount.js +5 -5
- package/v2Components/CapTagList/index.js +1 -1
- 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 +1 -1
- package/v2Components/Toastr/index.js +1 -1
- 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/reducer.js +1 -1
- package/v2Containers/Cap/sagas.js +3 -3
- package/v2Containers/Cap/selectors.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +8 -1
- package/v2Containers/CreativesContainer/index.js +31 -22
- 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 +22 -3
- package/v2Containers/Facebook/index.js +5 -1
- package/v2Containers/Facebook/messages.js +9 -5
- package/v2Containers/Facebook/sagas.js +1 -1
- package/v2Containers/LanguageProvider/actions.js +1 -1
- 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/actions.js +5 -5
- package/v2Containers/Templates/index.js +5 -4
- package/v2Containers/Templates/sagas.js +4 -4
- package/v2Containers/TemplatesV2/index.js +14 -2
- package/v2Containers/TemplatesV2/messages.js +4 -0
- package/v2Containers/Viber/actions.js +2 -2
- 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
|
@@ -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);
|
|
@@ -35,7 +35,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
componentDidMount() {
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
componentWillReceiveProps(nextProps) {
|
|
@@ -43,11 +43,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
43
43
|
this.setState({loading: true});
|
|
44
44
|
}
|
|
45
45
|
if (!_.isEqual(nextProps.injectedTags, this.props.injectedTags)) {
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
this.setState({loading: false});
|
|
48
48
|
}
|
|
49
49
|
if (!_.isEqual(nextProps.tags, this.props.tags)) {
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
this.setState({loading: false});
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -57,7 +57,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
onClick = (e, data) => {
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
getTagsforContext = (data) => {
|
|
@@ -81,7 +81,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
81
81
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
82
82
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
83
83
|
} else if (!mainTags[tag.value]) {
|
|
84
|
-
//
|
|
84
|
+
//
|
|
85
85
|
mainTags[tag.value] = {
|
|
86
86
|
'tag-header': true,
|
|
87
87
|
"name": tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
@@ -225,7 +225,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
225
225
|
let injectedTags = {};
|
|
226
226
|
if (this.props.injectedTags && !_.isEmpty(this.props.injectedTags)) {
|
|
227
227
|
injectedTags = this.transformInjectedTags(this.props.injectedTags);
|
|
228
|
-
|
|
228
|
+
|
|
229
229
|
}
|
|
230
230
|
if (this.props.tags && this.props.tags.length > 0) {
|
|
231
231
|
tags = this.populateTags(this.props.tags);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import * as types from './constants';
|
|
8
8
|
|
|
9
9
|
export function getAllTemplates(channel, queryParams) {
|
|
10
|
-
//
|
|
10
|
+
//
|
|
11
11
|
return {
|
|
12
12
|
type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
|
|
13
13
|
};
|
|
@@ -26,7 +26,7 @@ export function resetAccount() {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function deleteTemplate(channel, id) {
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
return {
|
|
31
31
|
type: types.DELETE_TEMPLATE_REQUEST, channel, id,
|
|
32
32
|
};
|
|
@@ -51,7 +51,7 @@ export function getAccountsSettings() {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export function setWeChatAccount(weChatAccount) {
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
return {
|
|
56
56
|
type: types.SET_WECHAT_ACCOUNT,
|
|
57
57
|
weChatAccount,
|
|
@@ -114,7 +114,7 @@ export function setBEETemplate(template) {
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
export function getTemplateDetails(id, channel) {
|
|
117
|
-
|
|
117
|
+
|
|
118
118
|
return {
|
|
119
119
|
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
120
120
|
id,
|
|
@@ -129,7 +129,7 @@ export function resetTemplateData() {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export function resetUploadData() {
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
return {
|
|
134
134
|
type: types.RESET_UPLOAD_DATA,
|
|
135
135
|
};
|
|
@@ -511,7 +511,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
this.setState({activeMode: TEMPLATES_MODE});
|
|
514
|
-
|
|
514
|
+
|
|
515
515
|
this.getAllTemplates({params, resetPage: true});
|
|
516
516
|
});
|
|
517
517
|
}
|
|
@@ -1139,10 +1139,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1139
1139
|
const channel = this.state.channel.toLowerCase();
|
|
1140
1140
|
//const keyType = ev.key && ev.key.toLowerCase() !== undefined ? ev.state.toLowerCase() : '';
|
|
1141
1141
|
let routeParams = {};
|
|
1142
|
+
const {fbAdManger} = this.props;
|
|
1142
1143
|
timeTracker.startTimer(CHANNEL_CREATE_TRACK_MAPPING[channel]);
|
|
1143
1144
|
if (this.isEnabledInLibraryModule("callCreateFromProps")) {
|
|
1144
1145
|
if (this.props.fbAdManger === "CREATIVE") {
|
|
1145
|
-
this.props.createNew(
|
|
1146
|
+
this.props.createNew(fbAdManger);
|
|
1146
1147
|
} else {
|
|
1147
1148
|
this.props.createNew();
|
|
1148
1149
|
}
|
|
@@ -1953,10 +1954,10 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1953
1954
|
const { activeMode, channel, wechatFilter, lineFilter } = this.state;
|
|
1954
1955
|
let showForFacebook = false;
|
|
1955
1956
|
if (channel.toLowerCase() === FACEBOOK_CHANNEL) {
|
|
1956
|
-
const campaignSettings = this.props.Templates.campaignSettings
|
|
1957
|
+
const campaignSettings = this.props.Templates.campaignSettings;
|
|
1957
1958
|
if (campaignSettings && isEmpty(campaignSettings?.accountSettings)) {
|
|
1958
1959
|
showForFacebook = true;
|
|
1959
|
-
} else if(!isEmpty(campaignSettings?.accountSettings)) {
|
|
1960
|
+
} else if (!isEmpty(campaignSettings?.accountSettings)) {
|
|
1960
1961
|
const fbSetting = get(this.props.Templates, 'campaignSettings.accountSettings.socialAccountSettings.facebookAccountSettings', []);
|
|
1961
1962
|
const { orgUnitFacebookPageSettingsMap = {} } = fbSetting[0] || {};
|
|
1962
1963
|
let pageAccessToken = false;
|
|
@@ -106,7 +106,7 @@ export function* sendZippedFile({selectedFile, errorHandler, successHandler}) {
|
|
|
106
106
|
yield errorHandler(errorMessage);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
console.log("Got decoded result", decodeURIComponent(result.response.metaEntity.htmlContent));
|
|
111
111
|
yield [
|
|
112
112
|
put({
|
|
@@ -128,7 +128,7 @@ export function* sendZippedFile({selectedFile, errorHandler, successHandler}) {
|
|
|
128
128
|
|
|
129
129
|
export function* getDefaultBeeTemplates() {
|
|
130
130
|
try {
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
const result = yield call(Api.getDefaultBeeTemplates);
|
|
133
133
|
const edmTemplates = result.response;
|
|
134
134
|
yield put({ type: types.GET_DEAFULT_BEE_TEMPLATES_SUCCESS, data: edmTemplates });
|
|
@@ -139,7 +139,7 @@ export function* getDefaultBeeTemplates() {
|
|
|
139
139
|
|
|
140
140
|
export function* getTemplateDetails(id, channel) {
|
|
141
141
|
try {
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
const result = yield call(Api.getTemplateDetails, id, channel);
|
|
144
144
|
// const sidebar = result.response.sidebar;
|
|
145
145
|
yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
@@ -167,7 +167,7 @@ function* watchGetUserList() {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
function* watchFetchWeCrmAccounts() {
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
const watcher = yield takeLatest(types.GET_WECRM_ACCOUNTS_REQUEST, fetchWeCrmAccounts);
|
|
172
172
|
yield take(LOCATION_CHANGE);
|
|
173
173
|
yield cancel(watcher);
|
|
@@ -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
|
+
showDisableInfoForFacebook,
|
|
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' && showDisableInfoForFacebook) {
|
|
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,7 +158,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
148
158
|
);
|
|
149
159
|
|
|
150
160
|
getFacebookComponent = () => {
|
|
151
|
-
const { messageDetails, cap, onFacebookSubmit, messageStrategy } = this.props;
|
|
161
|
+
const { messageDetails, cap, onFacebookSubmit, messageStrategy, showDisableInfoForFacebook, orgUnitId } = this.props;
|
|
152
162
|
return (
|
|
153
163
|
<Facebook
|
|
154
164
|
{...this.props}
|
|
@@ -156,6 +166,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
156
166
|
cap={cap}
|
|
157
167
|
onFacebookSubmit={onFacebookSubmit}
|
|
158
168
|
messageStrategy={messageStrategy}
|
|
169
|
+
showDisableInfoForFacebook={showDisableInfoForFacebook}
|
|
170
|
+
orgUnitId={orgUnitId}
|
|
159
171
|
/>
|
|
160
172
|
);
|
|
161
173
|
}
|
|
@@ -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
|
});
|
|
@@ -28,7 +28,7 @@ export function createTemplate(template, callback) {
|
|
|
28
28
|
// FOR EDIT
|
|
29
29
|
|
|
30
30
|
export function editTemplate(template, callback) {
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
return {
|
|
33
33
|
type: types.EDIT_VIBER_TEMPLATE_REQUEST,
|
|
34
34
|
template,
|
|
@@ -37,7 +37,7 @@ export function editTemplate(template, callback) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export function getTemplateDetails(id, callback) {
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
return {
|
|
42
42
|
type: types.GET_VIBER_TEMPLATE_DETAILS_REQUEST,
|
|
43
43
|
id,
|
|
@@ -61,7 +61,7 @@ export function* editTemplate({ template, callback }) {
|
|
|
61
61
|
|
|
62
62
|
export function* getTemplateDetails({id, callback}) {
|
|
63
63
|
try {
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
const result = yield call(Api.getTemplateDetails, {id, channel: 'VIBER'});
|
|
66
66
|
yield put({ type: types.GET_VIBER_TEMPLATE_DETAILS_SUCCESS, data: result.response });
|
|
67
67
|
if (callback) {
|
|
@@ -81,7 +81,7 @@ function* watchUploadViberAsset() {
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
function* watchCreateTemplate() {
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
const watcher = yield takeLatest(types.CREATE_VIBER_TEMPLATE_REQUEST, createViberTemplate);
|
|
86
86
|
yield take(LOCATION_CHANGE);
|
|
87
87
|
yield cancel(watcher);
|