@capillarytech/creatives-library 6.12.4 → 6.12.7

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.
Files changed (84) hide show
  1. package/config/app.js +1 -1
  2. package/package.json +2 -2
  3. package/services/api.js +2 -3
  4. package/v2Components/FormBuilder/index.js +0 -8
  5. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
  6. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
  7. package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
  8. package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
  9. package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
  10. package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
  11. package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
  12. package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
  13. package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
  14. package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
  15. package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
  16. package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
  17. package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
  18. package/v2Components/TemplatePreview/tests/index.test.js +10 -10
  19. package/v2Containers/Cap/_cap.scss +6 -0
  20. package/v2Containers/Cap/constants.js +4 -0
  21. package/v2Containers/Cap/index.js +210 -6
  22. package/v2Containers/Cap/messages.js +41 -0
  23. package/v2Containers/CreativesContainer/SlideBoxContent.js +6 -2
  24. package/v2Containers/CreativesContainer/actions.js +27 -27
  25. package/v2Containers/CreativesContainer/constants.js +17 -17
  26. package/v2Containers/CreativesContainer/index.js +5 -4
  27. package/v2Containers/CreativesContainer/index.scss +44 -44
  28. package/v2Containers/CreativesContainer/messages.js +305 -305
  29. package/v2Containers/CreativesContainer/reducer.js +29 -29
  30. package/v2Containers/CreativesContainer/sagas.js +11 -11
  31. package/v2Containers/CreativesContainer/selectors.js +30 -30
  32. package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
  33. package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
  34. package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
  35. package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
  36. package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
  37. package/v2Containers/Email/actions.js +2 -1
  38. package/v2Containers/Email/index.js +46 -30
  39. package/v2Containers/Email/sagas.js +2 -2
  40. package/v2Containers/Templates/tests/actions.test.js +18 -18
  41. package/v2Containers/Templates/tests/index.test.js +10 -10
  42. package/v2Containers/Templates/tests/reducer.test.js +9 -9
  43. package/v2Containers/Templates/tests/sagas.test.js +15 -15
  44. package/v2Containers/Templates/tests/selectors.test.js +10 -10
  45. package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
  46. package/v2Containers/TemplatesV2/actions.js +16 -16
  47. package/v2Containers/TemplatesV2/constants.js +10 -10
  48. package/v2Containers/TemplatesV2/index.js +5 -6
  49. package/v2Containers/TemplatesV2/messages.js +61 -61
  50. package/v2Containers/TemplatesV2/selectors.js +25 -25
  51. package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
  52. package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
  53. package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
  54. package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
  55. package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
  56. package/v2Components/BeeEditor/index.js +0 -263
  57. package/v2Components/BeeEditor/index.scss +0 -11
  58. package/v2Components/BeeEditor/messages.js +0 -71
  59. package/v2Components/BeeEditor/tests/index.test.js +0 -10
  60. package/v2Containers/Line/Create/_lineCreate.scss +0 -64
  61. package/v2Containers/Line/Create/actions.js +0 -94
  62. package/v2Containers/Line/Create/constants.js +0 -43
  63. package/v2Containers/Line/Create/index.js +0 -1132
  64. package/v2Containers/Line/Create/initialSchema.js +0 -378
  65. package/v2Containers/Line/Create/messages.js +0 -229
  66. package/v2Containers/Line/Create/reducer.js +0 -99
  67. package/v2Containers/Line/Create/sagas.js +0 -113
  68. package/v2Containers/Line/Create/selectors.js +0 -30
  69. package/v2Containers/Line/CreateWrapper/constants.js +0 -2
  70. package/v2Containers/Line/CreateWrapper/index.js +0 -117
  71. package/v2Containers/Line/CreateWrapper/messages.js +0 -55
  72. package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
  73. package/v2Containers/Line/Edit/actions.js +0 -79
  74. package/v2Containers/Line/Edit/constants.js +0 -27
  75. package/v2Containers/Line/Edit/index.js +0 -1051
  76. package/v2Containers/Line/Edit/messages.js +0 -173
  77. package/v2Containers/Line/Edit/reducer.js +0 -83
  78. package/v2Containers/Line/Edit/sagas.js +0 -81
  79. package/v2Containers/Line/Edit/selectors.js +0 -29
  80. package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
  81. package/v2Containers/Line/Edit/tests/index.test.js +0 -10
  82. package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
  83. package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
  84. package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
@@ -1,11 +1,11 @@
1
- // import { take, call, put, select } from 'redux-saga/effects';
2
-
3
- // Individual exports for testing
4
- export function* defaultSaga() {
5
- // See example in v2Containers/HomePage/sagas.js
6
- }
7
-
8
- // All sagas to be loaded
9
- export default [
10
- defaultSaga,
11
- ];
1
+ // import { take, call, put, select } from 'redux-saga/effects';
2
+
3
+ // Individual exports for testing
4
+ export function* defaultSaga() {
5
+ // See example in v2Containers/HomePage/sagas.js
6
+ }
7
+
8
+ // All sagas to be loaded
9
+ export default [
10
+ defaultSaga,
11
+ ];
@@ -1,30 +1,30 @@
1
- import { createSelector } from 'reselect';
2
-
3
- /**
4
- * Direct selector to the creativesContainer state domain
5
- */
6
- const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
7
-
8
- /**
9
- * Other specific selectors
10
- */
11
-
12
-
13
- /**
14
- * Default selector used by CreativesContainer
15
- */
16
-
17
- const makeSelectCreativesContainer = () => createSelector(
18
- selectCreativesContainerDomain(),
19
- (substate) => substate.toJS()
20
- );
21
- const isLoading = () => createSelector(
22
- makeSelectCreativesContainer(),
23
- (substate) => substate.containerLoader
24
- );
25
-
26
- export default makeSelectCreativesContainer;
27
- export {
28
- selectCreativesContainerDomain,
29
- isLoading,
30
- };
1
+ import { createSelector } from 'reselect';
2
+
3
+ /**
4
+ * Direct selector to the creativesContainer state domain
5
+ */
6
+ const selectCreativesContainerDomain = () => (state) => state.get('creativesContainer');
7
+
8
+ /**
9
+ * Other specific selectors
10
+ */
11
+
12
+
13
+ /**
14
+ * Default selector used by CreativesContainer
15
+ */
16
+
17
+ const makeSelectCreativesContainer = () => createSelector(
18
+ selectCreativesContainerDomain(),
19
+ (substate) => substate.toJS()
20
+ );
21
+ const isLoading = () => createSelector(
22
+ makeSelectCreativesContainer(),
23
+ (substate) => substate.containerLoader
24
+ );
25
+
26
+ export default makeSelectCreativesContainer;
27
+ export {
28
+ selectCreativesContainerDomain,
29
+ isLoading,
30
+ };
@@ -1,18 +1,18 @@
1
-
2
- import {
3
- defaultAction,
4
- } from '../actions';
5
- import {
6
- DEFAULT_ACTION,
7
- } from '../constants';
8
-
9
- describe('CreativesContainer actions', () => {
10
- describe('Default Action', () => {
11
- it('has a type of DEFAULT_ACTION', () => {
12
- const expected = {
13
- type: DEFAULT_ACTION,
14
- };
15
- expect(defaultAction()).toEqual(expected);
16
- });
17
- });
18
- });
1
+
2
+ import {
3
+ defaultAction,
4
+ } from '../actions';
5
+ import {
6
+ DEFAULT_ACTION,
7
+ } from '../constants';
8
+
9
+ describe('CreativesContainer actions', () => {
10
+ describe('Default Action', () => {
11
+ it('has a type of DEFAULT_ACTION', () => {
12
+ const expected = {
13
+ type: DEFAULT_ACTION,
14
+ };
15
+ expect(defaultAction()).toEqual(expected);
16
+ });
17
+ });
18
+ });
@@ -1,10 +1,10 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import { CreativesContainer } from '../index';
5
-
6
- describe('<CreativesContainer />', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(true);
9
- });
10
- });
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import { CreativesContainer } from '../index';
5
+
6
+ describe('<CreativesContainer />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(true);
9
+ });
10
+ });
@@ -1,9 +1,9 @@
1
-
2
- import { fromJS } from 'immutable';
3
- import creativesContainerReducer from '../reducer';
4
-
5
- describe('creativesContainerReducer', () => {
6
- it('returns the initial state', () => {
7
- expect(creativesContainerReducer(undefined, {})).toEqual(fromJS({}));
8
- });
9
- });
1
+
2
+ import { fromJS } from 'immutable';
3
+ import creativesContainerReducer from '../reducer';
4
+
5
+ describe('creativesContainerReducer', () => {
6
+ it('returns the initial state', () => {
7
+ expect(creativesContainerReducer(undefined, {})).toEqual(fromJS({}));
8
+ });
9
+ });
@@ -1,15 +1,15 @@
1
- /**
2
- * Test sagas
3
- */
4
-
5
- /* eslint-disable redux-saga/yield-effects */
6
- // import { take, call, put, select } from 'redux-saga/effects';
7
- // import { defaultSaga } from '../sagas';
8
-
9
- // const generator = defaultSaga();
10
-
11
- describe('defaultSaga Saga', () => {
12
- it('Expect to have unit tests specified', () => {
13
- expect(true).toEqual(true);
14
- });
15
- });
1
+ /**
2
+ * Test sagas
3
+ */
4
+
5
+ /* eslint-disable redux-saga/yield-effects */
6
+ // import { take, call, put, select } from 'redux-saga/effects';
7
+ // import { defaultSaga } from '../sagas';
8
+
9
+ // const generator = defaultSaga();
10
+
11
+ describe('defaultSaga Saga', () => {
12
+ it('Expect to have unit tests specified', () => {
13
+ expect(true).toEqual(true);
14
+ });
15
+ });
@@ -1,10 +1,10 @@
1
- // import { fromJS } from 'immutable';
2
- // import { makeSelectCreativesContainerDomain } from '../selectors';
3
-
4
- // const selector = makeSelectCreativesContainerDomain();
5
-
6
- describe('makeSelectCreativesContainerDomain', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(true);
9
- });
10
- });
1
+ // import { fromJS } from 'immutable';
2
+ // import { makeSelectCreativesContainerDomain } from '../selectors';
3
+
4
+ // const selector = makeSelectCreativesContainerDomain();
5
+
6
+ describe('makeSelectCreativesContainerDomain', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(true);
9
+ });
10
+ });
@@ -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, disableBEE) {
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
+ disableBEE,
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.hideEdmOptions(nextProps.Email.CmsSettings.isDragDrop);
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({
@@ -515,7 +526,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
515
526
  }
516
527
  if (!_.isEmpty(nextProps.Email.templateDetails) && _.isEmpty(this.props.Email.templateDetails) ) {
517
528
  const base = nextProps.Email.templateDetails.versions.base;
518
- if (nextProps.Email.templateDetails.versions.base[base.activeTab].is_drag_drop) {
529
+ if (nextProps.Email.templateDetails.versions.base[base.activeTab].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
519
530
  this.setState({isDragDrop: true});
520
531
  }
521
532
  }
@@ -580,7 +591,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
580
591
  //this.resetCkEditorInstance(data, formData);
581
592
  const schema = _.cloneDeep(this.state.schema);
582
593
  const container = schema.containers[`${data - 1}`];
583
- if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop) {
594
+ if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
584
595
  container.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: ""};
585
596
  container.tabBarExtraContent.sections[0].inputFields[0].cols[2].style.display = "none";
586
597
  } else {
@@ -605,7 +616,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
605
616
  const formData = _.cloneDeep(this.state.formData);
606
617
  const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
607
618
 
608
- if (isDragDrop && isBEESupport) {
619
+ if (isDragDrop && isBEESupport && this.checkBeeEditorAllowedForLibrary()) {
609
620
  let msg = {};
610
621
  if (data === "unsubscribe") {
611
622
  const anchor = `<a href='{{${data}}}'>${data}</a>`;
@@ -648,9 +659,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
648
659
  const base = formData.base || {};
649
660
  const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
650
661
  let editorType = '';
651
- if ( isDragDrop === true) {
662
+ if ( isDragDrop === true && this.checkBeeEditorAllowedForLibrary()) {
652
663
  editorType = 'edmEditor';
653
- } else if (isDragDrop === false) {
664
+ } else if (isDragDrop === false && !this.checkBeeEditorAllowedForLibrary()) {
654
665
  editorType = 'ckEditor';
655
666
  }
656
667
  GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
@@ -705,7 +716,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
705
716
  _.forEach(formData, (val, index) => {
706
717
  if (!isNaN(index)) {
707
718
  _.forEach(val.selectedLanguages, (language) => {
708
- if (val[language].is_drag_drop) {
719
+ if (val[language].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
709
720
  that.props.actions.getCmsData(BEE_PLUGIN, id, language);
710
721
  }
711
722
  });
@@ -906,6 +917,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
906
917
  if (this.props.isFullMode) {
907
918
  this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
908
919
  }
920
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
909
921
  _.forEach((editData.versions.base.selectedLanguages), (language) => {
910
922
  // if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
911
923
  // formData[this.state.currentTab - 1].activeTab = language;
@@ -913,8 +925,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
913
925
  // if (formData.base.tabKey === formData.base[language].tabKey) {
914
926
  // formData.base.activeTab = language;
915
927
  // }
916
- if (language && editData.versions.base[language].is_drag_drop) {
917
- this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport);
928
+ if (language && editData.versions.base[language].is_drag_drop && isBEEAppEnable) {
929
+ this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport, isBEEAppEnable);
918
930
  }
919
931
  });
920
932
 
@@ -997,11 +1009,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
997
1009
  }
998
1010
  saveValidationData = () => {
999
1011
  let saveCount = 0;
1012
+ const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
1000
1013
  this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
1001
1014
  _.forEach(this.state.formData, (newdata, index) => {
1002
1015
  if (!isNaN(index)) {
1003
1016
  _.forEach(newdata.selectedLanguages, (language) => {
1004
- if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
1017
+ if (newdata[language].is_drag_drop && isBeeEnable && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
1005
1018
  saveCount += 1;
1006
1019
  }
1007
1020
  });
@@ -1118,14 +1131,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1118
1131
 
1119
1132
  copyPrimaryLanguage = () => {
1120
1133
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1121
-
1134
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
1122
1135
  this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
1123
1136
  this.setState({showModal: false});
1124
1137
  const formData = _.cloneDeep(this.state.formData);
1125
1138
  const currentTab = this.state.currentTab - 1;
1126
1139
  const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
1127
- if (formData[currentTab][baseLanguage].is_drag_drop) {
1128
- this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport);
1140
+ if (formData[currentTab][baseLanguage].is_drag_drop && isBEEAppEnable) {
1141
+ this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport, isBEEAppEnable);
1129
1142
  }
1130
1143
  });
1131
1144
  }
@@ -1512,7 +1525,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1512
1525
  const data = _.find(this.props.Email.assetList, {_id: id});
1513
1526
 
1514
1527
  if (data) {
1515
- if (isDragDrop && isEdmSupport) {
1528
+ if (isDragDrop && isEdmSupport && this.checkBeeEditorAllowedForLibrary()) {
1516
1529
  const evtData = JSON.parse(this.edmEvent.data);
1517
1530
  if (evtData.action === 'editBackground') {
1518
1531
  this.edmEvent.source.postMessage(JSON.stringify({
@@ -1547,7 +1560,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1547
1560
 
1548
1561
  toggleEmailPreview = () => {
1549
1562
  const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
1550
- if (isDragDrop && !this.state.showEmailPreview) {
1563
+ if (isDragDrop && !this.state.showEmailPreview && this.checkBeeEditorAllowedForLibrary()) {
1551
1564
  this.handleEdmSave();
1552
1565
  this.setState({mode: "preview", gettingPreviewData: true});
1553
1566
  } else if (this.state.showEmailPreview) {
@@ -2126,9 +2139,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2126
2139
  "language": this.supportedLanguages[languageIndex].language,
2127
2140
  "template-content": templates.html_content,
2128
2141
  };
2129
- if (templates.drag_drop_id) {
2142
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2143
+ if (templates.drag_drop_id && isBEEAppEnable) {
2130
2144
  tempData.drag_drop_id = templates.drag_drop_id;
2131
- this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport);
2145
+ this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport, isBEEAppEnable);
2132
2146
  }
2133
2147
  // formData.usingTabContainer = true;
2134
2148
  // formData.tabCount = 1;
@@ -2152,9 +2166,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2152
2166
 
2153
2167
  this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2154
2168
  // this.setState({tabKey: ''});
2169
+ const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
2155
2170
  _.forEach(formData[0].selectedLanguages, (language) => {
2156
- if (formData[0][language].is_drag_drop) {
2157
- this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport);
2171
+ if (formData[0][language].is_drag_drop && isBEEEnable) {
2172
+ this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
2158
2173
  }
2159
2174
  });
2160
2175
  });
@@ -2491,8 +2506,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2491
2506
  // const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
2492
2507
  // let getQuery = '';
2493
2508
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
2494
-
2495
- this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
2509
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2510
+ this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport, isBEEAppEnable);
2496
2511
  // this.props.templatesActions.setEdmTemplate(data);
2497
2512
  this.toggleEdmEmailTemplateSelection();
2498
2513
  // if (type && type.toLowerCase() === 'email') {
@@ -2666,7 +2681,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2666
2681
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
2667
2682
  tags = this.props.supportedTags;
2668
2683
  }
2669
- const showTestAndPreview = getDefaultTags === 'outbound';
2684
+ const { showImageSelectionBox = false } = this.state;
2685
+ const showTestAndPreview = !showImageSelectionBox && getDefaultTags === 'outbound';
2670
2686
  return (
2671
2687
  <div className="email-container">
2672
2688
  <CapSpin spinning={isLoading}>
@@ -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, disableBEE}) {
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, disableBEE);
57
57
 
58
58
  yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
59
59
  } catch (error) {
@@ -1,18 +1,18 @@
1
-
2
- import {
3
- defaultAction,
4
- } from '../actions';
5
- import {
6
- DEFAULT_ACTION,
7
- } from '../constants';
8
-
9
- describe('Templates actions', () => {
10
- describe('Default Action', () => {
11
- it('has a type of DEFAULT_ACTION', () => {
12
- const expected = {
13
- type: DEFAULT_ACTION,
14
- };
15
- expect(defaultAction()).toEqual(expected);
16
- });
17
- });
18
- });
1
+
2
+ import {
3
+ defaultAction,
4
+ } from '../actions';
5
+ import {
6
+ DEFAULT_ACTION,
7
+ } from '../constants';
8
+
9
+ describe('Templates actions', () => {
10
+ describe('Default Action', () => {
11
+ it('has a type of DEFAULT_ACTION', () => {
12
+ const expected = {
13
+ type: DEFAULT_ACTION,
14
+ };
15
+ expect(defaultAction()).toEqual(expected);
16
+ });
17
+ });
18
+ });
@@ -1,10 +1,10 @@
1
- // import React from 'react';
2
- // import { shallow } from 'enzyme';
3
-
4
- // import { Templates } from '../index';
5
-
6
- describe('<Templates />', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(false);
9
- });
10
- });
1
+ // import React from 'react';
2
+ // import { shallow } from 'enzyme';
3
+
4
+ // import { Templates } from '../index';
5
+
6
+ describe('<Templates />', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });
@@ -1,9 +1,9 @@
1
-
2
- import { fromJS } from 'immutable';
3
- import templatesReducer from '../reducer';
4
-
5
- describe('templatesReducer', () => {
6
- it('returns the initial state', () => {
7
- expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
8
- });
9
- });
1
+
2
+ import { fromJS } from 'immutable';
3
+ import templatesReducer from '../reducer';
4
+
5
+ describe('templatesReducer', () => {
6
+ it('returns the initial state', () => {
7
+ expect(templatesReducer(undefined, {})).toEqual(fromJS({}));
8
+ });
9
+ });
@@ -1,15 +1,15 @@
1
- /**
2
- * Test sagas
3
- */
4
-
5
- /* eslint-disable redux-saga/yield-effects */
6
- // import { take, call, put, select } from 'redux-saga/effects';
7
- // import { defaultSaga } from '../sagas';
8
-
9
- // const generator = defaultSaga();
10
-
11
- describe('defaultSaga Saga', () => {
12
- it('Expect to have unit tests specified', () => {
13
- expect(true).toEqual(false);
14
- });
15
- });
1
+ /**
2
+ * Test sagas
3
+ */
4
+
5
+ /* eslint-disable redux-saga/yield-effects */
6
+ // import { take, call, put, select } from 'redux-saga/effects';
7
+ // import { defaultSaga } from '../sagas';
8
+
9
+ // const generator = defaultSaga();
10
+
11
+ describe('defaultSaga Saga', () => {
12
+ it('Expect to have unit tests specified', () => {
13
+ expect(true).toEqual(false);
14
+ });
15
+ });
@@ -1,10 +1,10 @@
1
- // import { fromJS } from 'immutable';
2
- // import { makeSelectTemplatesDomain } from '../selectors';
3
-
4
- // const selector = makeSelectTemplatesDomain();
5
-
6
- describe('makeSelectTemplatesDomain', () => {
7
- it('Expect to have unit tests specified', () => {
8
- expect(true).toEqual(false);
9
- });
10
- });
1
+ // import { fromJS } from 'immutable';
2
+ // import { makeSelectTemplatesDomain } from '../selectors';
3
+
4
+ // const selector = makeSelectTemplatesDomain();
5
+
6
+ describe('makeSelectTemplatesDomain', () => {
7
+ it('Expect to have unit tests specified', () => {
8
+ expect(true).toEqual(false);
9
+ });
10
+ });