@capillarytech/creatives-library 8.0.79 → 8.0.80-alpha.0
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.
|
@@ -1199,14 +1199,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
1201
|
getValidationData = () => {
|
|
1202
|
-
|
|
1203
1202
|
const that = this;
|
|
1204
1203
|
const formData = _.cloneDeep(this.state.formData);
|
|
1205
1204
|
_.forEach(formData, (val, index) => {
|
|
1206
1205
|
if (!isNaN(index)) {
|
|
1207
1206
|
_.forEach(val.selectedLanguages, (language) => {
|
|
1208
|
-
|
|
1209
1207
|
if (val[language].is_drag_drop) {
|
|
1208
|
+
console.log('***getValidationData -1210', val[language].drag_drop_id, language);
|
|
1210
1209
|
that.props.actions.getCmsData('edm', val[language].drag_drop_id, language);
|
|
1211
1210
|
}
|
|
1212
1211
|
});
|
|
@@ -1938,6 +1937,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1938
1937
|
}
|
|
1939
1938
|
});
|
|
1940
1939
|
} else if (this.state.mode === 'preview' || this.state.mode === 'switchEditor') {
|
|
1940
|
+
console.log('***HandleEdmSave -1940', this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].drag_drop_id);
|
|
1941
1941
|
this.props.actions.getCmsData('edm', this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].drag_drop_id);
|
|
1942
1942
|
if (this.state.mode === 'switchEditor') {
|
|
1943
1943
|
let schema = _.cloneDeep(this.state.schema);
|
|
@@ -55,9 +55,7 @@ export function* getAllAssets(assetType, queryParams) {
|
|
|
55
55
|
|
|
56
56
|
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport}) {
|
|
57
57
|
try {
|
|
58
|
-
|
|
59
58
|
const result = yield call(Api.getCmsTemplateSettings, cmsType, projectId, cmsMode, langId, isEdmSupport);
|
|
60
|
-
|
|
61
59
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
62
60
|
} catch (error) {
|
|
63
61
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error });
|
|
@@ -67,7 +65,6 @@ export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSuppor
|
|
|
67
65
|
export function* getCmsData({cmsType, projectId, langId}) {
|
|
68
66
|
try {
|
|
69
67
|
const result = yield call(Api.getCmsTemplateData, cmsType, projectId, langId);
|
|
70
|
-
|
|
71
68
|
yield put({ type: types.GET_CMS_EDITOR_DATA_SUCCESS, data: result.data.response.data, langId: result.data.response.langId });
|
|
72
69
|
} catch (error) {
|
|
73
70
|
yield put({ type: types.GET_CMS_EDITOR_DATA_FAILURE, error });
|
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import 'whatwg-fetch';
|
|
5
5
|
import { GA, decompressJsonObject } from '@capillarytech/cap-ui-utils';
|
|
6
|
-
import
|
|
6
|
+
import get from 'lodash/get';
|
|
7
7
|
import { loadItem, clearItem } from './localStorageApi';
|
|
8
8
|
import config from '../config/app';
|
|
9
9
|
import pathConfig from '../config/path';
|
|
@@ -31,7 +31,6 @@ export function* getTemplateDetails(id, channel) {
|
|
|
31
31
|
export function* getCmsData({cmsType, projectId}) {
|
|
32
32
|
try {
|
|
33
33
|
const result = yield call(Api.getCmsData, cmsType, projectId);
|
|
34
|
-
|
|
35
34
|
yield put({ type: types.GET_CMS_EDITOR_DATA_SUCCESS, data: decodeURIComponent(result.data.response.cmsData.htmlContent) });
|
|
36
35
|
} catch (error) {
|
|
37
36
|
yield put({ type: types.GET_CMS_EDITOR_DATA_FAILURE, error });
|
|
@@ -36,7 +36,7 @@ import { TRACK_CREATE_EMAIL, TRACK_EDIT_EMAIL, BEE_PLUGIN, CREATE, EDIT } from '
|
|
|
36
36
|
import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
37
37
|
import { gtmPush } from '../../utils/gtmTrackers';
|
|
38
38
|
const {CapCustomCardList} = CapCustomCard;
|
|
39
|
-
import {
|
|
39
|
+
import {storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
|
|
40
40
|
import { CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
|
|
41
41
|
import injectReducer from '../../utils/injectReducer';
|
|
42
42
|
import v2EmailReducer from './reducer';
|
|
@@ -497,6 +497,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
497
497
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
498
498
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
499
499
|
if (isDragDrop && isBEESupport && this.checkBeeEditorAllowedForLibrary()) {
|
|
500
|
+
console.log('***Handle EDM -500', this.edmEvent, JSON.parse(this.edmEvent.data));
|
|
500
501
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
501
502
|
if (evtData.action === 'editBackground') {
|
|
502
503
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -511,6 +512,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
511
512
|
},
|
|
512
513
|
}), "*");
|
|
513
514
|
} else if (evtData.action === 'edit') {
|
|
515
|
+
console.log('***Handle EDM -515', this.edmEvent, JSON.parse(this.edmEvent.data));
|
|
514
516
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
515
517
|
_dynId: JSON.parse(this.edmEvent.data)._dynId,
|
|
516
518
|
action: "setProps",
|
|
@@ -748,7 +750,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
748
750
|
}
|
|
749
751
|
getValidationData = () => {
|
|
750
752
|
const that = this;
|
|
751
|
-
|
|
753
|
+
console.log('***getValidationData -753', this.props);
|
|
754
|
+
let id = _.get(this.props, 'Email.templateDetails._id', '') || _.get(this.props, 'Templates.BEETemplate.versions.base.drag_drop_id', '');
|
|
752
755
|
const formData = _.cloneDeep(this.state.formData);
|
|
753
756
|
if (!id) {
|
|
754
757
|
id = _.get(formData, `base[${formData.base.activeTab}].id`, '');
|
|
@@ -759,6 +762,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
759
762
|
if (!isNaN(index)) {
|
|
760
763
|
_.forEach(val.selectedLanguages, (language) => {
|
|
761
764
|
if (val[language].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
|
|
765
|
+
console.log('***getValidationData -764', val[language].drag_drop_id, language, id);
|
|
762
766
|
that.props.actions.getCmsData(BEE_PLUGIN, id, language);
|
|
763
767
|
}
|
|
764
768
|
});
|
|
@@ -928,6 +932,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
928
932
|
// formData.base.activeTab = language;
|
|
929
933
|
// }
|
|
930
934
|
if (language && editData.versions.base[language].is_drag_drop && isBEEAppEnable) {
|
|
935
|
+
console.log('***getCmsSetting -934', editData, language);
|
|
931
936
|
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport, isBEEAppEnable);
|
|
932
937
|
}
|
|
933
938
|
});
|
|
@@ -1405,7 +1410,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1405
1410
|
}
|
|
1406
1411
|
});
|
|
1407
1412
|
} else if (this.state.mode === 'preview' || this.state.mode === 'switchEditor') {
|
|
1408
|
-
let id = _.get(this.props, 'Email.templateDetails._id', '') || _.get(this.props, 'Templates.BEETemplate.
|
|
1413
|
+
let id = _.get(this.props, 'Email.templateDetails._id', '') || _.get(this.props, 'Templates.BEETemplate.versions.base.drag_drop_id', '');
|
|
1414
|
+
console.log('***Handle EDM -864', id);
|
|
1409
1415
|
const formData = _.cloneDeep(this.state.formData);
|
|
1410
1416
|
if (!id) {
|
|
1411
1417
|
id = _.get(formData, `base[${formData.base.activeTab}].id`, '');
|
|
@@ -1520,6 +1526,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1520
1526
|
storeS3FileSizeDetails(data?.metaInfo?.secure_file_path, data?.metaInfo?.file_size);
|
|
1521
1527
|
|
|
1522
1528
|
if (isDragDrop && isEdmSupport && this.checkBeeEditorAllowedForLibrary()) {
|
|
1529
|
+
console.log('***Handle EDM -1524', this.edmEvent, JSON.parse(this.edmEvent.data));
|
|
1523
1530
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
1524
1531
|
if (evtData.action === 'editBackground') {
|
|
1525
1532
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -1534,6 +1541,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1534
1541
|
},
|
|
1535
1542
|
}), "*");
|
|
1536
1543
|
} else if (evtData.action === 'edit') {
|
|
1544
|
+
console.log('***Handle EDM -1539', this.edmEvent, JSON.parse(this.edmEvent.data));
|
|
1537
1545
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
1538
1546
|
_dynId: JSON.parse(this.edmEvent.data)._dynId,
|
|
1539
1547
|
action: "setProps",
|
|
@@ -2502,7 +2510,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2502
2510
|
};
|
|
2503
2511
|
handleEdmDefaultTemplateSelection = (isSelected, id) => {
|
|
2504
2512
|
if (isSelected) {
|
|
2513
|
+
console.log('***handleEdmDefaultTemplateSelection -2512', this.props.Templates.cmsTemplates);
|
|
2505
2514
|
const data = _.find(this.props.Templates.cmsTemplates, {_id: id});
|
|
2515
|
+
console.log('***handleEdmDefaultTemplateSelection -2513', data);
|
|
2506
2516
|
// const type = this.props.location.query.type;
|
|
2507
2517
|
// const module = this.props.location.query.module ? this.props.location.query.module : 'default';
|
|
2508
2518
|
// const isLanguageSupport = (this.props.location.query.isLanguageSupport) ? this.props.location.query.isLanguageSupport : true;
|