@capillarytech/creatives-library 2.0.26 → 2.0.27

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.
@@ -32,7 +32,6 @@ import EmailPreview from '../../components/EmailPreview';
32
32
  import ImagePreview from '../../components/ImagePreview';
33
33
  import CardGrid from '../../components/CardGrid';
34
34
  import Pagination from '../../components/Pagination';
35
- const BreadcrumbItem = Breadcrumb.Item;
36
35
 
37
36
  export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
38
37
  constructor(props) {
@@ -685,8 +684,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
685
684
  }
686
685
 
687
686
  componentWillMount() {
688
- console.log('new log 2');
689
- console.log('Dark KNight', this.props.Templates, this.props.Email, this.props.Global, this.supportedLanguages);
690
687
  const formData = this.initFormData(this.props, true); //_.cloneDeep(this.state.formData);
691
688
  const isEmpty = _.isEmpty(formData);
692
689
  if (!isEmpty) {
@@ -702,7 +699,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
702
699
  value: 'New Version',
703
700
  },
704
701
  ];
705
- // console.log('New Form Data Preparing ', this.initFormData());
702
+ //
706
703
  formData['template-version'] = "version 1";
707
704
  }
708
705
  // const formData = _.cloneDeep(this.state.formData);
@@ -729,7 +726,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
729
726
  this.props.actions.getCmsSetting('edm', this.props.Templates.edmTemplate.versions.base.drag_drop_id, 'create', undefined, isEdmSupport);
730
727
  }
731
728
  }
732
- console.log('Form Data ', formData);
729
+
733
730
  this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData}, () => {
734
731
  // this.injectEvents(this.state.schema);
735
732
  });
@@ -741,7 +738,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
741
738
  }
742
739
 
743
740
  componentDidMount() {
744
- console.log('email container mounted');
745
741
  const query = {
746
742
  layout: 'EMAIL',
747
743
  type: 'LAYOUT',
@@ -754,18 +750,16 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
754
750
  }
755
751
 
756
752
  componentWillReceiveProps(nextProps) {
757
- console.log('setting new language Next Props email', nextProps, this.state);
758
753
  // if (this.props.location.query.type === 'embedded') {
759
754
  // this.showNext();
760
755
  // }
761
756
 
762
757
  if (this.state.languageDataSet && nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && !_.isEqual(this.props.Templates.selectedEmailLayout, nextProps.Templates.selectedEmailLayout )) {
763
- console.log('setting new language content props', nextProps.Templates.selectedEmailLayout);
764
758
  this.setNewLanguageContent(nextProps.Templates.selectedEmailLayout);
765
759
  }
766
760
  if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
767
761
  const newSchema = this.injectEvents(nextProps.metaEntities.layouts[0].definition);
768
- console.log('Schema test 1 ', newSchema);
762
+
769
763
  this.setState({schema: newSchema});
770
764
  if (this.props.location.query.module !== 'library' || (this.props.location.query.module === 'library' && this.props.getDefaultTags)) {
771
765
  const query = {
@@ -797,7 +791,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
797
791
  value: 'New Version',
798
792
  },
799
793
  ];
800
- // console.log('New Form Data Preparing ', this.initFormData());
794
+ //
801
795
  formData['template-version'] = "version 1";
802
796
  //const that = this;
803
797
  this.setState({formData}, () => {
@@ -810,7 +804,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
810
804
  // this.injectEvents(this.state.schema);
811
805
  const baseLanguage = nextProps.Global.currentOrgDetails.basic_details.base_language;
812
806
  if (this.state.formData[`${this.state.currentTab - 1}`] && _.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages)) {
813
- console.log('Language Empty ', this.state.formData);
814
807
  const formData = _.cloneDeep(this.state.formData);
815
808
  formData[`${this.state.currentTab - 1}`].selectedLanguages = [];
816
809
  formData[`${this.state.currentTab - 1}`].selectedLanguages.push(baseLanguage);
@@ -821,7 +814,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
821
814
 
822
815
  if (!_.isEmpty(this.state.schema)) {
823
816
  const schema = _.cloneDeep(this.state.schema);
824
- console.log('Schema test 2', schema);
817
+
825
818
  const formData = _.cloneDeep(this.state.formData);
826
819
  const container = schema.containers[0];
827
820
  // const baseLanguage = this.props.Global.currentOrgDetails.basic_details.base_language;
@@ -833,7 +826,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
833
826
  this.setState({schema});
834
827
  }
835
828
 
836
- // console.log('isTagLoaded', this.isTagLoaded);
829
+ //
837
830
  // if (!this.isTagLoaded) {
838
831
  // this.isTagLoaded = true;
839
832
  // const query = {
@@ -846,7 +839,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
846
839
  // }
847
840
 
848
841
  if (this.state.isEdit && !this.state.editDataSet && !_.isEmpty(nextProps.Email.templateDetails) && !_.isEmpty(this.state.schema)) {
849
- console.log('setting edit data in email', nextProps.Email.templateDetails);
850
842
  this.setState({editDataSet: true}, () => {
851
843
  this.setEditData(nextProps.Email.templateDetails);
852
844
  });
@@ -861,12 +853,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
861
853
  if (!_.isEmpty(nextProps.Email.CmsSettings) && !_.isEqual(this.props.Email.CmsSettings, nextProps.Email.CmsSettings)) {
862
854
  const apiLangId = nextProps.Email.CmsSettings.langId;
863
855
  const langId = nextProps.Email.CmsSettings.langId !== "undefined" ? nextProps.Email.CmsSettings.langId : nextProps.Global.currentOrgDetails.basic_details.base_language;
864
- console.log('Got src', this.state.currentTab, nextProps.Email.CmsSettings, langId, nextProps.Global.currentOrgDetails.basic_details.base_language);
856
+
865
857
  const formData = _.cloneDeep(this.state.formData);
866
858
 
867
859
  const schema = _.cloneDeep(this.state.schema);
868
860
  const langIndex = formData[this.state.currentTab - 1].selectedLanguages.indexOf(langId);
869
- console.log('edm trying to set data', langIndex, langId, formData[this.state.currentTab - 1].activeTab, apiLangId);
861
+
870
862
  const temp = schema.containers[this.state.currentTab - 1];
871
863
  if (baseLanguage === langId && (apiLangId === "undefined" || apiLangId === formData[this.state.currentTab - 1].activeTab)) {
872
864
  temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: "none"};
@@ -885,14 +877,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
885
877
  }
886
878
  _.forEach(temp.panes, (pane, index) => {
887
879
  const tempPane = pane;
888
- // console.log('edm trying to set data', index, langIndex, tempPane);
880
+ //
889
881
  if (parseInt(index, 10) === parseInt(langIndex, 10)) {
890
- // console.log('edm trying to set data done', index, langIndex, tempPane);
882
+ //
891
883
  tempPane.sections[0].inputFields[0].cols[1].colStyle = {display: ""};
892
884
  tempPane.sections[0].inputFields[0].cols[0].colStyle = {display: "none"};
893
885
  }
894
886
  });
895
- console.log('Schema test 3', schema);
887
+
896
888
  this.setState({schema, isSchemaChanged: true});
897
889
  } else {
898
890
  _.forEach(temp.panes, (pane, index) => {
@@ -902,21 +894,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
902
894
  tempPane.sections[0].inputFields[0].cols[0].colStyle = {display: ""};
903
895
  }
904
896
  });
905
- console.log('Schema test 4', schema);
897
+
906
898
  this.setState({schema, isSchemaChanged: true});
907
899
  let html = decodeURIComponent(nextProps.Email.CmsSettings.htmlContent);
908
- console.log('Before ', html, nextProps.Email.CmsSettings.htmlContent);
900
+
909
901
  html = html.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/\\&quot;/g, '"');
910
- console.log('html content ', html);
902
+
911
903
  formData[this.state.currentTab - 1][langId]["template-content"] = html;
912
904
  if (window.CKEDITOR && apiLangId !== "undefined") {
913
905
  const instanceName = `template-content${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`;
914
- console.log('email switch data name', instanceName);
906
+
915
907
  _.forEach(window.CKEDITOR.instances, (winInstance) => {
916
908
  const tempInstance = winInstance;
917
- console.log('email switch data instance', winInstance, winInstance.name);
909
+
918
910
  if (winInstance.name === instanceName) {
919
- console.log('setting instance name after loading', winInstance, name);
920
911
  tempInstance.setData(html);
921
912
  } else if (winInstance.name.indexOf('editor') !== -1) {
922
913
  tempInstance.setData(html);
@@ -956,7 +947,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
956
947
  if (!nextProps.Email.fetchingCmsData && !_.isEqual(nextProps.Email.cmsData, this.props.Email.cmsData)) {
957
948
  const formData = _.cloneDeep(this.state.formData);
958
949
  if (nextProps.Email.langId && nextProps.Email.langId !== 'undefined') {
959
- console.log('setting template content', nextProps.Email.cmsData, decodeURIComponent(nextProps.Email.cmsData));
960
950
  const langId = nextProps.Email.langId;
961
951
  formData[`${this.state.currentTab - 1}`][langId]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
962
952
  if (formData[`${this.state.currentTab - 1}`].base) {
@@ -969,15 +959,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
969
959
  formData.base[formData.base.activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
970
960
  }
971
961
  } else {
972
- console.log('email switch data ', this.state.currentTab, formData, formData[`${this.state.currentTab - 1}`].activeTab);
973
962
  const langIndex = formData[this.state.currentTab - 1].selectedLanguages.indexOf(formData[this.state.currentTab - 1].activeTab);
974
963
  const instanceName = `template-content${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`;
975
- console.log('email switch data name', instanceName);
964
+
976
965
  _.forEach(window.CKEDITOR.instances, (winInstance) => {
977
966
  const temp = winInstance;
978
- console.log('email switch data instance', winInstance, winInstance.name);
967
+
979
968
  if (winInstance.name === instanceName) {
980
- console.log('setting instance name after loading', winInstance, name);
981
969
  temp.setData(decodeURIComponent(nextProps.Email.cmsData));
982
970
  } else if (winInstance.name.indexOf('editor') !== -1) {
983
971
  temp.setData(decodeURIComponent(nextProps.Email.cmsData));
@@ -993,9 +981,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
993
981
  formData.base[formData.base.activeTab].drag_drop_id = "";
994
982
  delete formData.base[formData.base.activeTab].edmeditorsrc;
995
983
  }
996
- console.log('ckeditor trying to set ckeditor data');
997
984
  }
998
- console.log('setting template content final', formData);
985
+
999
986
  this.setState({ formData }, () => {
1000
987
  if (nextProps.Email.langId) {
1001
988
  this.shouldStartValidation();
@@ -1010,7 +997,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1010
997
  delete injectedTags["Store custom fields"];
1011
998
  delete injectedTags["Transaction custom fields"];
1012
999
  injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
1013
- console.log('new injected tags', nextProps.metaEntities.tags.custom);
1000
+
1014
1001
  if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
1015
1002
  delete injectedTags["Registration custom fields"];
1016
1003
  }
@@ -1025,11 +1012,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1025
1012
  }
1026
1013
 
1027
1014
  if ( !_.isEqual(nextProps.Email.uploadAssetSuccess, this.props.Email.uploadAssetSuccess) && nextProps.Email.uploadAssetSuccess) {
1028
- console.log('Post on will receive props');
1029
1015
  const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
1030
1016
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1031
1017
  if (isDragDrop && isEdmSupport) {
1032
- console.log('Handle EDM ', this.edmEvent, JSON.parse(this.edmEvent.data)._dynId, nextProps.Email.uploadedAssetData.metaInfo.secure_file_path);
1033
1018
  const evtData = JSON.parse(this.edmEvent.data);
1034
1019
  if (evtData.action === 'editBackground') {
1035
1020
  this.edmEvent.source.postMessage(JSON.stringify({
@@ -1076,14 +1061,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1076
1061
  }
1077
1062
 
1078
1063
  componentWillUnmount() {
1079
- console.log('removed listener create');
1080
1064
  this.resetStateValue();
1081
1065
  window.removeEventListener("message", this.handleFrameTasks);
1082
1066
  this.props.actions.clearStoreValues();
1083
1067
  }
1084
1068
 
1085
1069
  onFormDataChange = (formData, tabCount, currentTab) => {
1086
- console.log('Form data changed is ', formData, tabCount, currentTab);
1087
1070
  // this.transformFormData(formData);
1088
1071
  this.setState({formData, tabCount, isSchemaChanged: false});
1089
1072
  if (currentTab) {
@@ -1094,17 +1077,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1094
1077
 
1095
1078
  onChange = (evt) => {
1096
1079
  const formData = _.cloneDeep(this.state.formData);
1097
- console.log('oncontentchange onChange ', evt, evt.editor.getData());
1080
+
1098
1081
  //if (evt.editor.name.indexOf('editor') === -1) {
1099
1082
  // _.forEach(window.CKEDITOR.instances, (winInstance) => {
1100
1083
  // const temp = winInstance;
1101
1084
  // if (winInstance.name === evt.editor.name) {
1102
- // console.log('setting instance name after loading', winInstance, name);
1085
+ //
1103
1086
  // setTimeout(() => {
1104
1087
  // //temp.name = id;
1105
1088
  // }, 1000);
1106
1089
  // //temp.name = id;
1107
- // console.log('setting instance name after loading 2', winInstance, name);
1090
+ //
1108
1091
  // }
1109
1092
  // });
1110
1093
  //}
@@ -1113,19 +1096,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1113
1096
  if (formData[`${this.state.currentTab - 1}`].tabKey === formData.base.tabKey) {
1114
1097
  formData.base[formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = _.cloneDeep(evt.editor.getData());
1115
1098
  }
1116
- console.log("Modified Form Data ", formData);
1099
+
1117
1100
  this.setState({formData, content: evt.editor.getData()}, () => {
1118
- console.log('Dark Knight ', this.state.content);
1101
+
1119
1102
  });
1120
1103
  }
1121
1104
  }
1122
1105
 
1123
- onBlur = (evt) => {
1124
- console.log("onBlur fired with event info: ", evt);
1125
- }
1126
-
1127
1106
  onTabChange(data, formData) {
1128
- console.log('inside parent ontabchange', data, this.state);
1129
1107
  //this.resetCkEditorInstance(data, formData);
1130
1108
  const schema = _.cloneDeep(this.state.schema);
1131
1109
  const container = schema.containers[`${data - 1}`];
@@ -1146,15 +1124,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1146
1124
  }
1147
1125
 
1148
1126
  onTemplateNameChange = (name) => {
1149
- console.log('Template name changed to ', name);
1127
+
1150
1128
  }
1151
1129
 
1152
1130
  onTagSelect = (data, currentTab, value) => {
1153
- console.log('On Tag selection ', data, currentTab, value);
1154
1131
  const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
1155
1132
  const formData = _.cloneDeep(this.state.formData);
1156
1133
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1157
- console.log('isEdmsupport', isEdmSupport);
1134
+
1158
1135
  if (isDragDrop && isEdmSupport) {
1159
1136
  const msg = {
1160
1137
  action: "InsertToCursor",
@@ -1166,14 +1143,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1166
1143
  const win = document.getElementById(`edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`).contentWindow;
1167
1144
  win.postMessage(msgString, '*');
1168
1145
  } else {
1169
- console.log('tag', this.state, this.state.editorInstanse);
1170
1146
  this.state.editorInstanse.insertHtml(`{{${data}}}`);
1171
1147
  //this.resetCkEditorInstance(currentTab, formData, true, data);
1172
1148
  }
1173
1149
  }
1174
1150
 
1175
1151
  onImageSelect = (data) => {
1176
- console.log('Calling', data);
1177
1152
  this.setState({ showImageSelectionBox: true }, () => {
1178
1153
  const params = {
1179
1154
  name: this.state.searchText,
@@ -1185,13 +1160,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1185
1160
  }
1186
1161
 
1187
1162
  getValidationData = () => {
1188
- console.log('all data save getting validation data');
1189
1163
  const that = this;
1190
1164
  const formData = _.cloneDeep(this.state.formData);
1191
1165
  _.forEach(formData, (val, index) => {
1192
1166
  if (!isNaN(index)) {
1193
1167
  _.forEach(val.selectedLanguages, (language) => {
1194
- console.log('all data save language', language, val[language]);
1195
1168
  if (val[language].is_drag_drop) {
1196
1169
  that.props.actions.getCmsData('edm', val[language].drag_drop_id, language);
1197
1170
  }
@@ -1205,7 +1178,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1205
1178
  const formData = _.cloneDeep(this.state.formData);
1206
1179
  const currentTab = this.state.currentTab - 1;
1207
1180
  // const schema = _.cloneDeep(this.state.schema);
1208
- console.log('Setting new language content', formData, this.state.settingLanguage);
1181
+
1209
1182
  const currentTabData = formData[currentTab][this.state.settingLanguage.iso_code];
1210
1183
  currentTabData.is_drag_drop = false;
1211
1184
  currentTabData.drag_drop_id = "";
@@ -1216,12 +1189,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1216
1189
  delete currentTabData.edmeditorsrc;
1217
1190
  }
1218
1191
  formData[currentTab].selectedLanguages.push(newActiveTab);
1219
- console.log('setting new language content final', formData);
1192
+
1220
1193
  // this.setState({formData});
1221
1194
  // const container = schema.containers[this.state.currentTab - 1];
1222
1195
  // const temp = container;
1223
1196
  // const langTab = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(newActiveTab);
1224
- // console.log('switch language Tab ', langTab, this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages, this.state.formData[`${this.state.currentTab - 1}`].activeTab);
1197
+ //
1225
1198
  // temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
1226
1199
  // temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
1227
1200
  // temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: "none"};
@@ -1238,14 +1211,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1238
1211
  this.setState({getFormDataValue: value, gettingFormData: true}, () => {
1239
1212
  this.saveValidationData();
1240
1213
  });
1241
- // console.log('posting final result', this.state.formData);
1214
+ //
1242
1215
  // const response = {
1243
1216
  // action: "getFormData",
1244
1217
  // postAction: value || 'next',
1245
1218
  // value: this.transformFormData(this.state.formData),
1246
1219
  // validity: this.state.isFormValid,
1247
1220
  // };
1248
- // console.log('Get Data', response);
1221
+ //
1249
1222
  // this.setState({checkValidation: true});
1250
1223
  // if (e) {
1251
1224
  // e.source.postMessage(JSON.stringify(response), e.origin);
@@ -1258,7 +1231,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1258
1231
  }
1259
1232
 
1260
1233
  setEditData(editData) {
1261
- console.log('Edit Data is ', editData);
1262
1234
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1263
1235
  const formData = _.cloneDeep(this.state.formData);
1264
1236
 
@@ -1283,7 +1255,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1283
1255
  // containers[0].isActive = true;
1284
1256
  _.forEach(firstPane.sections, (section) => {
1285
1257
  let sect = _.cloneDeep(section);
1286
- console.log('trying to clone in add version', JSON.stringify(sect), index);
1258
+
1287
1259
  if (sect.type === 'col-label') {
1288
1260
  sect = this.cloneColLabel(sect, index, true);
1289
1261
  } else if (sect.type === 'multicols') {
@@ -1291,7 +1263,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1291
1263
  } else if (sect.type === 'parent') {
1292
1264
  sect = this.cloneParent(sect, index, true);
1293
1265
  }
1294
- console.log('returning section', sect);
1266
+
1295
1267
  sections.push(sect);
1296
1268
  return true;
1297
1269
  });
@@ -1299,7 +1271,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1299
1271
  containers[0].panes = [];
1300
1272
  containers[0].panes.push(firstPane);
1301
1273
  schema.containers.push(containers[0]);
1302
- console.log('Pane Version', containers);
1274
+
1303
1275
 
1304
1276
  // _.forEach(sections[0].inputFields[0].cols, (inputField) => {
1305
1277
  // if (this.map[inputField.id] === undefined) {
@@ -1327,21 +1299,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1327
1299
  }
1328
1300
  });
1329
1301
  if (data.constructor === Object) {
1330
- console.log("Edit Data ", data, 'Tab key ', editData.versions.base.tabKey, data.tabKey, index, schema.containers, formData);
1331
1302
  if (data.tabKey === editData.versions.base.tabKey) {
1332
1303
  tabKey = data.tabKey;
1333
1304
  schema.containers[index].isActive = true;
1334
1305
  formData['template-version'] = formData['template-version-options'][index].key;
1335
1306
  currentTab = index + 1;
1336
- console.log('Dummy Random Tabkey Found ', tabKey, index, schema.containers[index].isActive);
1337
1307
  } else {
1338
1308
  schema.containers[index].isActive = false;
1339
- console.log('Dummy Random ', schema.containers[index].isActive, index);
1340
1309
  }
1341
1310
  // const isLanguageSupport = this.props.location.query.isLanguageSupport;
1342
- console.log('Schema Test ', schema, schema.containers[index]);
1311
+
1343
1312
  _.forEach(data.selectedLanguages, (lang, langIndex) => {
1344
- console.log('Language ', lang, langIndex);
1345
1313
  if ((type !== 'embedded' || (type === 'embedded' && isLanguageSupport === 'true')) && lang !== this.props.Global.currentOrgDetails.basic_details.base_language) {
1346
1314
  const tabContent = _.cloneDeep(containers[0].tabContent.sections[0]);
1347
1315
  const tabContentSection = tabContent.inputFields[0].cols[0];
@@ -1350,7 +1318,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1350
1318
  const sections = [];
1351
1319
  _.forEach(firstPane.sections, (section) => {
1352
1320
  let sect = _.cloneDeep(section);
1353
- console.log('trying to clone in add version', JSON.stringify(sect), tabIndex);
1321
+
1354
1322
  if (sect.type === 'col-label') {
1355
1323
  sect = this.cloneColLabel(sect, (langIndex + 1));
1356
1324
  } else if (sect.type === 'multicols') {
@@ -1358,21 +1326,21 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1358
1326
  } else if (sect.type === 'parent') {
1359
1327
  sect = this.cloneParent(sect, (langIndex + 1));
1360
1328
  }
1361
- console.log('returning section', sect);
1329
+
1362
1330
  sections.push(sect);
1363
1331
  return true;
1364
1332
  });
1365
- // console.log('tabContent.inputFields[0].cols[0]', tabContentSection, this.state.currentTab);
1366
- console.log('Testing language', this.map[tabContentSection.id], tabContentSection.id, data, lang);
1333
+ //
1334
+
1367
1335
  this.map[`template-content${data.selectedLanguages.indexOf(lang) + 1}`] = this.map['template-content'];
1368
1336
  tabContentSection.id = `${tabContentSection.id}${index + 1}`;
1369
1337
  tabContentSection.value = `${data[lang].language}`;
1370
- console.log('cloned final sections', sections, tabContent);
1338
+
1371
1339
  firstPane.sections = sections;
1372
1340
  firstPane.sectionsHeaders = [tabContent];
1373
- console.log('firstPane final version', JSON.stringify(firstPane));
1341
+
1374
1342
  // panes.push(firstPane);
1375
- console.log('initial panes', JSON.stringify(this.state.schema.containers));
1343
+
1376
1344
  schema.containers[index].panes.push(firstPane);
1377
1345
  } else if (lang !== this.props.Global.currentOrgDetails.basic_details.base_language) {
1378
1346
  delete data[lang];
@@ -1393,9 +1361,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1393
1361
  }
1394
1362
  });
1395
1363
 
1396
- console.log('Edit Form Data ', formData, schema);
1364
+
1397
1365
  this.setState({ formData, schema, tabKey, currentTab, tabCount: editData.versions.history.length }, () => {
1398
- console.log('Form Data Set ', this.state.formData);
1399
1366
  _.forEach((editData.versions.base.selectedLanguages), (language) => {
1400
1367
  // if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
1401
1368
  // formData[this.state.currentTab - 1].activeTab = language;
@@ -1404,23 +1371,18 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1404
1371
  // formData.base.activeTab = language;
1405
1372
  // }
1406
1373
  if (language && editData.versions.base[language].is_drag_drop) {
1407
- console.log('making edm calls again');
1408
1374
  this.props.actions.getCmsSetting('edm', editData.versions.base[language].drag_drop_id, 'open', language, isEdmSupport);
1409
1375
  }
1410
1376
  });
1411
- console.log('final form data edit', formData);
1377
+
1412
1378
  // this.resetCkEditorInstance(this.state.currentTab - 1, formData);
1413
1379
  // this.setState({formData});
1414
1380
  });
1415
1381
  }
1416
1382
 
1417
- getMappedEvent = (id, event) => {
1418
- console.log('Map ', this.map, id, event);
1419
- return this.map[id][event];
1420
- }
1383
+ getMappedEvent = (id, event) => this.map[id][event]
1421
1384
 
1422
1385
  getCurrentWindow = (e) => {
1423
- console.log('in email create', e);
1424
1386
  const response = {
1425
1387
  action: e.action,
1426
1388
  value: 'edit',
@@ -1429,12 +1391,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1429
1391
  parent.postMessage(JSON.stringify(response), '*');
1430
1392
  }
1431
1393
 
1432
- getEditorInstanse = (instance, id) => {
1433
- console.log('Got editor Instance ', instance, id);
1394
+ getEditorInstanse = () => {
1434
1395
  window.CKEDITOR.on( 'instanceReady', ( event ) => {
1435
1396
  this.setState({editorInstanse: event.editor});
1436
1397
  event.editor.on( 'focus', () => {
1437
- console.log( 'focused', event.editor, this );
1438
1398
  this.setState({editorInstanse: event.editor});
1439
1399
  });
1440
1400
  });
@@ -1479,9 +1439,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1479
1439
 
1480
1440
  shouldStartValidation = () => {
1481
1441
  this.setState((prevState) => ({ cmsDataCount: prevState.cmsDataCount + 1}), () => {
1482
- console.log('all data save count validating', this.state.saveCount, this.state.cmsDataCount);
1483
1442
  if (this.state.targetSaveCount === this.state.cmsDataCount) {
1484
- console.log('validation final starting edm validation');
1485
1443
  this.setState({startValidation: true});
1486
1444
  }
1487
1445
  });
@@ -1497,7 +1455,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1497
1455
  if (!isNaN(index)) {
1498
1456
  _.forEach(newdata.selectedLanguages, (language) => {
1499
1457
  if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
1500
- console.log('all data 4');
1501
1458
  saveCount += 1;
1502
1459
  }
1503
1460
  });
@@ -1511,7 +1468,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1511
1468
  const data = this.state.formData[this.state.currentTab - 1];
1512
1469
  _.forEach(data.selectedLanguages, (language, langIndex) => {
1513
1470
  if (data[language].is_drag_drop) {
1514
- console.log('saving edm template', document.getElementById("edmeditor"), `edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`);
1515
1471
  const win = document.getElementById(`edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`).contentWindow;
1516
1472
  win.postMessage("saveProject", '*');
1517
1473
  }
@@ -1550,7 +1506,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1550
1506
  showEdmEmailTemplates: false,
1551
1507
  editDataSet: false,
1552
1508
  }, () => {
1553
- console.log('Unmount value cleared', this.state);
1509
+
1554
1510
  });
1555
1511
  }
1556
1512
 
@@ -1558,10 +1514,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1558
1514
  const currentLang = formData[`${data - 1}`].selectedLanguages.indexOf(formData[`${data - 1}`].activeTab);
1559
1515
  const langIndex = formData[`${data - 1}`].selectedLanguages.indexOf(formData[`${data - 1}`].activeTab);
1560
1516
  let instance1 = window.CKEDITOR.instances[`editor${currentLang + 1}`];
1561
- const instanceCount = 0;
1562
1517
  const instanceArray = [];
1563
- _.forEach(window.CKEDITOR.instances, (instance, index) => {
1564
- console.log('all ck instances ', instance, index, instanceCount, langIndex);
1518
+ _.forEach(window.CKEDITOR.instances, (instance ) => {
1565
1519
  const name = instance.name;
1566
1520
  if (instance.status === "destroyed") {
1567
1521
  return;
@@ -1582,7 +1536,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1582
1536
  instanceArray.push(obj);
1583
1537
  }
1584
1538
  });
1585
- console.log('sorted instance array before sort', instanceArray);
1539
+
1586
1540
  instanceArray.sort( (a, b) => {
1587
1541
  const idxA = a.idx;
1588
1542
  const idxB = b.idx;
@@ -1593,11 +1547,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1593
1547
  }
1594
1548
  return 0;
1595
1549
  });
1596
- console.log('sorted instance array after sort', instanceArray);
1550
+
1597
1551
  //instanceCount += 1;
1598
1552
  // if (instanceIdx === langIndex) {
1599
1553
  const instance = instanceArray[langIndex].instance;
1600
- console.log('setting instance as ', instance, instance.name);
1554
+
1601
1555
  instance1 = instance;
1602
1556
  this.setState({editorInstanse: instance1}, () => {
1603
1557
  if (onInsert && !isImage) {
@@ -1609,13 +1563,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1609
1563
  }
1610
1564
 
1611
1565
  uploadFile = () => {
1612
- console.log('uploadFile');
1613
1566
  document.getElementById('filename').click();
1614
- console.log('Upload File initiated');
1615
1567
  };
1616
1568
 
1617
1569
  useEditor = () => {
1618
- console.log('useEditor');
1619
1570
  //this.toggleEdmEmailTemplateSelection();
1620
1571
  this.setState({addLanguageType: "useEditor"}, () => {
1621
1572
  this.setState({showModal: false}, () => {
@@ -1626,7 +1577,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1626
1577
 
1627
1578
  copyPrimaryLanguage = () => {
1628
1579
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
1629
- console.log('copy primary language');
1580
+
1630
1581
  this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
1631
1582
  this.setState({showModal: false});
1632
1583
  const formData = _.cloneDeep(this.state.formData);
@@ -1644,16 +1595,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1644
1595
  }
1645
1596
  const fileExtension = files[0].name.split('.').pop();
1646
1597
  const supportedZipFormats = ['zip'];
1647
- console.log('File Params ', fileExtension);
1598
+
1648
1599
  if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
1649
1600
  this.setState({ addLanguageType: "upload"}, () => {
1650
- console.log('Zip Format got');
1651
1601
  this.props.templatesActions.handleZipUpload(files[0]);
1652
1602
  document.getElementById("filename").value = "";
1653
1603
  this.setState({showModal: false});
1654
1604
  });
1655
1605
  } else if (fileExtension === 'html' || fileExtension === 'htm') {
1656
- console.log('html Format got');
1657
1606
  const reader = new FileReader();
1658
1607
  reader.onload = () => {
1659
1608
  this.setState({ addLanguageType: "upload"}, () => {
@@ -1666,7 +1615,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1666
1615
  reader.readAsText(files[0]);
1667
1616
  } else {
1668
1617
  alert('Invalid file type added! Please Give a proper zip/html file');
1669
- console.log('Invalid file type added! Please Give a proper zip/html file');
1670
1618
  }
1671
1619
  };
1672
1620
 
@@ -1743,20 +1691,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1743
1691
 
1744
1692
  deleteLanguage = (passedData, val) => {
1745
1693
  const formData = _.cloneDeep(passedData);
1746
- console.log('Delete Language ', formData, val);
1694
+
1747
1695
  const schema = _.cloneDeep(this.state.schema);
1748
1696
  schema.containers[this.state.currentTab - 1].panes.splice(val, 1);
1749
1697
  schema.containers[this.state.currentTab - 1].tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[2].cols[0].style = {display: "none"};
1750
1698
  //this.resetCkEditorInstance(this.state.currentTab, formData);
1751
1699
  this.setState({schema, formData, showModal: false});
1752
- console.log('Schema ', schema, formData, val);
1753
1700
  }
1754
1701
 
1755
1702
  initFormData(props, fromMount) {
1756
- console.log('init email', props, fromMount);
1757
1703
  let newFormData = {};
1758
1704
  if (props.Global.currentOrgDetails && props.Global.currentOrgDetails.basic_details) {
1759
- console.log('init email actual', props, fromMount);
1760
1705
  newFormData = {
1761
1706
  "0": {},
1762
1707
  "template-name": "",
@@ -1786,7 +1731,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1786
1731
  }
1787
1732
 
1788
1733
  transformFormData = (formData) => {
1789
- console.log('Transforming data ', formData);
1790
1734
  const newFormData = {
1791
1735
  base: {},
1792
1736
  secondary_templates: [],
@@ -1811,23 +1755,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1811
1755
  newFormData.base = _.cloneDeep(tmpData);
1812
1756
  }
1813
1757
  newFormData.secondary_templates.push({template_data: tmpData});
1814
- console.log('Tranforming data for embedded mode', tmpData);
1815
1758
  }
1816
1759
  });
1817
1760
  if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs" || this.props.location.query.module === "coupon_expiry" || this.props.location.query.module === "timeline" || this.props.location.query.module === "library")) {
1818
1761
  newFormData.base.subject = formData['template-subject'];
1819
1762
  }
1820
1763
 
1821
- console.log('This is test subject ', newFormData);
1764
+
1822
1765
  return newFormData;
1823
1766
  }
1824
1767
 
1825
1768
  handleFrameTasks = (e) => {
1826
- console.log('data listened to is', e.data);
1827
1769
  const type = this.isValidJson(e.data) ? JSON.parse(e.data) : e.data;
1828
- console.log('data type', typeof type);
1770
+
1829
1771
  if (typeof type === 'object') {
1830
- console.log('received something', type);
1831
1772
  const action = type.action;
1832
1773
  switch (action) {
1833
1774
  case "startTemplateCreation":
@@ -1836,14 +1777,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1836
1777
  case "edit":
1837
1778
  this.edmEvent = e;
1838
1779
  if (type.elementJson.type === "IMAGE") {
1839
- console.log('Data Inside ', type);
1840
1780
  this.onImageSelect();
1841
1781
  }
1842
1782
  break;
1843
1783
  case "editBackground":
1844
1784
  this.edmEvent = e;
1845
1785
  if (type.elementJson.type === "BOX" || type.elementJson.type === "BUTTON" || type.elementJson.type === "GENERAL") {
1846
- console.log('Data Inside ', type);
1847
1786
  this.onImageSelect();
1848
1787
  }
1849
1788
  break;
@@ -1866,21 +1805,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1866
1805
  break;
1867
1806
  }
1868
1807
  } else {
1869
- console.log('Else Type ', type);
1870
1808
  switch (type) {
1871
1809
  case "getFormData":
1872
1810
  this.getFormData(e);
1873
1811
  break;
1874
1812
  case "startTemplateCreation":
1875
- console.log('Starting to create template');
1813
+
1876
1814
  //this.getFormData(e);
1877
1815
  break;
1878
1816
  case "moveToTemplates":
1879
- console.log('moving to templates');
1817
+
1880
1818
  this.moveToTemplates();
1881
1819
  break;
1882
1820
  case "validateContent":
1883
- console.log('validating Content');
1821
+
1884
1822
  this.validateContent(e);
1885
1823
  break;
1886
1824
  case "Save result: success":
@@ -1905,10 +1843,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1905
1843
  }
1906
1844
 
1907
1845
  handleEdmSave = () => {
1908
- console.log('all data save', this.state.mode, this.state.targetSaveCount, this.state.saveCount);
1909
1846
  if (this.state.mode === "save") {
1910
1847
  this.setState((prevState) => ({ saveCount: prevState.saveCount + 1}), () => {
1911
- console.log('all data save count', this.state.saveCount);
1912
1848
  if (this.state.targetSaveCount === this.state.saveCount) {
1913
1849
  if (this.state.saveEdmDataMode === 'validation') {
1914
1850
  this.getValidationData();
@@ -1926,14 +1862,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1926
1862
  if (parseInt(index, 10) === (this.state.currentTab - 1)) {
1927
1863
  const temp = container;
1928
1864
  const langTab = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(formData[`${this.state.currentTab - 1}`].activeTab);
1929
- console.log('switch language Tab ', langTab, formData[`${this.state.currentTab - 1}`].selectedLanguages, formData[`${this.state.currentTab - 1}`].activeTab);
1865
+
1930
1866
  temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
1931
1867
  temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
1932
1868
  temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: "none"};
1933
1869
  }
1934
1870
  });
1935
1871
  schema = this.showInsertImageButton(schema);
1936
- console.log('Handle OK ', schema);
1872
+
1937
1873
  this.setState({ schema, showConfirmationModal: false, isSchemaChanged: true }, () => {
1938
1874
  this.injectEvents(schema);
1939
1875
  });
@@ -1946,20 +1882,18 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1946
1882
  }
1947
1883
 
1948
1884
  handleContentChange = (data) => {
1949
- console.log('CKEditor Data changed ', data);
1950
1885
  const formData = _.cloneDeep(this.state.formData);
1951
1886
  formData[this.state.currentTab][formData[this.state.currentTab - 1].activeTab]["template-content"] = data;
1952
1887
  this.setState({formData});
1953
1888
  }
1954
1889
 
1955
1890
  handleOnHoverItem = (isHovering, id) => {
1956
- console.log('Card Howering ', isHovering, id);
1957
1891
  if (!isHovering) {
1958
1892
  // const data = _.find(this.props.Email.assetList, {_id: id});
1959
- // console.log('Found Data ', data);
1893
+ //
1960
1894
  // if (data) {
1961
1895
  // if (this.state.isDragDrop) {
1962
- // console.log('Handle EDM ', isHovering, id);
1896
+ //
1963
1897
  // } else {
1964
1898
  // this.state.editorInstanse.insertHtml(`<img src='${data.metaInfo.public_url}' alt='Capillary Image'>`);
1965
1899
  // }
@@ -1987,7 +1921,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
1987
1921
  });
1988
1922
  }
1989
1923
  });
1990
- console.log('HandleEdmOption ', JSON.stringify(schema));
1924
+
1991
1925
  this.setState({schema, isSchemaChanged: true});
1992
1926
  }
1993
1927
 
@@ -2003,7 +1937,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2003
1937
  });
2004
1938
  }
2005
1939
  });
2006
- console.log('HandleHideMarkAsFinal ', JSON.stringify(schema));
1940
+
2007
1941
  this.setState({schema, isSchemaChanged: true});
2008
1942
  }
2009
1943
 
@@ -2020,15 +1954,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2020
1954
  }
2021
1955
 
2022
1956
  handleOnItemClick = (isSelected, id) => {
2023
- console.log('Dummy ', isSelected, id, event);
2024
1957
  const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
2025
1958
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
2026
1959
  if (isSelected) {
2027
1960
  const data = _.find(this.props.Email.assetList, {_id: id});
2028
- console.log('Found Data ', data, this.state.isDragDrop);
1961
+
2029
1962
  if (data) {
2030
1963
  if (isDragDrop && isEdmSupport) {
2031
- console.log('Handle EDM ', isSelected, id, this.edmEvent, JSON.parse(this.edmEvent.data)._dynId, data.metaInfo.secure_file_path);
2032
1964
  const evtData = JSON.parse(this.edmEvent.data);
2033
1965
  if (evtData.action === 'editBackground') {
2034
1966
  this.edmEvent.source.postMessage(JSON.stringify({
@@ -2087,15 +2019,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2087
2019
  }
2088
2020
 
2089
2021
  handleVersionSelect = (status, formData, val) => {
2090
- console.log('HandleVersion select', status, val);
2091
2022
  const newFormData = _.cloneDeep(this.state.formData);
2092
2023
  const schema = _.cloneDeep(this.state.schema);
2093
2024
  const versionIndex = _.findIndex(formData['template-version-options'], {key: status});
2094
2025
  newFormData['template-version'] = formData['template-version-options'][versionIndex].key;
2095
- console.log('Selected Version', status, formData, val, versionIndex);
2026
+
2096
2027
  const newContainers = [];
2097
2028
  _.forEach(schema.containers, (container, index) => {
2098
- console.log('Container Iteration ', container, index);
2099
2029
  const tmpContainer = _.cloneDeep(container);
2100
2030
  if (index === versionIndex) {
2101
2031
  tmpContainer.isActive = true;
@@ -2109,11 +2039,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2109
2039
  }
2110
2040
 
2111
2041
  afterPaste = (evt) => {
2112
- console.log("afterPaste fired with event info: ", evt);
2042
+
2113
2043
  }
2114
2044
 
2115
2045
  deleteVersion = (data, currentTab) => {
2116
- console.log('deleting version', data, currentTab);
2117
2046
  if (this.state.tabCount === 1 || currentTab === 1) {
2118
2047
  return;
2119
2048
  }
@@ -2124,38 +2053,35 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2124
2053
  delete formData[`${currentTab - 1}`];
2125
2054
  formData['template-version-options'].splice(`${currentTab - 1}`, 1);
2126
2055
  formData['template-version'] = formData['template-version-options'][0].value;
2127
- console.log('Current formData and Schema after delete', formData, schema);
2056
+
2128
2057
  this.setState({schema, tabCount: (this.state.tabCount - 1), currentTab: 1, isSchemaChanged: true, showModal: false});
2129
2058
  }
2130
2059
 
2131
2060
  switchEditor = () => {
2132
- console.log('Editor Switched');
2133
2061
  this.setState({showConfirmationModal: true});
2134
2062
  }
2135
2063
 
2136
2064
  renameVersion = (data, currentTab) => {
2137
- console.log('renaming version', data, currentTab);
2065
+
2138
2066
  }
2139
2067
 
2140
2068
  markFinalVersion = (data, currentTab) => {
2141
2069
  const message = getMessageObject('success', this.props.intl.formatMessage(messages["Template Marked as Final Successfully"]), true);
2142
2070
  this.props.globalActions.addMessageToQueue(message);
2143
- console.log('markFinal version', data, currentTab, this.state.schema);
2144
2071
  }
2145
2072
 
2146
- duplicateVersion = (formData, currentTab) => {
2147
- console.log('duplicate version', formData, currentTab);
2073
+ duplicateVersion = (formData) => {
2148
2074
  this.setState({formData}, () => {
2149
2075
  this.addVersion(this.state.tabCount);
2150
2076
  });
2151
2077
  }
2152
2078
 
2153
- addVersion = (data) => {
2079
+ addVersion = () => {
2154
2080
  if (this.state.schema.containers.length === 5) {
2155
2081
  alert('You cant have more that 5 versions');
2156
2082
  return;
2157
2083
  }
2158
- console.log('adding version', data, this.state.formData);
2084
+
2159
2085
  const schema = _.cloneDeep(this.state.schema);
2160
2086
  const tabIndex = schema.containers.length + 1; //data + 1;
2161
2087
  const formData = _.cloneDeep(this.state.formData);
@@ -2165,7 +2091,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2165
2091
  containers[0].isActive = true;
2166
2092
  _.forEach(firstPane.sections, (section) => {
2167
2093
  let sect = _.cloneDeep(section);
2168
- console.log('trying to clone in add version', JSON.stringify(sect), tabIndex);
2094
+
2169
2095
  if (sect.type === 'col-label') {
2170
2096
  sect = this.cloneColLabel(sect, tabIndex);
2171
2097
  } else if (sect.type === 'multicols') {
@@ -2173,7 +2099,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2173
2099
  } else if (sect.type === 'parent') {
2174
2100
  sect = this.cloneParent(sect, tabIndex);
2175
2101
  }
2176
- console.log('returning section', sect);
2102
+
2177
2103
  sections.push(sect);
2178
2104
  return true;
2179
2105
  });
@@ -2185,7 +2111,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2185
2111
  _.forEach(schema.containers, (container, index) => {
2186
2112
  schema.containers[index].isActive = ((index + 1) === this.state.currentTab);
2187
2113
  });
2188
- console.log('Pane ', containers);
2114
+
2189
2115
 
2190
2116
  _.forEach(sections[0].inputFields[0].cols, (inputField) => {
2191
2117
  if (this.map[inputField.id] === undefined) {
@@ -2215,9 +2141,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2215
2141
  addLanguage = (tempLang, passedData, val, asyncLanguages) => {
2216
2142
  if (this.state.addLanguageType === "upload") {
2217
2143
  this.setState({languageDataSet: true}, () => {
2218
- console.log('adding from add language 1', this.props.Templates);
2219
2144
  if (this.props.Templates.selectedEmailLayout && this.props.Templates.selectedEmailLayout !== '') {
2220
- console.log('adding from add language 2');
2221
2145
  this.setNewLanguageContent(this.props.Templates.selectedEmailLayout);
2222
2146
  }
2223
2147
  });
@@ -2244,7 +2168,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2244
2168
  }
2245
2169
  const selectedLanguage = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(data.iso_code);
2246
2170
  tabKey = formData[`${this.state.currentTab - 1}`][data.iso_code].tabKey;
2247
- console.log('adding language', data, formData, val, selectedLanguage, formData[`${this.state.currentTab - 1}`]);
2171
+
2248
2172
  const tabIndex = (selectedLanguage) + 1;
2249
2173
  const containers = schema.containers.slice();
2250
2174
  const tabContent = _.cloneDeep(containers[0].tabContent.sections[0]);
@@ -2254,7 +2178,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2254
2178
  const sections = [];
2255
2179
  _.forEach(firstPane.sections, (section) => {
2256
2180
  let sect = _.cloneDeep(section);
2257
- console.log('trying to clone in add version', JSON.stringify(sect), tabIndex);
2181
+
2258
2182
  if (sect.type === 'col-label') {
2259
2183
  sect = this.cloneColLabel(sect, tabIndex);
2260
2184
  } else if (sect.type === 'multicols') {
@@ -2262,14 +2186,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2262
2186
  } else if (sect.type === 'parent') {
2263
2187
  sect = this.cloneParent(sect, tabIndex);
2264
2188
  }
2265
- console.log('returning section', sect);
2189
+
2266
2190
  sections.push(sect);
2267
2191
  return true;
2268
2192
  });
2269
- console.log('tabContent.inputFields[0].cols[0]', tabContentSection, this.state.currentTab);
2193
+
2270
2194
  tabContentSection.id = `${tabContentSection.id}${tabIndex}`;
2271
2195
  tabContentSection.value = `${data.language}`;
2272
- console.log('cloned final sections', sections, tabContent);
2196
+
2273
2197
  _.forEach(sections[0].inputFields[0].cols, (inputField) => {
2274
2198
  if (this.map[inputField.id] === undefined) {
2275
2199
  if (inputField.id.indexOf('template-content') > -1) {
@@ -2281,17 +2205,16 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2281
2205
  });
2282
2206
  firstPane.sections = sections;
2283
2207
  firstPane.sectionsHeaders = [tabContent];
2284
- console.log('firstPane final version', JSON.stringify(firstPane));
2208
+
2285
2209
  // panes.push(firstPane);
2286
- console.log('initial panes', JSON.stringify(this.state.schema.containers));
2210
+
2287
2211
  schema.containers[`${this.state.currentTab - 1}`].panes.push(firstPane);
2288
2212
  // schema.containers[0].tabContent.sections.push(tabContent);
2289
- console.log('final schema after adding version', firstPane, schema);
2290
2213
  }
2291
2214
  //this.props.templatesActions.getEdmDefaultTemplates();
2292
2215
  const container = schema.containers[this.state.currentTab - 1];
2293
2216
  const temp = container;
2294
- console.log('switch language Tab ', langTab, formData[`${this.state.currentTab - 1}`].selectedLanguages, this.state.formData[`${this.state.currentTab - 1}`].activeTab);
2217
+
2295
2218
  if (this.state.addLanguageType === "upload") {
2296
2219
  temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
2297
2220
  temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
@@ -2315,14 +2238,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2315
2238
  }
2316
2239
 
2317
2240
  openPreviewMode = (selectedAsset) => {
2318
- console.log('Open Preview Mode', selectedAsset);
2319
2241
  const asset = selectedAsset;
2320
2242
  asset.showButtons = asset.showButtons ? !asset.showButtons : true;
2321
2243
  this.setState({selectedAsset: asset});
2322
2244
  }
2323
2245
 
2324
2246
  cloneParent = (section, tabIndex, noSuffix) => {
2325
- console.log('trying to clone', JSON.stringify(section), tabIndex);
2326
2247
  const parentsect = section;
2327
2248
  const childSectionsBeforeCloning = parentsect.childSections.slice();
2328
2249
  const childSections = [];
@@ -2335,18 +2256,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2335
2256
  } else if (childSection.type === 'parent') {
2336
2257
  sect = this.cloneParent(childSection, tabIndex, noSuffix);
2337
2258
  }
2338
- console.log('returning cloned parent section', sect);
2259
+
2339
2260
  childSections.push(sect);
2340
2261
  return true;
2341
2262
  });
2342
- console.log('returning cloned parent section final 1', JSON.stringify(childSections));
2263
+
2343
2264
  parentsect.childSections = childSections;
2344
- console.log('returning cloned parent section final', parentsect);
2265
+
2345
2266
  return _.cloneDeep(parentsect);
2346
2267
  }
2347
2268
 
2348
2269
  cloneColLabel = (sectionObj, tabIndex, noSuffix) => {
2349
- console.log('cloning cloneColLabel', sectionObj, tabIndex);
2350
2270
  const section = _.cloneDeep(sectionObj);
2351
2271
  const inputFields = _.forEach(section.inputFields, (inputField) => {
2352
2272
  const inputF = inputField;
@@ -2355,12 +2275,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2355
2275
  return inputF;
2356
2276
  });
2357
2277
  section.inputFields = inputFields;
2358
- console.log('cloned ifs are', section);
2278
+
2359
2279
  return section;
2360
2280
  }
2361
2281
 
2362
2282
  cloneMultiCol = (sectionObj, tabIndex, noSuffix) => {
2363
- console.log('cloning multicol ', sectionObj, tabIndex);
2364
2283
  const section = _.cloneDeep(sectionObj);
2365
2284
  const inputFields = _.forEach(section.inputFields, (inputField) => {
2366
2285
  const inputF = inputField;
@@ -2374,7 +2293,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2374
2293
  return inputF;
2375
2294
  });
2376
2295
  section.inputFields = inputFields;
2377
- console.log('cloned cols are', section);
2296
+
2378
2297
  return section;
2379
2298
  }
2380
2299
 
@@ -2396,7 +2315,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2396
2315
  }
2397
2316
 
2398
2317
  showNext = () => {
2399
- console.log("Inside ShowNext");
2400
2318
  const response = {
2401
2319
  action: "showNext",
2402
2320
  value: true,
@@ -2405,7 +2323,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2405
2323
  }
2406
2324
 
2407
2325
  moveToTemplates = () => {
2408
- console.log('in move to Templates');
2409
2326
  const modalContent = {
2410
2327
  title: "Alert",
2411
2328
  body: "Do you really want to go back? All your temporary changes will be lost!",
@@ -2432,7 +2349,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2432
2349
  }
2433
2350
 
2434
2351
  prepareImageData() {
2435
- console.log('Preparing Image Dataa ');
2436
2352
  const data = [];
2437
2353
  const assetList = this.props.Email.assetList;
2438
2354
  _.forEach(assetList, (asset) => {
@@ -2482,7 +2398,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2482
2398
 
2483
2399
  injectEvents = (schema) => {
2484
2400
  const type = this.props.location.query.type;
2485
- console.log('now injecting events');
2401
+
2486
2402
  const temp = schema;
2487
2403
  temp.standalone.sections = this.injectSections(temp.standalone.sections);
2488
2404
  _.forEach(temp.containers, (container) => {
@@ -2490,7 +2406,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2490
2406
  tempContainer = this.injectContainer(tempContainer);
2491
2407
  return tempContainer;
2492
2408
  });
2493
- console.log("Lang Test ", this.props.location.query.isLanguageSupport, (this.props.location.query.isLanguageSupport === false));
2409
+
2494
2410
  // if (type !== "embedded" || (type === "embedded" && (this.props.location.query.isLanguageSupport === "false" || (this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === "true")))) {
2495
2411
  const ifLangSupported = this.props.location.query.isLanguageSupport === "true" || type !== "embedded";
2496
2412
  _.forEach(temp.containers, (container) => {
@@ -2553,7 +2469,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2553
2469
  }
2554
2470
  });
2555
2471
  //}
2556
- console.log('final injected schema', schema);
2472
+
2557
2473
  this.setState({schema, isSchemaChanged: true}, () => {
2558
2474
  if (type === 'embedded') {
2559
2475
  this.removeStandAlone();
@@ -2572,7 +2488,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2572
2488
  }
2573
2489
 
2574
2490
  handleOnTagsContextChange = (data) => {
2575
- console.log('parent tags context', data);
2576
2491
  const query = {
2577
2492
  layout: 'EMAIL',
2578
2493
  type: 'TAG',
@@ -2633,7 +2548,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2633
2548
  }
2634
2549
 
2635
2550
  startTemplateCreation(data) {
2636
- console.log('startTemplatecreations', data);
2637
2551
  if (_.isEmpty(data)) {
2638
2552
  return;
2639
2553
  }
@@ -2641,9 +2555,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2641
2555
 
2642
2556
  //const data = {"base":{"subject":"deded","html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><img alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":false,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><img alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}],"edit":true,"tags":[]};
2643
2557
  // const data = {edit: true, "base":{"subject":"testsubject","html_content":"<html> <head> \t<meta charset=\"utf-8\" /> \t<title>Aster Secure</title> \t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><img class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":0,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<html>\r\n<head>\r\n\t<meta charset=\"utf-8\" />\r\n\t<title>Aster Secure</title>\r\n\t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t}\r\n\t</style>\r\n</head>\r\n<body>\r\n<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t<tbody>\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><img class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</tbody>\r\n</table>\r\n</body>\r\n</html>\r\n","secondary_template_id":"9584","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}, {"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><img alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You&#39;ve received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking &quot;View Report&quot; you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You&#39;ve received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":false,"language_name":"Hindi","language":"Hindi","lang_id":"151"},{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":1,"drag_drop_id":"55acf47048a85bbf7681a35a","scope":null,"tag":null,"is_default":null,"html_content":"","secondary_template_id":"9500","is_base_template":0,"language_name":"Japanese","language":"Japanese","lang_id":"100"}]};
2644
- console.log('Start template creation ', data, this.props.location.query.isLanguageSupport, this.props.location.query.type === 'embedded', this.props.location.query.type === 'embedded' && !this.props.location.query.isLanguageSupport);
2558
+
2645
2559
  if (data && data.edit) {
2646
- console.log('startTemplateCreation');
2647
2560
  // const formData = {'0': {}};
2648
2561
  const formData = _.cloneDeep(this.state.formData);
2649
2562
  formData[0].selectedLanguages = [];
@@ -2652,7 +2565,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2652
2565
  formData['template-subject'] = data.base.subject ? data.base.subject : '';
2653
2566
  const baseLanguage = this.props.Global.currentOrgDetails.basic_details.base_language;
2654
2567
  let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
2655
- console.log("startTemplatecreation before index", languageIndex, this.supportedLanguages, baseLanguage, formData);
2568
+
2656
2569
  if (languageIndex === -1) {
2657
2570
  languageIndex = 0;
2658
2571
  }
@@ -2668,11 +2581,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2668
2581
  formData[0][this.supportedLanguages[languageIndex].iso_code] = tempData;
2669
2582
  formData[0].activeTab = this.supportedLanguages[languageIndex].iso_code;
2670
2583
  tabKey = "2";
2671
- console.log("start Template creation midway data", formData, languageIndex);
2672
2584
  } else {
2673
2585
  const additionalLanguages = [];
2674
2586
  _.forEach(data.secondary_templates, (templates) => {
2675
- console.log('creating form data', templates);
2676
2587
  const id = "1";
2677
2588
  tabKey = id;
2678
2589
  let languageIndex = _.findIndex(this.supportedLanguages, {language: templates.language});
@@ -2692,7 +2603,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2692
2603
  }
2693
2604
  // formData.usingTabContainer = true;
2694
2605
  // formData.tabCount = 1;
2695
- console.log('Language Index ', languageIndex, this.supportedLanguages);
2606
+
2696
2607
  // formData[0].tabkey = "1";
2697
2608
  // formData[0] = {};
2698
2609
  // formData[0].activeTab = this.props.Global.currentOrgDetails.basic_details.base_language;
@@ -2709,7 +2620,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2709
2620
  this.addLanguage(false, formData, false, additionalLanguages);
2710
2621
  }
2711
2622
  formData.base = _.cloneDeep(formData[0]);
2712
- console.log('startTemplateCreation final ', formData);
2623
+
2713
2624
  this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
2714
2625
  // this.setState({tabKey: ''});
2715
2626
  _.forEach(formData[0].selectedLanguages, (language) => {
@@ -2724,7 +2635,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2724
2635
  }
2725
2636
 
2726
2637
  startLoading = (ifEdit) => {
2727
- console.log('startLoading', ifEdit);
2728
2638
  if (ifEdit) {
2729
2639
  this.setState({loading: true});
2730
2640
  }
@@ -2759,10 +2669,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2759
2669
  }
2760
2670
  temp.injectedEvents = {};
2761
2671
  _.forEach(col.supportedEvents, (event) => {
2762
- // console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
2672
+ //
2763
2673
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
2764
2674
  });
2765
- // console.log('should translate multicol', temp);
2675
+ //
2766
2676
  if (temp.type === 'icon') {
2767
2677
  return true;
2768
2678
  }
@@ -2793,7 +2703,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2793
2703
  _.forEach(col.supportedEvents, (event) => {
2794
2704
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
2795
2705
  });
2796
- // console.log('should translate multicol action', temp);
2706
+ //
2797
2707
  if (temp.type === 'icon') {
2798
2708
  return true;
2799
2709
  }
@@ -2827,7 +2737,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2827
2737
  _.forEach(inputField.supportedEvents, (event) => {
2828
2738
  temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
2829
2739
  });
2830
- // console.log('should translate collabel', temp);
2740
+ //
2831
2741
  if (temp.type === 'icon') {
2832
2742
  return true;
2833
2743
  }
@@ -2856,7 +2766,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2856
2766
  _.forEach(actionField.supportedEvents, (event) => {
2857
2767
  temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
2858
2768
  });
2859
- // console.log('should translate collabel action', temp);
2769
+ //
2860
2770
  if (temp.type === 'icon') {
2861
2771
  return true;
2862
2772
  }
@@ -2908,7 +2818,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2908
2818
  saveFormData = (passedData) => {
2909
2819
  //Logic to save in db etc
2910
2820
  // const isValidated = this.validateFormData(formData);
2911
- // console.log('whyyyy');
2821
+ //
2912
2822
  // if (!isValidated) {
2913
2823
  // return;
2914
2824
  // }
@@ -2916,16 +2826,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2916
2826
  // this.saveValidationData();
2917
2827
  // return;
2918
2828
  //}
2919
- console.log('save form data', passedData, this.state.gettingFormData, this.state.startValidation, this.state);
2829
+
2920
2830
  if (this.state.gettingFormData) {
2921
- console.log('posting final result', passedData);
2922
2831
  const response = {
2923
2832
  action: "getFormData",
2924
2833
  postAction: this.state.getFormDataValue || 'next',
2925
2834
  value: this.transformFormData(passedData),
2926
2835
  validity: this.state.isFormValid,
2927
2836
  };
2928
- console.log('Get Data', response);
2837
+
2929
2838
  this.setState({checkValidation: true});
2930
2839
  if (this.props.location.query.module === 'library' && this.props.isGetFormData) {
2931
2840
  this.props.getFormSubscriptionData(response);
@@ -2935,7 +2844,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2935
2844
  return;
2936
2845
  }
2937
2846
  const formData = _.cloneDeep(passedData);
2938
- console.log('Saving form data', JSON.stringify(formData), this.state.tabCount);
2847
+
2939
2848
  const obj = {};
2940
2849
  obj.versions = {
2941
2850
  base: {},
@@ -2948,10 +2857,10 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2948
2857
  const baseLanguage = this.props.Global.currentOrgDetails.basic_details.base_language;
2949
2858
  let baseKey = -1;
2950
2859
  //let saveCount = 0;
2951
- console.log('all data', this.state.currentTab);
2860
+
2952
2861
  _.forEach(formData, (data, index) => {
2953
2862
  const newdata = data;
2954
- console.log('all data 2', newdata, index);
2863
+
2955
2864
  if (!isNaN(index) && newdata) {
2956
2865
  const baseLangTabKey = newdata[baseLanguage].tabKey;
2957
2866
  newdata.tabKey = baseLangTabKey;
@@ -2960,9 +2869,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2960
2869
  baseKey = baseLangTabKey;
2961
2870
  }
2962
2871
  _.forEach(newdata.selectedLanguages, (language) => {
2963
- // console.log('all data 3', newdata[language], language, this.state.currentTab, index, (index + 1), (index + 1) === this.state.currentTab, newdata[language].is_drag_drop);
2872
+ //
2964
2873
  // if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
2965
- // console.log('all data 4');
2874
+ //
2966
2875
  // saveCount += 1;
2967
2876
  // }
2968
2877
  if (newdata[language].is_drag_drop) {
@@ -2982,15 +2891,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2982
2891
  delete obj.versions.base[language].edmeditorsrc;
2983
2892
  }
2984
2893
  });
2985
- console.log('obj', obj);
2894
+
2986
2895
  // if (saveCount === 0) {
2987
- console.log('final save obj', obj);
2896
+
2988
2897
  this.props.actions.createTemplate(obj);
2989
2898
  // } else {
2990
2899
  // this.setState({saveObj: obj, targetSaveCount: saveCount, mode: "save", saveEdmDataMode: 'save'}, () => {
2991
2900
  // _.forEach(data.selectedLanguages, (language, langIndex) => {
2992
2901
  // if (data[language].is_drag_drop) {
2993
- // console.log('saving edm template', document.getElementById("edmeditor"), `edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`);
2902
+ //
2994
2903
  // const win = document.getElementById(`edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`).contentWindow;
2995
2904
  // win.postMessage("saveProject", '*');
2996
2905
  // }
@@ -3003,9 +2912,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3003
2912
  const formData = _.cloneDeep(this.state.formData);
3004
2913
  const activeLangTab = formData[`${this.state.currentTab - 1}`].activeTab;
3005
2914
  const langIndex = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
3006
- console.log('switching editor midway', activeLangTab, langIndex, formData);
2915
+
3007
2916
  this.setState({mode: "switchEditor"}, () => {
3008
- console.log('posting message for switching editor', `edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`);
3009
2917
  const win = document.getElementById(`edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`).contentWindow;
3010
2918
  win.postMessage("saveProject", '*');
3011
2919
  });
@@ -3024,7 +2932,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3024
2932
  }
3025
2933
 
3026
2934
  toggleEdmEmailTemplateSelection = () => {
3027
- console.log('toggle Selection ', this.state.showEdmEmailTemplates);
3028
2935
  this.setState( (prevState) => ({
3029
2936
  showEdmEmailTemplates: !prevState.showEdmEmailTemplates}), () => {
3030
2937
  if (this.state.showEdmEmailTemplates) {
@@ -3042,7 +2949,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3042
2949
  // const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
3043
2950
  // let getQuery = '';
3044
2951
  const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
3045
- console.log('Selected EDM Data ', data, this.state.formData[this.state.currentTab - 1].activeTab);
2952
+
3046
2953
  this.props.actions.getCmsSetting('edm', data.versions.base.drag_drop_id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
3047
2954
  // this.props.templatesActions.setEdmTemplate(data);
3048
2955
  this.toggleEdmEmailTemplateSelection();
@@ -3083,7 +2990,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3083
2990
  render() {
3084
2991
  // const pageHeading = (this.state.isEdit) ? this.props.intl.formatMessage(messages.editHeading) : this.props.intl.formatMessage(messages.createHeading);
3085
2992
  // const actionComponents = '';
3086
- console.log('supported languages', this.supportedLanguages);
2993
+
3087
2994
  const filterContent = (
3088
2995
  <div className="action-container" style={{ display: 'inline-flex', width: '100%'}}>
3089
2996
  <div style={{ marginTop: '8px', width: '50%'}}>
@@ -3142,11 +3049,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3142
3049
  </Pagination>
3143
3050
  </div>
3144
3051
  );
3145
- console.log('Render Form Data ', this.state.formData, this.supportedLanguages, this.state);
3052
+
3146
3053
  if (!this.props.Global.currentOrgDetails || !this.props.Global.currentOrgDetails.basic_details) {
3147
3054
  return (<div>Loading...</div>);
3148
3055
  }
3149
- console.log('CMS Data ', this.props.Email.CmsSettings, this.props.Global.currentOrgDetails.basic_details.supported_languages);
3056
+
3150
3057
  let loaderText = this.props.Email.createTemplateInProgress ? this.props.intl.formatMessage(messages.saveTemplateLoader) : this.props.intl.formatMessage(messages.templateLoader);
3151
3058
  if (this.props.Email.assetUploading) {
3152
3059
  loaderText = this.props.intl.formatMessage(messages.uploadingImage);
@@ -3165,17 +3072,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
3165
3072
  />
3166
3073
  {/* <PageHeader pageHeading={pageHeading} /> */}
3167
3074
  <Spin tip={loaderText} spinning={spinning}>
3168
- {this.props.location.query.type !== 'embedded' && <Row>
3169
- <Col span={24}>
3170
- {this.props.location.query.type !== "embedded" &&
3171
- <Breadcrumb>
3172
- <BreadcrumbItem>Campaigns</BreadcrumbItem>
3173
- <BreadcrumbItem>Creatives</BreadcrumbItem>
3174
- <BreadcrumbItem>Email</BreadcrumbItem>
3175
- </Breadcrumb>
3176
- }
3177
- </Col>
3178
- </Row>}
3075
+
3179
3076
  <Row>
3180
3077
  <Col>
3181
3078
  {/* <input type="file" id="filename" style={{ display: 'none'}} accept="text/html" onChange={(event) => this.openFile(event)} /><br/> */}