@capillarytech/creatives-library 6.14.0 → 6.14.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.
@@ -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,8 @@ 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
+ const activeBase = nextProps.Email.templateDetails.versions.base[base.activeTab];
530
+ if (activeBase && activeBase.is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
519
531
  this.setState({isDragDrop: true});
520
532
  }
521
533
  }
@@ -580,7 +592,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
580
592
  //this.resetCkEditorInstance(data, formData);
581
593
  const schema = _.cloneDeep(this.state.schema);
582
594
  const container = schema.containers[`${data - 1}`];
583
- 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()) {
584
596
  container.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: ""};
585
597
  container.tabBarExtraContent.sections[0].inputFields[0].cols[2].style.display = "none";
586
598
  } else {
@@ -605,7 +617,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
605
617
  const formData = _.cloneDeep(this.state.formData);
606
618
  const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
607
619
 
608
- if (isDragDrop && isBEESupport) {
620
+ if (isDragDrop && isBEESupport && this.checkBeeEditorAllowedForLibrary()) {
609
621
  let msg = {};
610
622
  if (data === "unsubscribe") {
611
623
  const anchor = `<a href='{{${data}}}'>${data}</a>`;
@@ -648,9 +660,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
648
660
  const base = formData.base || {};
649
661
  const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
650
662
  let editorType = '';
651
- if ( isDragDrop === true) {
663
+ if ( isDragDrop === true && this.checkBeeEditorAllowedForLibrary()) {
652
664
  editorType = 'edmEditor';
653
- } else if (isDragDrop === false) {
665
+ } else if (isDragDrop === false && !this.checkBeeEditorAllowedForLibrary()) {
654
666
  editorType = 'ckEditor';
655
667
  }
656
668
  GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
@@ -705,7 +717,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
705
717
  _.forEach(formData, (val, index) => {
706
718
  if (!isNaN(index)) {
707
719
  _.forEach(val.selectedLanguages, (language) => {
708
- if (val[language].is_drag_drop) {
720
+ if (val[language].is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
709
721
  that.props.actions.getCmsData(BEE_PLUGIN, id, language);
710
722
  }
711
723
  });
@@ -906,6 +918,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
906
918
  if (this.props.isFullMode) {
907
919
  this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
908
920
  }
921
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
909
922
  _.forEach((editData.versions.base.selectedLanguages), (language) => {
910
923
  // if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
911
924
  // formData[this.state.currentTab - 1].activeTab = language;
@@ -913,8 +926,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
913
926
  // if (formData.base.tabKey === formData.base[language].tabKey) {
914
927
  // formData.base.activeTab = language;
915
928
  // }
916
- if (language && editData.versions.base[language].is_drag_drop) {
917
- 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);
918
931
  }
919
932
  });
920
933
 
@@ -997,11 +1010,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
997
1010
  }
998
1011
  saveValidationData = () => {
999
1012
  let saveCount = 0;
1013
+ const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
1000
1014
  this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
1001
1015
  _.forEach(this.state.formData, (newdata, index) => {
1002
1016
  if (!isNaN(index)) {
1003
1017
  _.forEach(newdata.selectedLanguages, (language) => {
1004
- 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)) {
1005
1019
  saveCount += 1;
1006
1020
  }
1007
1021
  });
@@ -1118,14 +1132,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1118
1132
 
1119
1133
  copyPrimaryLanguage = () => {
1120
1134
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1121
-
1135
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
1122
1136
  this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
1123
1137
  this.setState({showModal: false});
1124
1138
  const formData = _.cloneDeep(this.state.formData);
1125
1139
  const currentTab = this.state.currentTab - 1;
1126
1140
  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);
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);
1129
1143
  }
1130
1144
  });
1131
1145
  }
@@ -1503,7 +1517,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1503
1517
  const data = _.find(this.props.Email.assetList, {_id: id});
1504
1518
 
1505
1519
  if (data) {
1506
- if (isDragDrop && isEdmSupport) {
1520
+ if (isDragDrop && isEdmSupport && this.checkBeeEditorAllowedForLibrary()) {
1507
1521
  const evtData = JSON.parse(this.edmEvent.data);
1508
1522
  if (evtData.action === 'editBackground') {
1509
1523
  this.edmEvent.source.postMessage(JSON.stringify({
@@ -1538,7 +1552,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1538
1552
 
1539
1553
  toggleEmailPreview = () => {
1540
1554
  const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
1541
- if (isDragDrop && !this.state.showEmailPreview) {
1555
+ if (isDragDrop && !this.state.showEmailPreview && this.checkBeeEditorAllowedForLibrary()) {
1542
1556
  this.handleEdmSave();
1543
1557
  this.setState({mode: "preview", gettingPreviewData: true});
1544
1558
  } else if (this.state.showEmailPreview) {
@@ -2117,9 +2131,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2117
2131
  "language": this.supportedLanguages[languageIndex].language,
2118
2132
  "template-content": templates.html_content,
2119
2133
  };
2120
- if (templates.drag_drop_id) {
2134
+ const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
2135
+ if (templates.drag_drop_id && isBEEAppEnable) {
2121
2136
  tempData.drag_drop_id = templates.drag_drop_id;
2122
- 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);
2123
2138
  }
2124
2139
  // formData.usingTabContainer = true;
2125
2140
  // formData.tabCount = 1;
@@ -2143,9 +2158,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2143
2158
 
2144
2159
  this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2145
2160
  // this.setState({tabKey: ''});
2161
+ const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
2146
2162
  _.forEach(formData[0].selectedLanguages, (language) => {
2147
- if (formData[0][language].is_drag_drop) {
2148
- 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);
2149
2165
  }
2150
2166
  });
2151
2167
  });
@@ -2482,8 +2498,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2482
2498
  // const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
2483
2499
  // let getQuery = '';
2484
2500
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
2485
-
2486
- 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);
2487
2503
  // this.props.templatesActions.setEdmTemplate(data);
2488
2504
  this.toggleEdmEmailTemplateSelection();
2489
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
@@ -0,0 +1,92 @@
1
+ @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
+
3
+ .selected-server-name{
4
+ margin-top: $CAP_SPACE_16;
5
+ .server-avtar, .server-name, .server-change{
6
+ display: inline-block;
7
+ }
8
+ .server-change{
9
+ margin-left: $CAP_SPACE_24;
10
+ }
11
+ }
12
+ .select-server{
13
+ display: inline-block;
14
+ }
15
+ .configure-csv-container{
16
+ margin-top: $CAP_SPACE_32;
17
+ .configure-csv, .add-column{
18
+ display: inline-block;
19
+ }
20
+ }
21
+ .column-selection-container{
22
+ width: 200px;
23
+ display: inline-block;
24
+ margin: $CAP_SPACE_04;
25
+ }
26
+ .column-selection-container-cid{
27
+ width: 120px;
28
+ display: inline-block;
29
+ }
30
+ .select-csv-column{
31
+ width: 80%;
32
+ border: 1px solid #d9d9d9 !important;
33
+ border-radius: 4px !important;
34
+ display: inline-block;
35
+ }
36
+ .select-csv-col-dropdown ul{
37
+ padding: 0 $CAP_SPACE_04;
38
+ }
39
+ .select-csv-col-dropdown ul li{
40
+ margin: $CAP_SPACE_08 0 !important;
41
+ padding: 0;
42
+ white-space: nowrap;
43
+ list-style: none;
44
+ outline: 0;
45
+ }
46
+ .select-csv-col-dropdown {
47
+ .ant-select-tree-switcher-noop, .ant-select-tree-node-content-wrapper{
48
+ display: inline-block !important;
49
+ margin: 0 !important;
50
+ }
51
+ .ant-select-tree-child-tree-open {
52
+ display: block !important;
53
+ padding: 0 0 0 $CAP_SPACE_16 !important;
54
+ }
55
+ }
56
+ .remove-csv-column{
57
+ display: inline-block;
58
+ margin-left: $CAP_SPACE_08;
59
+ }
60
+ .scrollable-section{
61
+ height: calc(100vh - 220px);
62
+ overflow-y: auto;
63
+ }
64
+ .FTP-tagList {
65
+ position: absolute;
66
+ right: 0;
67
+ top: -10px;
68
+ }
69
+ .ftp-message-container{
70
+ margin-top: $CAP_SPACE_32;
71
+ .message-content-title{
72
+ margin-top: $CAP_SPACE_24;
73
+ position: relative;
74
+ }
75
+ }
76
+
77
+ .ftp-preview-container{
78
+ .ftp-preview-message-title{
79
+ margin-top: $CAP_SPACE_16;
80
+ }
81
+ .ftp-preview-message-content{
82
+ max-width: 450px;
83
+ margin-top: 4px;
84
+ color: $FONT_COLOR_02;
85
+ }
86
+ .ftp-preview-data-title{
87
+ margin-top: $CAP_SPACE_40;
88
+ }
89
+ .ftp-preview-data-col-container{
90
+ margin-top: $CAP_SPACE_16;
91
+ }
92
+ }
@@ -0,0 +1,7 @@
1
+ import * as types from './constants';
2
+
3
+ export function getFTPServers() {
4
+ return {
5
+ type: types.GET_FTP_SERVERS_REQUEST,
6
+ };
7
+ }
@@ -0,0 +1,3 @@
1
+ export const GET_FTP_SERVERS_REQUEST = 'app/v2Containers/FTP/GET_FTP_SERVERS_REQUEST';
2
+ export const GET_FTP_SERVERS_SUCCESS = 'app/v2Containers/FTP/GET_FTP_SERVERS_SUCCESS';
3
+ export const GET_FTP_SERVERS_FAILURE = 'app/v2Containers/FTP/GET_FTP_SERVERS_FAILURE';