@capillarytech/creatives-library 6.13.0 → 6.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/services/api.js +2 -3
- package/v2Components/FormBuilder/index.js +0 -8
- package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -2
- package/v2Containers/CreativesContainer/index.js +2 -1
- package/v2Containers/Email/actions.js +2 -1
- package/v2Containers/Email/index.js +44 -29
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/EmailWrapper/index.js +2 -0
- package/v2Containers/TemplatesV2/index.js +5 -6
package/package.json
CHANGED
package/services/api.js
CHANGED
|
@@ -319,12 +319,11 @@ 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, isBEEAppEnable) => {
|
|
323
|
+
const url = `${API_ENDPOINT}/cms/v2/getDetails/?type=${cmsType}&projectId=${projectId}&cmsMode=${cmsMode}&langId=${langId}&isEdmSupport=${isEdmSupport ? 1 : 0}&isBEEAppEnable=${isBEEAppEnable}`;
|
|
324
324
|
return API.get(url);
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
-
|
|
328
327
|
export const getCmsTemplateData = (cmsType, projectId, langId) => {
|
|
329
328
|
const url = `${API_ENDPOINT}/cms/getContent?type=${cmsType}&projectId=${projectId}&langId=${langId}`;
|
|
330
329
|
return API.get(url);
|
|
@@ -1470,10 +1470,6 @@ 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 {
|
|
1477
1473
|
if (index === 'tabKey') {
|
|
1478
1474
|
formData[newTabIndex][key][index] = _.uniqueId();
|
|
1479
1475
|
} else if (index === 'template-content') {
|
|
@@ -3180,10 +3176,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3180
3176
|
console.log('CKEditor Data 2', this.state.formData, this.state.formData[`${this.state.currentTab - 1}`], val, this.state.currentTab, this.state.currentLangTab, langIndex);
|
|
3181
3177
|
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';
|
|
3182
3178
|
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
|
-
}
|
|
3187
3179
|
columns.push(
|
|
3188
3180
|
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
3189
3181
|
<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,6 +96,7 @@ function SlideBoxContent(props) {
|
|
|
96
96
|
cap,
|
|
97
97
|
onResetStep,
|
|
98
98
|
isFullMode,
|
|
99
|
+
editor,
|
|
99
100
|
onCallTaskSubmit,
|
|
100
101
|
setIsLoadingContent,
|
|
101
102
|
showTemplateName,
|
|
@@ -184,7 +185,7 @@ function SlideBoxContent(props) {
|
|
|
184
185
|
} = {},
|
|
185
186
|
template,
|
|
186
187
|
}) => {
|
|
187
|
-
|
|
188
|
+
const previewContent = {};
|
|
188
189
|
previewContent.messageContent = text;
|
|
189
190
|
previewContent.previewImageUrl = previewImageUrl;
|
|
190
191
|
previewContent.selectedSticker = selectedSticker || {
|
|
@@ -366,6 +367,7 @@ function SlideBoxContent(props) {
|
|
|
366
367
|
step={templateStep}
|
|
367
368
|
showNextStep={onCreateNextStep}
|
|
368
369
|
isFullMode={isFullMode}
|
|
370
|
+
editor={editor}
|
|
369
371
|
cap={cap}
|
|
370
372
|
onResetStep={onResetStep}
|
|
371
373
|
showTemplateName={showTemplateName}
|
|
@@ -392,6 +394,7 @@ function SlideBoxContent(props) {
|
|
|
392
394
|
getFormSubscriptionData={getFormData}
|
|
393
395
|
getDefaultTags={type}
|
|
394
396
|
isFullMode={isFullMode}
|
|
397
|
+
editor={editor}
|
|
395
398
|
cap={cap}
|
|
396
399
|
showTemplateName={showTemplateName}
|
|
397
400
|
onValidationFail={onValidationFail}
|
|
@@ -456,6 +459,7 @@ function SlideBoxContent(props) {
|
|
|
456
459
|
messageDetails={messageDetails}
|
|
457
460
|
cap={cap}
|
|
458
461
|
onFacebookSubmit={onFacebookSubmit}
|
|
462
|
+
isFullMode={isFullMode}
|
|
459
463
|
/>
|
|
460
464
|
)
|
|
461
465
|
}
|
|
@@ -533,7 +533,7 @@ class Creatives extends React.Component {
|
|
|
533
533
|
}
|
|
534
534
|
render() {
|
|
535
535
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
536
|
-
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData} = this.props;
|
|
536
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor} = this.props;
|
|
537
537
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
538
538
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
539
539
|
return (
|
|
@@ -606,6 +606,7 @@ class Creatives extends React.Component {
|
|
|
606
606
|
selectedAccount={this.props.selectedAccount}
|
|
607
607
|
onShowTemplates={this.onShowTemplates}
|
|
608
608
|
handleClose={this.handleCloseSlideBox}
|
|
609
|
+
editor={editor}
|
|
609
610
|
/>
|
|
610
611
|
}
|
|
611
612
|
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, isBEEAppEnable) {
|
|
42
42
|
return {
|
|
43
43
|
type: types.GET_CMS_EDITOR_DETAILS_REQUEST,
|
|
44
44
|
cmsType,
|
|
@@ -46,6 +46,7 @@ export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport)
|
|
|
46
46
|
cmsMode,
|
|
47
47
|
langId,
|
|
48
48
|
isEdmSupport,
|
|
49
|
+
isBEEAppEnable,
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -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
|
+
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
187
|
+
if (!_.isEmpty(this.props.Templates.BEETemplate)) {
|
|
188
|
+
if (this.props.Templates.BEETemplate.versions.base.is_drag_drop && isBEEAppEnable ) {
|
|
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, isBEEAppEnable);
|
|
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, isBEEAppEnable);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData});
|
|
@@ -214,6 +214,15 @@ 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
|
+
|
|
217
226
|
componentWillReceiveProps(nextProps) {
|
|
218
227
|
// if (this.props.location.query.type === 'embedded') {
|
|
219
228
|
// this.showNext();
|
|
@@ -315,8 +324,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
315
324
|
if (nextProps.location.query.module === 'library' && nextProps.isGetFormData) {
|
|
316
325
|
const formData = this.state.formData;
|
|
317
326
|
let isBeeEditor = false;
|
|
327
|
+
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
318
328
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
319
|
-
if (formData[0][language].is_drag_drop) {
|
|
329
|
+
if (formData[0][language].is_drag_drop && isBEEEnable) {
|
|
320
330
|
isBeeEditor = true;
|
|
321
331
|
}
|
|
322
332
|
});
|
|
@@ -349,7 +359,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
349
359
|
const temp = (schema.containers || {})[this.state.currentTab - 1];
|
|
350
360
|
|
|
351
361
|
const { currentTab } = this.state;
|
|
352
|
-
if (nextProps.Email.CmsSettings.isDragDrop) {
|
|
362
|
+
if (nextProps.Email.CmsSettings.isDragDrop && this.checkBeeEditorAllowedForLibrary()) {
|
|
353
363
|
const beeJson = `BEEeditor${currentTab > 1 ? currentTab : ''}json`;
|
|
354
364
|
const beeToken = `BEEeditor${currentTab > 1 ? currentTab : ''}token`;
|
|
355
365
|
let beeJsonValue = _.get(nextProps, 'Templates.BEETemplate.versions.base.json-content', '');
|
|
@@ -409,7 +419,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
409
419
|
}
|
|
410
420
|
|
|
411
421
|
this.setState({ formData }, () => {
|
|
412
|
-
this.
|
|
422
|
+
const isDragDrop = this.checkBeeEditorAllowedForLibrary() && nextProps.Email.CmsSettings.isDragDrop;
|
|
423
|
+
this.hideEdmOptions(isDragDrop);
|
|
413
424
|
});
|
|
414
425
|
}
|
|
415
426
|
if (nextProps.Email.createTemplateError && !_.isEqual(nextProps.Email.createTemplateError, this.props.Email.createTemplateError)) {
|
|
@@ -469,7 +480,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
469
480
|
if ( !_.isEqual(nextProps.Email.uploadAssetSuccess, this.props.Email.uploadAssetSuccess) && nextProps.Email.uploadAssetSuccess) {
|
|
470
481
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
471
482
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
472
|
-
if (isDragDrop && isBEESupport) {
|
|
483
|
+
if (isDragDrop && isBEESupport && this.checkBeeEditorAllowedForLibrary()) {
|
|
473
484
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
474
485
|
if (evtData.action === 'editBackground') {
|
|
475
486
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -516,7 +527,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
516
527
|
if (!_.isEmpty(nextProps.Email.templateDetails) && _.isEmpty(this.props.Email.templateDetails) ) {
|
|
517
528
|
const base = nextProps.Email.templateDetails.versions.base;
|
|
518
529
|
const activeBase = nextProps.Email.templateDetails.versions.base[base.activeTab];
|
|
519
|
-
if (activeBase && activeBase.is_drag_drop) {
|
|
530
|
+
if (activeBase && activeBase.is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
|
|
520
531
|
this.setState({isDragDrop: true});
|
|
521
532
|
}
|
|
522
533
|
}
|
|
@@ -581,7 +592,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
581
592
|
//this.resetCkEditorInstance(data, formData);
|
|
582
593
|
const schema = _.cloneDeep(this.state.schema);
|
|
583
594
|
const container = schema.containers[`${data - 1}`];
|
|
584
|
-
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop) {
|
|
595
|
+
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
|
|
585
596
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: ""};
|
|
586
597
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[2].style.display = "none";
|
|
587
598
|
} else {
|
|
@@ -606,7 +617,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
606
617
|
const formData = _.cloneDeep(this.state.formData);
|
|
607
618
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
608
619
|
|
|
609
|
-
if (isDragDrop && isBEESupport) {
|
|
620
|
+
if (isDragDrop && isBEESupport && this.checkBeeEditorAllowedForLibrary()) {
|
|
610
621
|
let msg = {};
|
|
611
622
|
if (data === "unsubscribe") {
|
|
612
623
|
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
@@ -649,9 +660,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
649
660
|
const base = formData.base || {};
|
|
650
661
|
const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
|
|
651
662
|
let editorType = '';
|
|
652
|
-
if ( isDragDrop === true) {
|
|
663
|
+
if ( isDragDrop === true && this.checkBeeEditorAllowedForLibrary()) {
|
|
653
664
|
editorType = 'edmEditor';
|
|
654
|
-
} else if (isDragDrop === false) {
|
|
665
|
+
} else if (isDragDrop === false && !this.checkBeeEditorAllowedForLibrary()) {
|
|
655
666
|
editorType = 'ckEditor';
|
|
656
667
|
}
|
|
657
668
|
GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
|
|
@@ -706,7 +717,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
706
717
|
_.forEach(formData, (val, index) => {
|
|
707
718
|
if (!isNaN(index)) {
|
|
708
719
|
_.forEach(val.selectedLanguages, (language) => {
|
|
709
|
-
if (val[language].is_drag_drop) {
|
|
720
|
+
if (val[language].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
|
|
710
721
|
that.props.actions.getCmsData(BEE_PLUGIN, id, language);
|
|
711
722
|
}
|
|
712
723
|
});
|
|
@@ -907,6 +918,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
907
918
|
if (this.props.isFullMode) {
|
|
908
919
|
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
909
920
|
}
|
|
921
|
+
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
910
922
|
_.forEach((editData.versions.base.selectedLanguages), (language) => {
|
|
911
923
|
// if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
|
|
912
924
|
// formData[this.state.currentTab - 1].activeTab = language;
|
|
@@ -914,8 +926,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
914
926
|
// if (formData.base.tabKey === formData.base[language].tabKey) {
|
|
915
927
|
// formData.base.activeTab = language;
|
|
916
928
|
// }
|
|
917
|
-
if (language && editData.versions.base[language].is_drag_drop) {
|
|
918
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport);
|
|
929
|
+
if (language && editData.versions.base[language].is_drag_drop && isBEEAppEnable) {
|
|
930
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport, isBEEAppEnable);
|
|
919
931
|
}
|
|
920
932
|
});
|
|
921
933
|
|
|
@@ -998,11 +1010,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
998
1010
|
}
|
|
999
1011
|
saveValidationData = () => {
|
|
1000
1012
|
let saveCount = 0;
|
|
1013
|
+
const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
|
|
1001
1014
|
this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
|
|
1002
1015
|
_.forEach(this.state.formData, (newdata, index) => {
|
|
1003
1016
|
if (!isNaN(index)) {
|
|
1004
1017
|
_.forEach(newdata.selectedLanguages, (language) => {
|
|
1005
|
-
if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
|
|
1018
|
+
if (newdata[language].is_drag_drop && isBeeEnable && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
|
|
1006
1019
|
saveCount += 1;
|
|
1007
1020
|
}
|
|
1008
1021
|
});
|
|
@@ -1119,14 +1132,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1119
1132
|
|
|
1120
1133
|
copyPrimaryLanguage = () => {
|
|
1121
1134
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
1122
|
-
|
|
1135
|
+
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
1123
1136
|
this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
|
|
1124
1137
|
this.setState({showModal: false});
|
|
1125
1138
|
const formData = _.cloneDeep(this.state.formData);
|
|
1126
1139
|
const currentTab = this.state.currentTab - 1;
|
|
1127
1140
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
|
|
1128
|
-
if (formData[currentTab][baseLanguage].is_drag_drop) {
|
|
1129
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport);
|
|
1141
|
+
if (formData[currentTab][baseLanguage].is_drag_drop && isBEEAppEnable) {
|
|
1142
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport, isBEEAppEnable);
|
|
1130
1143
|
}
|
|
1131
1144
|
});
|
|
1132
1145
|
}
|
|
@@ -1504,7 +1517,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1504
1517
|
const data = _.find(this.props.Email.assetList, {_id: id});
|
|
1505
1518
|
|
|
1506
1519
|
if (data) {
|
|
1507
|
-
if (isDragDrop && isEdmSupport) {
|
|
1520
|
+
if (isDragDrop && isEdmSupport && this.checkBeeEditorAllowedForLibrary()) {
|
|
1508
1521
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
1509
1522
|
if (evtData.action === 'editBackground') {
|
|
1510
1523
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -1539,7 +1552,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1539
1552
|
|
|
1540
1553
|
toggleEmailPreview = () => {
|
|
1541
1554
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
1542
|
-
if (isDragDrop && !this.state.showEmailPreview) {
|
|
1555
|
+
if (isDragDrop && !this.state.showEmailPreview && this.checkBeeEditorAllowedForLibrary()) {
|
|
1543
1556
|
this.handleEdmSave();
|
|
1544
1557
|
this.setState({mode: "preview", gettingPreviewData: true});
|
|
1545
1558
|
} else if (this.state.showEmailPreview) {
|
|
@@ -2118,9 +2131,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2118
2131
|
"language": this.supportedLanguages[languageIndex].language,
|
|
2119
2132
|
"template-content": templates.html_content,
|
|
2120
2133
|
};
|
|
2121
|
-
|
|
2134
|
+
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2135
|
+
if (templates.drag_drop_id && isBEEAppEnable) {
|
|
2122
2136
|
tempData.drag_drop_id = templates.drag_drop_id;
|
|
2123
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport);
|
|
2137
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport, isBEEAppEnable);
|
|
2124
2138
|
}
|
|
2125
2139
|
// formData.usingTabContainer = true;
|
|
2126
2140
|
// formData.tabCount = 1;
|
|
@@ -2144,9 +2158,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2144
2158
|
|
|
2145
2159
|
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
|
|
2146
2160
|
// this.setState({tabKey: ''});
|
|
2161
|
+
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2147
2162
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2148
|
-
if (formData[0][language].is_drag_drop) {
|
|
2149
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport);
|
|
2163
|
+
if (formData[0][language].is_drag_drop && isBEEEnable) {
|
|
2164
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
|
|
2150
2165
|
}
|
|
2151
2166
|
});
|
|
2152
2167
|
});
|
|
@@ -2483,8 +2498,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2483
2498
|
// const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
|
|
2484
2499
|
// let getQuery = '';
|
|
2485
2500
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2486
|
-
|
|
2487
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
|
|
2501
|
+
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2502
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport, isBEEAppEnable);
|
|
2488
2503
|
// this.props.templatesActions.setEdmTemplate(data);
|
|
2489
2504
|
this.toggleEdmEmailTemplateSelection();
|
|
2490
2505
|
// 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, isBEEAppEnable}) {
|
|
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, isBEEAppEnable);
|
|
57
57
|
|
|
58
58
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
59
59
|
} catch (error) {
|
|
@@ -196,6 +196,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
196
196
|
onPreviewContentClicked,
|
|
197
197
|
onTestContentClicked,
|
|
198
198
|
cmsTemplatesLoader,
|
|
199
|
+
editor,
|
|
199
200
|
} = this.props;
|
|
200
201
|
const {
|
|
201
202
|
templateName,
|
|
@@ -259,6 +260,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
259
260
|
selectedOfferDetails={selectedOfferDetails}
|
|
260
261
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
261
262
|
onTestContentClicked={onTestContentClicked}
|
|
263
|
+
editor={editor}
|
|
262
264
|
/>}
|
|
263
265
|
{!isShowEmailCreate && (
|
|
264
266
|
<CmsTemplatesComponent
|
|
@@ -52,6 +52,7 @@ 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
|
+
|
|
55
56
|
};
|
|
56
57
|
let filteredPanes = Object.keys(defaultPanes)
|
|
57
58
|
.filter((key) => !channelsToHide.includes(key)).reduce((obj = [], key) => {
|
|
@@ -152,14 +153,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
getLineComponent = () =>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
isCreateFlow
|
|
156
|
+
getLineComponent = () => (
|
|
157
|
+
<Line
|
|
158
|
+
{...this.props}
|
|
159
|
+
isCreateFlow
|
|
160
160
|
/>
|
|
161
161
|
)
|
|
162
|
-
}
|
|
163
162
|
|
|
164
163
|
getTemplatesComponent(channel) {
|
|
165
164
|
// const templates = this.props.Templates[`${channel}Templates`];
|