@capillarytech/creatives-library 7.6.2 → 7.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/components/CapTagList/index.js +5 -5
  2. package/components/Card/index.js +1 -1
  3. package/components/Ckeditor/index.js +5 -5
  4. package/components/CustomPopOver/index.js +3 -3
  5. package/components/Edmeditor/index.js +4 -4
  6. package/components/EmailPreview/index.js +1 -1
  7. package/components/PreviewSideBar/index.js +3 -3
  8. package/components/Sidebar/index.js +1 -1
  9. package/components/SmsTest/index.js +4 -4
  10. package/components/TemplatePreview/index.js +2 -2
  11. package/components/Toastr/index.js +1 -1
  12. package/containers/Assets/Gallery/index.js +2 -2
  13. package/containers/Assets/Gallery/sagas.js +1 -1
  14. package/containers/Cap/actions.js +2 -2
  15. package/containers/Cap/reducer.js +1 -1
  16. package/containers/Cap/sagas.js +3 -3
  17. package/containers/Cap/selectors.js +1 -1
  18. package/containers/Ebill/actions.js +1 -1
  19. package/containers/Ebill/index.js +34 -34
  20. package/containers/Ebill/sagas.js +3 -3
  21. package/containers/Email/actions.js +2 -2
  22. package/containers/Email/index.js +171 -171
  23. package/containers/Email/reducer.js +1 -1
  24. package/containers/Email/sagas.js +6 -6
  25. package/containers/LanguageProvider/actions.js +1 -1
  26. package/containers/Line/Create/actions.js +5 -5
  27. package/containers/Line/Create/index.js +37 -37
  28. package/containers/Line/Create/sagas.js +7 -7
  29. package/containers/Line/Edit/actions.js +3 -3
  30. package/containers/Line/Edit/index.js +24 -24
  31. package/containers/Line/Edit/sagas.js +4 -4
  32. package/containers/MobilePush/Create/actions.js +2 -2
  33. package/containers/MobilePush/Create/index.js +35 -35
  34. package/containers/MobilePush/Create/sagas.js +2 -2
  35. package/containers/MobilePush/Edit/actions.js +3 -3
  36. package/containers/MobilePush/Edit/index.js +32 -32
  37. package/containers/MobilePush/Edit/sagas.js +5 -5
  38. package/containers/Sms/Create/actions.js +2 -2
  39. package/containers/Sms/Create/index.js +57 -57
  40. package/containers/Sms/Create/sagas.js +2 -2
  41. package/containers/Sms/Edit/actions.js +3 -3
  42. package/containers/Sms/Edit/index.js +44 -44
  43. package/containers/Sms/Edit/sagas.js +3 -3
  44. package/containers/TagList/index.js +9 -9
  45. package/containers/Templates/actions.js +5 -5
  46. package/containers/Templates/index.js +44 -44
  47. package/containers/Templates/sagas.js +5 -5
  48. package/containers/WeChat/MapTemplates/actions.js +1 -1
  49. package/containers/WeChat/MapTemplates/index.js +34 -34
  50. package/containers/WeChat/MapTemplates/sagas.js +2 -2
  51. package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
  52. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  53. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
  54. package/package.json +1 -1
  55. package/services/api.js +13 -13
  56. package/utils/authWrapper.js +2 -2
  57. package/utils/smsCharCount.js +5 -5
  58. package/v2Components/CapTagList/index.js +1 -1
  59. package/v2Components/Card/index.js +1 -1
  60. package/v2Components/Ckeditor/index.js +5 -5
  61. package/v2Components/CustomPopOver/index.js +3 -3
  62. package/v2Components/Edmeditor/index.js +4 -4
  63. package/v2Components/EmailMobilePreview/index.js +4 -4
  64. package/v2Components/EmailPreviewV2/index.js +4 -4
  65. package/v2Components/FormBuilder/index.js +3 -3
  66. package/v2Components/PreviewSideBar/index.js +3 -3
  67. package/v2Components/SmsTest/index.js +4 -4
  68. package/v2Components/TemplatePreview/index.js +1 -1
  69. package/v2Components/Toastr/index.js +1 -1
  70. package/v2Containers/Assets/Gallery/sagas.js +1 -1
  71. package/v2Containers/Cap/actions.js +1 -1
  72. package/v2Containers/Cap/index.js +2 -2
  73. package/v2Containers/Cap/reducer.js +1 -1
  74. package/v2Containers/Cap/sagas.js +3 -3
  75. package/v2Containers/Cap/selectors.js +1 -1
  76. package/v2Containers/Ebill/actions.js +1 -1
  77. package/v2Containers/Ebill/index.js +34 -34
  78. package/v2Containers/Ebill/sagas.js +3 -3
  79. package/v2Containers/Email/reducer.js +1 -1
  80. package/v2Containers/EmailWrapper/index.js +4 -4
  81. package/v2Containers/Facebook/sagas.js +1 -1
  82. package/v2Containers/LanguageProvider/actions.js +1 -1
  83. package/v2Containers/Line/Container/actions.js +5 -5
  84. package/v2Containers/Line/Container/sagas.js +4 -4
  85. package/v2Containers/MobilePush/Create/actions.js +2 -2
  86. package/v2Containers/MobilePush/Create/index.js +1 -1
  87. package/v2Containers/MobilePush/Create/sagas.js +2 -2
  88. package/v2Containers/MobilePush/Edit/actions.js +3 -3
  89. package/v2Containers/MobilePush/Edit/index.js +26 -26
  90. package/v2Containers/MobilePush/Edit/sagas.js +5 -5
  91. package/v2Containers/Sms/Create/index.js +4 -4
  92. package/v2Containers/TagList/index.js +6 -6
  93. package/v2Containers/Templates/actions.js +5 -5
  94. package/v2Containers/Templates/index.js +1 -1
  95. package/v2Containers/Templates/sagas.js +4 -4
  96. package/v2Containers/Viber/actions.js +2 -2
  97. package/v2Containers/Viber/sagas.js +2 -2
  98. package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
  99. package/v2Containers/WeChat/MapTemplates/index.js +19 -19
  100. package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
  101. package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
  102. package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  103. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
  104. package/assets/DeviceForEmail.png +0 -0
@@ -14,7 +14,7 @@ const initialState = fromJS({
14
14
  });
15
15
 
16
16
  function emailReducer(state = initialState, action) {
17
- //
17
+ //console.log('email reducer', action);
18
18
  switch (action.type) {
19
19
  case types.CREATE_TEMPLATE_REQUEST:
20
20
  return state
@@ -7,7 +7,7 @@ import * as types from './constants';
7
7
  export function* createTemplate(template) {
8
8
  let errorMsg;
9
9
  try {
10
-
10
+ console.log('Template data ', template);
11
11
  const result = yield call(Api.createEmailTemplate, template);
12
12
  if (result.message || result.status.code === 500) {
13
13
  errorMsg = result.message;
@@ -21,7 +21,7 @@ export function* createTemplate(template) {
21
21
  export function* duplicateTemplate(id, channel) {
22
22
  let errorMsg;
23
23
  try {
24
-
24
+ console.log('Duplicate template ', id, channel);
25
25
  const result = yield call(Api.duplicateTemplate, id, channel );
26
26
  if (result.message || result.status.code === 500) {
27
27
  errorMsg = result.message;
@@ -34,7 +34,7 @@ export function* duplicateTemplate(id, channel) {
34
34
 
35
35
  export function* getTemplateDetails(id) {
36
36
  try {
37
-
37
+ console.log('saga get Template details', id);
38
38
  const result = yield call(Api.getTemplateDetails, id);
39
39
  // const sidebar = result.response.sidebar;
40
40
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
@@ -54,9 +54,9 @@ export function* getAllAssets(assetType, queryParams) {
54
54
 
55
55
  export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport}) {
56
56
  try {
57
-
57
+ console.log('cms sagas', langId);
58
58
  const result = yield call(Api.getCmsTemplateSettings, cmsType, projectId, cmsMode, langId, isEdmSupport);
59
-
59
+ console.log('CMS Setting ', result);
60
60
  yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
61
61
  } catch (error) {
62
62
  yield put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error });
@@ -66,7 +66,7 @@ export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSuppor
66
66
  export function* getCmsData({cmsType, projectId, langId}) {
67
67
  try {
68
68
  const result = yield call(Api.getCmsTemplateData, cmsType, projectId, langId);
69
-
69
+ console.log('CMS Data sagas', result);
70
70
  yield put({ type: types.GET_CMS_EDITOR_DATA_SUCCESS, data: result.data.response.data, langId: result.data.response.langId });
71
71
  } catch (error) {
72
72
  yield put({ type: types.GET_CMS_EDITOR_DATA_FAILURE, error });
@@ -9,7 +9,7 @@ import {
9
9
  } from './constants';
10
10
 
11
11
  export function changeLocale(languageLocale) {
12
-
12
+ console.log('trying to change locale', languageLocale);
13
13
  return {
14
14
  type: CHANGE_LOCALE,
15
15
  locale: languageLocale,
@@ -7,14 +7,14 @@
7
7
  import * as types from './constants';
8
8
 
9
9
  export function createTemplate(template) {
10
-
10
+ console.log('action trigereed createtemplate');
11
11
  return {
12
12
  type: types.CREATE_TEMPLATE_REQUEST, template,
13
13
  };
14
14
  }
15
15
 
16
16
  export function clearCreateResponse() {
17
-
17
+ console.log('clearCreateResponse');
18
18
  return {
19
19
  type: types.CLEAR_CREATE_RESPONSE_REQUEST,
20
20
  };
@@ -46,14 +46,14 @@ export function clearAsset() {
46
46
 
47
47
 
48
48
  export function editTemplate(template) {
49
-
49
+ console.log('action trigereed editTemplate line @@@');
50
50
  return {
51
51
  type: types.EDIT_TEMPLATE_REQUEST, template,
52
52
  };
53
53
  };
54
54
 
55
55
  export function getTemplateDetails(id) {
56
-
56
+ console.log('getting template line @@@', id);
57
57
  return {
58
58
  type: types.GET_TEMPLATE_DETAILS_REQUEST,
59
59
  id,
@@ -62,7 +62,7 @@ export function getTemplateDetails(id) {
62
62
  };
63
63
 
64
64
  export function clearEditResponse() {
65
-
65
+ console.log('clearEditResponse');
66
66
  return {
67
67
  type: types.CLEAR_EDIT_RESPONSE_REQUEST,
68
68
  };
@@ -109,7 +109,7 @@ export class Line extends Component {
109
109
  }
110
110
 
111
111
  componentWillReceiveProps(nextProps) {
112
-
112
+ console.log("nextProps line @@@", nextProps);
113
113
 
114
114
  //// Create template logic ////
115
115
 
@@ -124,14 +124,14 @@ export class Line extends Component {
124
124
  }
125
125
  if (modeType) {
126
126
  this.setState({modeType, schema: {}});
127
- //
127
+ //console.log("ooo", this.state.schema);
128
128
  }
129
129
  if (nextProps.isGetFormData) {
130
130
  nextProps.getFormLibraryData(this.getFormData());
131
131
  }
132
132
  if (isSchemaReady) {
133
133
  // set schema value as per mode type. Supported mode (text & image)
134
-
134
+ console.log("modeType", this.state.modeType);
135
135
  const {textSchema, imageSchema} = layouts[0].definition;
136
136
  const schema = (modeType === "text" || editModeType === 'edit_text') ? textSchema : imageSchema;
137
137
  this.setState({schema}, () => {
@@ -161,7 +161,7 @@ export class Line extends Component {
161
161
  }
162
162
 
163
163
  if ( nextProps.Line && (nextProps.Line.response && nextProps.Line.response.templateId) ) {
164
-
164
+ console.log('create response', nextProps.Line);
165
165
  this.discardValues();
166
166
  const message = getMessageObject('success', this.props.intl.formatMessage(messages["Line Template Created Successfully"]), true);
167
167
  this.props.globalActions.addMessageToQueue(message);
@@ -212,34 +212,34 @@ export class Line extends Component {
212
212
  // TODO: if multiple image upload supports, change below accordingly.
213
213
  formData[this.state.currentTab - 1].image = nextProps.Line.uploadedAssetData.metaInfo.secure_file_path;
214
214
  formData[this.state.currentTab - 1].imagePreview = nextProps.Line.uploadedAssetData.metaInfo.secure_file_path_preview;
215
-
215
+ console.log("before 2", formData[this.state.currentTab - 1].image);
216
216
  this.setState({formData});
217
-
217
+ console.log("ooo", this.state.formData);
218
218
  this.props.actions.clearAsset();
219
219
  }
220
220
  }
221
221
 
222
222
  componentWillUnmount() {
223
-
223
+ console.log('removed listener templates');
224
224
  window.removeEventListener("message", this.handleFrameTasks);
225
225
  }
226
226
 
227
227
  onTagSelect(data, currentTab) {
228
-
228
+ console.log('parent data tag', data, currentTab);
229
229
  const editorId = 'message-editor';
230
230
  this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
231
231
  document.getElementById(editorId).focus();
232
232
  }
233
233
 
234
234
  onTagSelectTitle(data, currentTab) {
235
-
235
+ console.log('parent data tag', data, currentTab);
236
236
  const editorId = 'message-title';
237
237
  this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
238
238
  document.getElementById(editorId).focus();
239
239
  }
240
240
 
241
241
  onFormDataChange = (formData, tabCount, currentTab) => {
242
-
242
+ console.log('Form data changed is ', formData, tabCount, currentTab);
243
243
  this.setState({formData, tabCount});
244
244
  if (currentTab) {
245
245
  this.setState({currentTab});
@@ -247,7 +247,7 @@ export class Line extends Component {
247
247
  };
248
248
 
249
249
  getTransformedData = (formData) => {
250
-
250
+ console.log("formData before transform@@@", formData);
251
251
  const modeType = this.state.modeType;
252
252
  const obj = {};
253
253
  const msgData = {};
@@ -292,7 +292,7 @@ export class Line extends Component {
292
292
  // const img = new Image();
293
293
  // img.src = formData['0'].image;
294
294
  // img.onload = () => {
295
- //
295
+ // console.log(`Image aspect ratio details line@@@${img.width} and ${img.height}`);
296
296
  // };
297
297
  // // Preview Image set to 240px max
298
298
  // const prevImgSet = new Image(240, 240);
@@ -324,7 +324,7 @@ export class Line extends Component {
324
324
  obj.base.imagePreview = versions.base.content.messages[0].previewImageUrl;
325
325
  }
326
326
 
327
-
327
+ console.log("getEditTransformedData", obj);
328
328
  return obj;
329
329
  };
330
330
 
@@ -335,13 +335,13 @@ export class Line extends Component {
335
335
  getMappedEvent = (id, event) => {
336
336
  const map = this.state.eventsMap;
337
337
  if (!map[id] || !map[id][event]) {
338
-
338
+ console.log(`error map[id] ${map[id]}` );
339
339
  }
340
340
  return map[id][event];
341
341
  };
342
342
 
343
343
  getCurrentWindow(e) {
344
-
344
+ console.log('in Line create@@@', e);
345
345
  const response = {
346
346
  action: e.action,
347
347
  value: 'edit',
@@ -351,7 +351,7 @@ export class Line extends Component {
351
351
  }
352
352
 
353
353
  getFormData = (e) => {
354
-
354
+ console.log('posting final result', this.state.formData);
355
355
  const response = {
356
356
  action: "getFormData",
357
357
  value: this.getTransformedData(this.state.formData),
@@ -374,19 +374,19 @@ export class Line extends Component {
374
374
  tempContainer = this.injectContainer(tempContainer);
375
375
  return tempContainer;
376
376
  });
377
-
377
+ console.log('final injected schema', schema);
378
378
  this.setState({schema, isSchemaChanged: true}, () => {
379
379
  this.removeStandAlone();
380
380
  });
381
-
381
+ console.log('final returned schema', this.state.schema);
382
382
  return schema;
383
383
  };
384
384
 
385
385
  saveFormData = (formData) => {
386
-
387
-
386
+ console.log("ccc", this.props);
387
+ console.log('Saving form data of LINE @@@', formData, this.state.tabCount);
388
388
  const obj = this.getTransformedData(formData);
389
-
389
+ console.log('obj final@@@', obj);
390
390
  if (obj === 'IMAGE_ERROR') {
391
391
  const message = getMessageObject('error', this.props.intl.formatMessage(messages['Please upload an image to proceed']), true);
392
392
  this.props.globalActions.addMessageToQueue(message);
@@ -401,7 +401,7 @@ export class Line extends Component {
401
401
  }
402
402
  }
403
403
  if (this.state.isEdit) {
404
-
404
+ console.log("Inside edit line template@@");
405
405
  this.props.actions.editTemplate(obj);
406
406
  } else {
407
407
  this.props.actions.createTemplate(obj);
@@ -549,7 +549,7 @@ export class Line extends Component {
549
549
  type: 'LAYOUT',
550
550
  };
551
551
  this.props.globalActions.fetchSchemaForEntity(getSchemaQuery);
552
-
552
+ console.log('startTemplateCreation');
553
553
  const content = data.content;
554
554
  const obj = {};
555
555
  obj['0'] = {};
@@ -568,7 +568,7 @@ export class Line extends Component {
568
568
  };
569
569
 
570
570
  startLoading = (ifEdit) => {
571
-
571
+ console.log('startLoading', ifEdit);
572
572
  if (ifEdit) {
573
573
  this.setState({loading: true});
574
574
  }
@@ -608,7 +608,7 @@ export class Line extends Component {
608
608
  };
609
609
 
610
610
  moveToTemplates() {
611
-
611
+ console.log('in move to Templates');
612
612
  const modalContent = {
613
613
  title: this.props.intl.formatMessage(messages.alertMessage),
614
614
  body: this.props.intl.formatMessage(messages.goBackConfirmation),
@@ -633,11 +633,11 @@ export class Line extends Component {
633
633
  };
634
634
 
635
635
  handleFrameTasks = (e) => {
636
-
636
+ console.log('listened from cheetah@@@', e.data);
637
637
  const type = e.data;
638
-
638
+ console.log('data type', typeof type);
639
639
  if (typeof type === 'object') {
640
-
640
+ console.log('received something', type);
641
641
  const action = type.action;
642
642
  switch (action) {
643
643
  case "startTemplateCreation":
@@ -658,15 +658,15 @@ export class Line extends Component {
658
658
  this.getFormData(e);
659
659
  break;
660
660
  case "startTemplateCreation":
661
-
661
+ console.log('Starting to create template');
662
662
  //this.getFormData(e);
663
663
  break;
664
664
  case "moveToTemplates":
665
-
665
+ console.log('moving to templates');
666
666
  this.moveToTemplates();
667
667
  break;
668
668
  case "validateContent":
669
-
669
+ console.log('validating Content');
670
670
  this.validateContent(e);
671
671
  break;
672
672
  default:
@@ -677,7 +677,7 @@ export class Line extends Component {
677
677
 
678
678
  removeStandAlone = () => {
679
679
  const schema = _.cloneDeep(this.state.schema);
680
-
680
+ console.log("schema line", schema);
681
681
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'loyalty') {
682
682
  schema.standalone.sections.splice(0, 1);
683
683
  } else if (this.props.location.query.type === 'embedded' && typeof this.props.location.query.module !== 'undefined') {
@@ -689,7 +689,7 @@ export class Line extends Component {
689
689
  };
690
690
 
691
691
  validateContent = (e) => {
692
-
692
+ console.log('posting final validation result', this.state.isFormValid);
693
693
  const response = {
694
694
  action: "validateContent",
695
695
  value: this.state.isFormValid,
@@ -698,7 +698,7 @@ export class Line extends Component {
698
698
  };
699
699
 
700
700
  handleOnTagsContextChange = (data) => {
701
-
701
+ console.log('parent tags context', data);
702
702
  const query = {
703
703
  layout: 'LINE',
704
704
  type: 'TAG',
@@ -709,7 +709,7 @@ export class Line extends Component {
709
709
  };
710
710
 
711
711
  uploadImage = (pearmData) => {
712
-
712
+ console.log("image data line@@@", pearmData);
713
713
  const data = pearmData;
714
714
  if (data.file && data.file.size > 1000000) {
715
715
  const message = getMessageObject('error', this.props.intl.formatMessage(messages['File size cannot be more than 1mb']), true);
@@ -725,9 +725,9 @@ export class Line extends Component {
725
725
 
726
726
  render() {
727
727
  if (this.state.formData && this.state.formData["0"] && this.state.formData["0"].image) {
728
-
728
+ console.log("before render@@@", this.state.formData["0"].image);
729
729
  }
730
-
730
+ console.log("render state", this.state);
731
731
  let tipText = this.props.Line.createTemplateInProgress ? this.props.intl.formatMessage(messages.savingTemplate) : "";
732
732
  let loading = this.props.Line.createTemplateInProgress ? this.props.Line.createTemplateInProgress : false;
733
733
  if (this.props.Line.assetUploading) {
@@ -9,7 +9,7 @@ import * as types from './constants';
9
9
  export function* createTemplate(template) {
10
10
  let errorMsg;
11
11
  try {
12
-
12
+ console.log('inside line saga createTemplate@@@', template);
13
13
  const result = yield call(Api.createLineTemplate, template);
14
14
  if (result.message || result.status.code === 500) {
15
15
  errorMsg = result.message;
@@ -29,13 +29,13 @@ export function* uploadAsset(file, assetType, fileParams) {
29
29
  }
30
30
 
31
31
  function* watchCreateTemplate() {
32
-
32
+ console.log('inside watch line saga createTemplate@@@');
33
33
  const watcher = yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
34
34
  yield take(LOCATION_CHANGE);
35
35
  yield cancel(watcher);
36
36
  }
37
37
  function* watchUploadAsset() {
38
-
38
+ console.log("inside watchUploadAsset");
39
39
  const watcher = yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
40
40
  yield take(LOCATION_CHANGE);
41
41
  yield cancel(watcher);
@@ -46,9 +46,9 @@ function* watchUploadAsset() {
46
46
  export function* editTemplate(template) {
47
47
  let errorMsg;
48
48
  try {
49
-
49
+ console.log('saga editTemplate line', template);
50
50
  const result = yield call(Api.createLineTemplate, template);
51
-
51
+ console.log('saga editTemplate success line', result);
52
52
  if (result.message || result.status.code === 500) {
53
53
  errorMsg = result.message;
54
54
  }
@@ -60,7 +60,7 @@ export function* editTemplate(template) {
60
60
 
61
61
  export function* getTemplateDetails(id) {
62
62
  try {
63
-
63
+ console.log('saga get Template details line', id);
64
64
  const result = yield call(Api.getTemplateDetails, id);
65
65
  // const sidebar = result.response.sidebar;
66
66
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
@@ -71,7 +71,7 @@ export function* getTemplateDetails(id) {
71
71
 
72
72
  export function* getLineTemplatesList(params) {
73
73
  try {
74
-
74
+ console.log('Saga param line ', params.channel, params.queryParams);
75
75
  const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
76
76
  yield put({ type: types.GET_LINE_TEMPLATES_LIST_SUCCESS, data: result.response.templates, templateData: result.response.mapped});
77
77
  } catch (error) {
@@ -14,14 +14,14 @@ export function defaultAction() {
14
14
  }
15
15
 
16
16
  export function editTemplate(template) {
17
-
17
+ console.log('action trigereed editTemplate line @@@');
18
18
  return {
19
19
  type: types.EDIT_TEMPLATE_REQUEST, template,
20
20
  };
21
21
  }
22
22
 
23
23
  export function getTemplateDetails(id) {
24
-
24
+ console.log('getting template line @@@', id);
25
25
  return {
26
26
  type: types.GET_TEMPLATE_DETAILS_REQUEST, id,
27
27
  };
@@ -38,7 +38,7 @@ export function uploadAsset(file, assetType, fileParams, mode) {
38
38
  }
39
39
 
40
40
  export function clearEditResponse() {
41
-
41
+ console.log('clearEditResponse');
42
42
  return {
43
43
  type: types.CLEAR_EDIT_RESPONSE_REQUEST,
44
44
  };
@@ -85,7 +85,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
85
85
  };
86
86
  }
87
87
  componentWillMount() {
88
-
88
+ console.log('edit mounting line');
89
89
  if (this.props.location.query.type !== 'embedded') {
90
90
  const type = this.props.location.query.type;
91
91
  const module = this.props.location.query.module ? this.props.location.query.module : 'default';
@@ -175,7 +175,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
175
175
  this.setState({iosCtasData: nextProps.Edit.iosCtasData});
176
176
  }
177
177
  if (nextProps.Edit.editResponse && nextProps.Edit.editResponse.templateId) {
178
-
178
+ console.log('reseting schema');
179
179
  this.resetSchema();
180
180
  this.setState({
181
181
  formData: {},
@@ -216,7 +216,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
216
216
  };
217
217
 
218
218
  onFormDataChange = (formData, tabCount, currentTab) => {
219
-
219
+ console.log('Form data changed is ', formData, tabCount, currentTab);
220
220
  const newFormData = _.cloneDeep(formData);
221
221
  if (newFormData[this.state.currentTab - 1] && newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-table`]) {
222
222
  newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-label`] = newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-table`].name;
@@ -247,12 +247,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
247
247
  };
248
248
 
249
249
  onTabChange = (data) => {
250
-
250
+ console.log('inside parent ontabchange', data, this.state);
251
251
  this.setState({currentTab: data});
252
252
  };
253
253
 
254
254
  onTagSelect = (data, currentTab, srcComp) => {
255
-
255
+ console.log('parent data tag', data, currentTab);
256
256
  const editorId = srcComp.target;
257
257
  this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
258
258
  document.getElementById(editorId).focus();
@@ -536,13 +536,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
536
536
  getMappedEvent = (id, event) => {
537
537
  const map = this.state.eventsMap;
538
538
  if (!map[id] || !map[id][event]) {
539
-
539
+ console.log(`error map[id] ${map[id]}` );
540
540
  }
541
541
  return map[id][event];
542
542
  };
543
543
 
544
544
  getCurrentWindow = (e) => {
545
-
545
+ console.log('in line create', e);
546
546
  const response = {
547
547
  action: e.action,
548
548
  value: 'edit',
@@ -552,13 +552,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
552
552
  };
553
553
 
554
554
  getFormData = (e) => {
555
-
555
+ console.log('posting final result', this.state.formData);
556
556
  const response = {
557
557
  action: "getFormData",
558
558
  value: this.getTransformedData(this.state.formData),
559
559
  validity: this.state.isFormValid,
560
560
  };
561
-
561
+ console.log('GetForm Data ', response);
562
562
  this.setState({checkValidation: true});
563
563
  if (e) {
564
564
  e.source.postMessage(JSON.stringify(response), e.origin);
@@ -568,7 +568,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
568
568
 
569
569
 
570
570
  setEditState(data, schema) {
571
-
571
+ console.log('Test 1234', data, schema);
572
572
  const tabCount = Object.keys(data.versions.base).length;
573
573
  const formData = {};
574
574
  if (this.props.location.query.type === 'embedded' && this.props.location.query.module === "loyalty") {
@@ -641,7 +641,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
641
641
  formData[1] = ios;
642
642
  formData.base = formData[0];
643
643
  formData[0].base = true;
644
-
644
+ console.log('form data after discarding ', formData);
645
645
  this.getSchemaForFormData(formData, schema);
646
646
  this.setState({tabCount, formData, editData: data, currentTab: 1});
647
647
  }
@@ -725,7 +725,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
725
725
  };
726
726
 
727
727
  startTemplateCreation = (data) => {
728
-
728
+ console.log('startTemplateCreation', data);
729
729
  if (!data.edit) {
730
730
  this.setState({injectedTags: data.tags});
731
731
  this.props.globalActions.setInjectedTags(data.tags);
@@ -733,7 +733,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
733
733
  };
734
734
 
735
735
  discardValues = () => {
736
-
736
+ console.log('discarding', this.props.Edit);
737
737
  this.resetSchema();
738
738
  this.setState({
739
739
  formData: {},
@@ -759,7 +759,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
759
759
  };
760
760
 
761
761
  moveToTemplates = () => {
762
-
762
+ console.log('in move to Templates');
763
763
  const modalContent = {
764
764
  title: this.props.intl.formatMessage(messages.alertMessage),
765
765
  body: this.props.intl.formatMessage(messages.goBackConfirmation),
@@ -837,18 +837,18 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
837
837
  };
838
838
 
839
839
  saveFormData = (formData) => {
840
-
840
+ console.log('Saving form data', formData, this.state.tabCount);
841
841
  const obj = this.getTransformedData(formData);
842
-
842
+ console.log('obj', obj);
843
843
  this.props.actions.editTemplate(obj);
844
844
  };
845
845
 
846
846
  handleFrameTasks = (e) => {
847
- //
847
+ // console.log('data listened to is', e.data);
848
848
  const type = e.data;
849
-
849
+ console.log('data type', typeof type);
850
850
  if (typeof type === 'object') {
851
- //
851
+ // console.log('received something', type);
852
852
  const action = type.action;
853
853
  switch (action) {
854
854
  case "startTemplateCreation":
@@ -869,15 +869,15 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
869
869
  this.getFormData(e);
870
870
  break;
871
871
  case "startTemplateCreation":
872
-
872
+ console.log('Starting to create template');
873
873
  //this.getFormData(e);
874
874
  break;
875
875
  case "moveToTemplates":
876
-
876
+ console.log('moving to templates');
877
877
  this.moveToTemplates();
878
878
  break;
879
879
  case "validateContent":
880
-
880
+ console.log('validating Content');
881
881
  this.validateContent(e);
882
882
  break;
883
883
  default:
@@ -921,7 +921,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
921
921
  tempContainer = this.injectContainer(tempContainer);
922
922
  return tempContainer;
923
923
  });
924
-
924
+ console.log('final injected schema', schema);
925
925
  this.setState({schema}, () => {
926
926
  this.removeStandAlone();
927
927
  });
@@ -943,7 +943,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
943
943
  };
944
944
 
945
945
  handleOnTagsContextChange = (data) => {
946
-
946
+ console.log('parent tags context', data);
947
947
  const query = {
948
948
  layout: 'line',
949
949
  type: 'TAG',
@@ -8,9 +8,9 @@ import * as types from './constants';
8
8
  export function* editTemplate(template) {
9
9
  let errorMsg;
10
10
  try {
11
-
11
+ console.log('saga editTemplate line', template);
12
12
  const result = yield call(Api.createLineTemplate, template);
13
-
13
+ console.log('saga editTemplate success line', result);
14
14
  if (result.message || result.status.code === 500) {
15
15
  errorMsg = result.message;
16
16
  }
@@ -22,7 +22,7 @@ export function* editTemplate(template) {
22
22
 
23
23
  export function* getTemplateDetails(id) {
24
24
  try {
25
-
25
+ console.log('saga get Template details line', id);
26
26
  const result = yield call(Api.getTemplateDetails, id);
27
27
  // const sidebar = result.response.sidebar;
28
28
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
@@ -42,7 +42,7 @@ export function* uploadAsset(file, assetType, fileParams, mode) {
42
42
 
43
43
  export function* getLineTemplatesList(params) {
44
44
  try {
45
-
45
+ console.log('Saga param line ', params.channel, params.queryParams);
46
46
  const result = yield call(Api.getAllTemplates, {channel: params.channel, queryParams: params.queryParams});
47
47
  yield put({ type: types.GET_LINE_TEMPLATES_LIST_SUCCESS, data: result.response.templates, templateData: result.response.mapped});
48
48
  } catch (error) {
@@ -7,14 +7,14 @@
7
7
  import * as types from './constants';
8
8
 
9
9
  export function createTemplate(template) {
10
-
10
+ console.log('action trigereed createtemplate');
11
11
  return {
12
12
  type: types.CREATE_TEMPLATE_REQUEST, template,
13
13
  };
14
14
  }
15
15
 
16
16
  export function clearCreateResponse() {
17
-
17
+ console.log('clearCreateResponse');
18
18
  return {
19
19
  type: types.CLEAR_CREATE_RESPONSE_REQUEST,
20
20
  };