@capillarytech/creatives-library 6.12.7 → 6.12.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/config/app.js +1 -1
- package/package.json +1 -1
- package/services/api.js +3 -2
- package/v2Components/FormBuilder/index.js +8 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -6
- package/v2Containers/CreativesContainer/index.js +4 -5
- package/v2Containers/Email/actions.js +1 -2
- package/v2Containers/Email/index.js +29 -44
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/TemplatesV2/index.js +6 -5
package/config/app.js
CHANGED
|
@@ -14,7 +14,7 @@ const config = {
|
|
|
14
14
|
accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
|
|
15
15
|
},
|
|
16
16
|
development: {
|
|
17
|
-
api_endpoint: '
|
|
17
|
+
api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
|
|
18
18
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
19
19
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
|
20
20
|
arya_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1',
|
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -319,11 +319,12 @@ export const getCmsTemplateSettings = (cmsType, projectId, cmsMode, langId, isEd
|
|
|
319
319
|
return API.get(url);
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
export const getCmsTemplateSettingsV2 = (cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
323
|
-
const url = `${API_ENDPOINT}/cms/v2/getDetails/?type=${cmsType}&projectId=${projectId}&cmsMode=${cmsMode}&langId=${langId}&isEdmSupport=${isEdmSupport ? 1 : 0}
|
|
322
|
+
export const getCmsTemplateSettingsV2 = (cmsType, projectId, cmsMode, langId, isEdmSupport) => {
|
|
323
|
+
const url = `${API_ENDPOINT}/cms/v2/getDetails/?type=${cmsType}&projectId=${projectId}&cmsMode=${cmsMode}&langId=${langId}&isEdmSupport=${isEdmSupport ? 1 : 0}`;
|
|
324
324
|
return API.get(url);
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
+
|
|
327
328
|
export const getCmsTemplateData = (cmsType, projectId, langId) => {
|
|
328
329
|
const url = `${API_ENDPOINT}/cms/getContent?type=${cmsType}&projectId=${projectId}&langId=${langId}`;
|
|
329
330
|
return API.get(url);
|
|
@@ -1470,6 +1470,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1470
1470
|
} else if (key === this.props.baseLanguage) {
|
|
1471
1471
|
formData[newTabIndex][key] = {};
|
|
1472
1472
|
_.forEach(val, (subVal, index) => {
|
|
1473
|
+
// if (subVal === 'is_drag_drop' || subVal === 'lang_id' || subVal === 'iso_code' === 'language') {
|
|
1474
|
+
//
|
|
1475
|
+
// formData[newTabIndex][key][index] = formData[0][this.props.baseLanguage][subVal];
|
|
1476
|
+
// } else {
|
|
1473
1477
|
if (index === 'tabKey') {
|
|
1474
1478
|
formData[newTabIndex][key][index] = _.uniqueId();
|
|
1475
1479
|
} else if (index === 'template-content') {
|
|
@@ -3176,6 +3180,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3176
3180
|
console.log('CKEditor Data 2', this.state.formData, this.state.formData[`${this.state.currentTab - 1}`], val, this.state.currentTab, this.state.currentLangTab, langIndex);
|
|
3177
3181
|
const currentLang = ((!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage) || 'en';
|
|
3178
3182
|
const content = (!_.isEmpty(this.state.formData) && this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] ? this.state.formData[`${this.state.currentTab - 1}`][currentLang]['template-content'] : '');
|
|
3183
|
+
console.log('ckeditor current lang', currentLang, content);
|
|
3184
|
+
if (this.state.formData[`${this.state.currentTab - 1}`][currentLang].is_drag_drop) {
|
|
3185
|
+
// content = "";
|
|
3186
|
+
}
|
|
3179
3187
|
columns.push(
|
|
3180
3188
|
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
3181
3189
|
<CKEditor
|
|
@@ -69,7 +69,7 @@ const getLineType = ({
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return {};
|
|
72
|
-
}
|
|
72
|
+
}
|
|
73
73
|
|
|
74
74
|
function SlideBoxContent(props) {
|
|
75
75
|
const {
|
|
@@ -96,7 +96,6 @@ function SlideBoxContent(props) {
|
|
|
96
96
|
cap,
|
|
97
97
|
onResetStep,
|
|
98
98
|
isFullMode,
|
|
99
|
-
editor,
|
|
100
99
|
onCallTaskSubmit,
|
|
101
100
|
setIsLoadingContent,
|
|
102
101
|
showTemplateName,
|
|
@@ -185,7 +184,7 @@ function SlideBoxContent(props) {
|
|
|
185
184
|
} = {},
|
|
186
185
|
template,
|
|
187
186
|
}) => {
|
|
188
|
-
|
|
187
|
+
let previewContent = {};
|
|
189
188
|
previewContent.messageContent = text;
|
|
190
189
|
previewContent.previewImageUrl = previewImageUrl;
|
|
191
190
|
previewContent.selectedSticker = selectedSticker || {
|
|
@@ -367,7 +366,6 @@ function SlideBoxContent(props) {
|
|
|
367
366
|
step={templateStep}
|
|
368
367
|
showNextStep={onCreateNextStep}
|
|
369
368
|
isFullMode={isFullMode}
|
|
370
|
-
editor={editor}
|
|
371
369
|
cap={cap}
|
|
372
370
|
onResetStep={onResetStep}
|
|
373
371
|
showTemplateName={showTemplateName}
|
|
@@ -394,7 +392,6 @@ function SlideBoxContent(props) {
|
|
|
394
392
|
getFormSubscriptionData={getFormData}
|
|
395
393
|
getDefaultTags={type}
|
|
396
394
|
isFullMode={isFullMode}
|
|
397
|
-
editor={editor}
|
|
398
395
|
cap={cap}
|
|
399
396
|
showTemplateName={showTemplateName}
|
|
400
397
|
onValidationFail={onValidationFail}
|
|
@@ -459,7 +456,6 @@ function SlideBoxContent(props) {
|
|
|
459
456
|
messageDetails={messageDetails}
|
|
460
457
|
cap={cap}
|
|
461
458
|
onFacebookSubmit={onFacebookSubmit}
|
|
462
|
-
isFullMode={isFullMode}
|
|
463
459
|
/>
|
|
464
460
|
)
|
|
465
461
|
}
|
|
@@ -225,9 +225,9 @@ class Creatives extends React.Component {
|
|
|
225
225
|
const messagesDefinition = JSON.parse(messages);
|
|
226
226
|
let lineContent = JSON.parse(messageBody || '{}').messages || [{}];
|
|
227
227
|
lineContent = lineContent.map((content, index) => ({
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
...content,
|
|
229
|
+
...(messagesDefinition[index] || {})
|
|
230
|
+
}));
|
|
231
231
|
creativesTemplateData = {
|
|
232
232
|
type: constants.LINE,
|
|
233
233
|
isDefault,
|
|
@@ -529,7 +529,7 @@ class Creatives extends React.Component {
|
|
|
529
529
|
}
|
|
530
530
|
render() {
|
|
531
531
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
532
|
-
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData
|
|
532
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData} = this.props;
|
|
533
533
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
534
534
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
535
535
|
return (
|
|
@@ -602,7 +602,6 @@ class Creatives extends React.Component {
|
|
|
602
602
|
selectedAccount={this.props.selectedAccount}
|
|
603
603
|
onShowTemplates={this.onShowTemplates}
|
|
604
604
|
handleClose={this.handleCloseSlideBox}
|
|
605
|
-
editor={editor}
|
|
606
605
|
/>
|
|
607
606
|
}
|
|
608
607
|
footer={this.shouldShowFooter() &&
|
|
@@ -38,7 +38,7 @@ export function getAllAssets(assetType, queryParams) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
41
|
+
export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport) {
|
|
42
42
|
return {
|
|
43
43
|
type: types.GET_CMS_EDITOR_DETAILS_REQUEST,
|
|
44
44
|
cmsType,
|
|
@@ -46,7 +46,6 @@ export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport,
|
|
|
46
46
|
cmsMode,
|
|
47
47
|
langId,
|
|
48
48
|
isEdmSupport,
|
|
49
|
-
disableBEE,
|
|
50
49
|
};
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -183,15 +183,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
183
183
|
this.props.templatesActions.resetTemplateData();
|
|
184
184
|
}
|
|
185
185
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
186
|
-
|
|
187
|
-
if (!_.isEmpty(this.props.Templates.BEETemplate)) {
|
|
188
|
-
if (this.props.Templates.BEETemplate.versions.base.is_drag_drop
|
|
186
|
+
|
|
187
|
+
if (!_.isEmpty(this.props.Templates.BEETemplate) ) {
|
|
188
|
+
if (this.props.Templates.BEETemplate.versions.base.is_drag_drop) {
|
|
189
189
|
this.setState({isDragDrop: true});
|
|
190
190
|
}
|
|
191
191
|
if (this.props.params.id) {
|
|
192
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport
|
|
192
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport);
|
|
193
193
|
} else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
|
|
194
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport
|
|
194
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData});
|
|
@@ -214,15 +214,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
214
214
|
this.showNext();
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
checkBeeEditorAllowedForLibrary = () => {
|
|
219
|
-
const { isFullMode = false, editor } = this.props || {};
|
|
220
|
-
if (editor === "BEE" && !isFullMode) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
217
|
componentWillReceiveProps(nextProps) {
|
|
227
218
|
// if (this.props.location.query.type === 'embedded') {
|
|
228
219
|
// this.showNext();
|
|
@@ -324,9 +315,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
324
315
|
if (nextProps.location.query.module === 'library' && nextProps.isGetFormData) {
|
|
325
316
|
const formData = this.state.formData;
|
|
326
317
|
let isBeeEditor = false;
|
|
327
|
-
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
328
318
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
329
|
-
if (formData[0][language].is_drag_drop
|
|
319
|
+
if (formData[0][language].is_drag_drop) {
|
|
330
320
|
isBeeEditor = true;
|
|
331
321
|
}
|
|
332
322
|
});
|
|
@@ -359,7 +349,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
359
349
|
const temp = (schema.containers || {})[this.state.currentTab - 1];
|
|
360
350
|
|
|
361
351
|
const { currentTab } = this.state;
|
|
362
|
-
if (nextProps.Email.CmsSettings.isDragDrop
|
|
352
|
+
if (nextProps.Email.CmsSettings.isDragDrop) {
|
|
363
353
|
const beeJson = `BEEeditor${currentTab > 1 ? currentTab : ''}json`;
|
|
364
354
|
const beeToken = `BEEeditor${currentTab > 1 ? currentTab : ''}token`;
|
|
365
355
|
let beeJsonValue = _.get(nextProps, 'Templates.BEETemplate.versions.base.json-content', '');
|
|
@@ -419,8 +409,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
419
409
|
}
|
|
420
410
|
|
|
421
411
|
this.setState({ formData }, () => {
|
|
422
|
-
|
|
423
|
-
this.hideEdmOptions(isDragDrop);
|
|
412
|
+
this.hideEdmOptions(nextProps.Email.CmsSettings.isDragDrop);
|
|
424
413
|
});
|
|
425
414
|
}
|
|
426
415
|
if (nextProps.Email.createTemplateError && !_.isEqual(nextProps.Email.createTemplateError, this.props.Email.createTemplateError)) {
|
|
@@ -480,7 +469,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
480
469
|
if ( !_.isEqual(nextProps.Email.uploadAssetSuccess, this.props.Email.uploadAssetSuccess) && nextProps.Email.uploadAssetSuccess) {
|
|
481
470
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
482
471
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
483
|
-
if (isDragDrop && isBEESupport
|
|
472
|
+
if (isDragDrop && isBEESupport) {
|
|
484
473
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
485
474
|
if (evtData.action === 'editBackground') {
|
|
486
475
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -526,7 +515,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
526
515
|
}
|
|
527
516
|
if (!_.isEmpty(nextProps.Email.templateDetails) && _.isEmpty(this.props.Email.templateDetails) ) {
|
|
528
517
|
const base = nextProps.Email.templateDetails.versions.base;
|
|
529
|
-
if (nextProps.Email.templateDetails.versions.base[base.activeTab].is_drag_drop
|
|
518
|
+
if (nextProps.Email.templateDetails.versions.base[base.activeTab].is_drag_drop) {
|
|
530
519
|
this.setState({isDragDrop: true});
|
|
531
520
|
}
|
|
532
521
|
}
|
|
@@ -591,7 +580,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
591
580
|
//this.resetCkEditorInstance(data, formData);
|
|
592
581
|
const schema = _.cloneDeep(this.state.schema);
|
|
593
582
|
const container = schema.containers[`${data - 1}`];
|
|
594
|
-
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop
|
|
583
|
+
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop) {
|
|
595
584
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: ""};
|
|
596
585
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[2].style.display = "none";
|
|
597
586
|
} else {
|
|
@@ -616,7 +605,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
616
605
|
const formData = _.cloneDeep(this.state.formData);
|
|
617
606
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
618
607
|
|
|
619
|
-
if (isDragDrop && isBEESupport
|
|
608
|
+
if (isDragDrop && isBEESupport) {
|
|
620
609
|
let msg = {};
|
|
621
610
|
if (data === "unsubscribe") {
|
|
622
611
|
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
@@ -659,9 +648,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
659
648
|
const base = formData.base || {};
|
|
660
649
|
const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
|
|
661
650
|
let editorType = '';
|
|
662
|
-
if ( isDragDrop === true
|
|
651
|
+
if ( isDragDrop === true) {
|
|
663
652
|
editorType = 'edmEditor';
|
|
664
|
-
} else if (isDragDrop === false
|
|
653
|
+
} else if (isDragDrop === false) {
|
|
665
654
|
editorType = 'ckEditor';
|
|
666
655
|
}
|
|
667
656
|
GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
|
|
@@ -716,7 +705,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
716
705
|
_.forEach(formData, (val, index) => {
|
|
717
706
|
if (!isNaN(index)) {
|
|
718
707
|
_.forEach(val.selectedLanguages, (language) => {
|
|
719
|
-
if (val[language].is_drag_drop
|
|
708
|
+
if (val[language].is_drag_drop) {
|
|
720
709
|
that.props.actions.getCmsData(BEE_PLUGIN, id, language);
|
|
721
710
|
}
|
|
722
711
|
});
|
|
@@ -917,7 +906,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
917
906
|
if (this.props.isFullMode) {
|
|
918
907
|
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
919
908
|
}
|
|
920
|
-
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
921
909
|
_.forEach((editData.versions.base.selectedLanguages), (language) => {
|
|
922
910
|
// if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
|
|
923
911
|
// formData[this.state.currentTab - 1].activeTab = language;
|
|
@@ -925,8 +913,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
925
913
|
// if (formData.base.tabKey === formData.base[language].tabKey) {
|
|
926
914
|
// formData.base.activeTab = language;
|
|
927
915
|
// }
|
|
928
|
-
if (language && editData.versions.base[language].is_drag_drop
|
|
929
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport
|
|
916
|
+
if (language && editData.versions.base[language].is_drag_drop) {
|
|
917
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport);
|
|
930
918
|
}
|
|
931
919
|
});
|
|
932
920
|
|
|
@@ -1009,12 +997,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1009
997
|
}
|
|
1010
998
|
saveValidationData = () => {
|
|
1011
999
|
let saveCount = 0;
|
|
1012
|
-
const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
|
|
1013
1000
|
this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
|
|
1014
1001
|
_.forEach(this.state.formData, (newdata, index) => {
|
|
1015
1002
|
if (!isNaN(index)) {
|
|
1016
1003
|
_.forEach(newdata.selectedLanguages, (language) => {
|
|
1017
|
-
if (newdata[language].is_drag_drop &&
|
|
1004
|
+
if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
|
|
1018
1005
|
saveCount += 1;
|
|
1019
1006
|
}
|
|
1020
1007
|
});
|
|
@@ -1131,14 +1118,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1131
1118
|
|
|
1132
1119
|
copyPrimaryLanguage = () => {
|
|
1133
1120
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
1134
|
-
|
|
1121
|
+
|
|
1135
1122
|
this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
|
|
1136
1123
|
this.setState({showModal: false});
|
|
1137
1124
|
const formData = _.cloneDeep(this.state.formData);
|
|
1138
1125
|
const currentTab = this.state.currentTab - 1;
|
|
1139
1126
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
|
|
1140
|
-
if (formData[currentTab][baseLanguage].is_drag_drop
|
|
1141
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport
|
|
1127
|
+
if (formData[currentTab][baseLanguage].is_drag_drop) {
|
|
1128
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport);
|
|
1142
1129
|
}
|
|
1143
1130
|
});
|
|
1144
1131
|
}
|
|
@@ -1525,7 +1512,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1525
1512
|
const data = _.find(this.props.Email.assetList, {_id: id});
|
|
1526
1513
|
|
|
1527
1514
|
if (data) {
|
|
1528
|
-
if (isDragDrop && isEdmSupport
|
|
1515
|
+
if (isDragDrop && isEdmSupport) {
|
|
1529
1516
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
1530
1517
|
if (evtData.action === 'editBackground') {
|
|
1531
1518
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -1560,7 +1547,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1560
1547
|
|
|
1561
1548
|
toggleEmailPreview = () => {
|
|
1562
1549
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
1563
|
-
if (isDragDrop && !this.state.showEmailPreview
|
|
1550
|
+
if (isDragDrop && !this.state.showEmailPreview) {
|
|
1564
1551
|
this.handleEdmSave();
|
|
1565
1552
|
this.setState({mode: "preview", gettingPreviewData: true});
|
|
1566
1553
|
} else if (this.state.showEmailPreview) {
|
|
@@ -2139,10 +2126,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2139
2126
|
"language": this.supportedLanguages[languageIndex].language,
|
|
2140
2127
|
"template-content": templates.html_content,
|
|
2141
2128
|
};
|
|
2142
|
-
|
|
2143
|
-
if (templates.drag_drop_id && isBEEAppEnable) {
|
|
2129
|
+
if (templates.drag_drop_id) {
|
|
2144
2130
|
tempData.drag_drop_id = templates.drag_drop_id;
|
|
2145
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport
|
|
2131
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport);
|
|
2146
2132
|
}
|
|
2147
2133
|
// formData.usingTabContainer = true;
|
|
2148
2134
|
// formData.tabCount = 1;
|
|
@@ -2166,10 +2152,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2166
2152
|
|
|
2167
2153
|
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
|
|
2168
2154
|
// this.setState({tabKey: ''});
|
|
2169
|
-
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2170
2155
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2171
|
-
if (formData[0][language].is_drag_drop
|
|
2172
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport
|
|
2156
|
+
if (formData[0][language].is_drag_drop) {
|
|
2157
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport);
|
|
2173
2158
|
}
|
|
2174
2159
|
});
|
|
2175
2160
|
});
|
|
@@ -2506,8 +2491,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2506
2491
|
// const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
|
|
2507
2492
|
// let getQuery = '';
|
|
2508
2493
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2509
|
-
|
|
2510
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport
|
|
2494
|
+
|
|
2495
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
|
|
2511
2496
|
// this.props.templatesActions.setEdmTemplate(data);
|
|
2512
2497
|
this.toggleEdmEmailTemplateSelection();
|
|
2513
2498
|
// if (type && type.toLowerCase() === 'email') {
|
|
@@ -51,9 +51,9 @@ export function* getAllAssets(assetType, queryParams) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
54
|
+
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport}) {
|
|
55
55
|
try {
|
|
56
|
-
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
56
|
+
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport);
|
|
57
57
|
|
|
58
58
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
59
59
|
} catch (error) {
|
|
@@ -52,7 +52,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
52
52
|
//'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
|
|
53
53
|
mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
|
|
54
54
|
line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
|
|
55
|
-
|
|
56
55
|
};
|
|
57
56
|
let filteredPanes = Object.keys(defaultPanes)
|
|
58
57
|
.filter((key) => !channelsToHide.includes(key)).reduce((obj = [], key) => {
|
|
@@ -153,12 +152,14 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
153
152
|
);
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
getLineComponent = () =>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
getLineComponent = () => {
|
|
156
|
+
return (
|
|
157
|
+
<Line
|
|
158
|
+
{...this.props}
|
|
159
|
+
isCreateFlow
|
|
160
160
|
/>
|
|
161
161
|
)
|
|
162
|
+
}
|
|
162
163
|
|
|
163
164
|
getTemplatesComponent(channel) {
|
|
164
165
|
// const templates = this.props.Templates[`${channel}Templates`];
|