@capillarytech/creatives-library 7.6.0 → 7.6.2

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 (117) hide show
  1. package/assets/DeviceForEmail.png +0 -0
  2. package/components/CapTagList/index.js +5 -5
  3. package/components/Card/index.js +1 -1
  4. package/components/Ckeditor/index.js +5 -5
  5. package/components/CustomPopOver/index.js +3 -3
  6. package/components/Edmeditor/index.js +4 -4
  7. package/components/EmailPreview/index.js +1 -1
  8. package/components/PreviewSideBar/index.js +3 -3
  9. package/components/Sidebar/index.js +1 -1
  10. package/components/SmsTest/index.js +4 -4
  11. package/components/TemplatePreview/index.js +2 -2
  12. package/components/Toastr/index.js +1 -1
  13. package/containers/Assets/Gallery/index.js +2 -2
  14. package/containers/Assets/Gallery/sagas.js +1 -1
  15. package/containers/Cap/actions.js +2 -2
  16. package/containers/Cap/reducer.js +1 -1
  17. package/containers/Cap/sagas.js +3 -3
  18. package/containers/Cap/selectors.js +1 -1
  19. package/containers/Ebill/actions.js +1 -1
  20. package/containers/Ebill/index.js +34 -34
  21. package/containers/Ebill/sagas.js +3 -3
  22. package/containers/Email/actions.js +2 -2
  23. package/containers/Email/index.js +171 -171
  24. package/containers/Email/reducer.js +1 -1
  25. package/containers/Email/sagas.js +6 -6
  26. package/containers/LanguageProvider/actions.js +1 -1
  27. package/containers/Line/Create/actions.js +5 -5
  28. package/containers/Line/Create/index.js +37 -37
  29. package/containers/Line/Create/sagas.js +7 -7
  30. package/containers/Line/Edit/actions.js +3 -3
  31. package/containers/Line/Edit/index.js +24 -24
  32. package/containers/Line/Edit/sagas.js +4 -4
  33. package/containers/MobilePush/Create/actions.js +2 -2
  34. package/containers/MobilePush/Create/index.js +35 -35
  35. package/containers/MobilePush/Create/sagas.js +2 -2
  36. package/containers/MobilePush/Edit/actions.js +3 -3
  37. package/containers/MobilePush/Edit/index.js +32 -32
  38. package/containers/MobilePush/Edit/sagas.js +5 -5
  39. package/containers/Sms/Create/actions.js +2 -2
  40. package/containers/Sms/Create/index.js +57 -57
  41. package/containers/Sms/Create/sagas.js +2 -2
  42. package/containers/Sms/Edit/actions.js +3 -3
  43. package/containers/Sms/Edit/index.js +44 -44
  44. package/containers/Sms/Edit/sagas.js +3 -3
  45. package/containers/TagList/index.js +9 -9
  46. package/containers/Templates/actions.js +5 -5
  47. package/containers/Templates/index.js +44 -44
  48. package/containers/Templates/sagas.js +5 -5
  49. package/containers/WeChat/MapTemplates/actions.js +1 -1
  50. package/containers/WeChat/MapTemplates/index.js +34 -34
  51. package/containers/WeChat/MapTemplates/sagas.js +2 -2
  52. package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
  53. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  54. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
  55. package/package.json +1 -1
  56. package/services/api.js +20 -24
  57. package/utils/authWrapper.js +2 -2
  58. package/utils/smsCharCount.js +5 -5
  59. package/v2Components/CapTagList/index.js +1 -1
  60. package/v2Components/CapVideoUpload/index.js +14 -6
  61. package/v2Components/Card/index.js +1 -1
  62. package/v2Components/Ckeditor/index.js +5 -5
  63. package/v2Components/CustomPopOver/index.js +3 -3
  64. package/v2Components/Edmeditor/index.js +4 -4
  65. package/v2Components/EmailMobilePreview/index.js +4 -4
  66. package/v2Components/EmailPreviewV2/index.js +4 -4
  67. package/v2Components/FormBuilder/index.js +3 -3
  68. package/v2Components/PreviewSideBar/index.js +3 -3
  69. package/v2Components/SmsTest/index.js +4 -4
  70. package/v2Components/TemplatePreview/index.js +5 -1
  71. package/v2Components/Toastr/index.js +1 -1
  72. package/v2Containers/Assets/Gallery/sagas.js +1 -1
  73. package/v2Containers/Cap/actions.js +1 -1
  74. package/v2Containers/Cap/index.js +2 -2
  75. package/v2Containers/Cap/reducer.js +1 -1
  76. package/v2Containers/Cap/sagas.js +3 -3
  77. package/v2Containers/Cap/selectors.js +1 -1
  78. package/v2Containers/CapFacebookPreview/actions.js +3 -15
  79. package/v2Containers/CapFacebookPreview/constants.js +3 -11
  80. package/v2Containers/CapFacebookPreview/index.js +6 -6
  81. package/v2Containers/CapFacebookPreview/reducer.js +3 -9
  82. package/v2Containers/CapFacebookPreview/sagas.js +6 -65
  83. package/v2Containers/CreativesContainer/SlideBoxContent.js +16 -7
  84. package/v2Containers/CreativesContainer/index.js +1 -0
  85. package/v2Containers/Ebill/actions.js +1 -1
  86. package/v2Containers/Ebill/index.js +34 -34
  87. package/v2Containers/Ebill/sagas.js +3 -3
  88. package/v2Containers/Email/reducer.js +1 -1
  89. package/v2Containers/EmailWrapper/index.js +4 -4
  90. package/v2Containers/Facebook/Advertisement/index.js +38 -15
  91. package/v2Containers/Facebook/Advertisement/index.scss +9 -0
  92. package/v2Containers/Facebook/Advertisement/messages.js +2 -2
  93. package/v2Containers/Facebook/actions.js +2 -1
  94. package/v2Containers/Facebook/reducer.js +3 -0
  95. package/v2Containers/Facebook/sagas.js +18 -7
  96. package/v2Containers/LanguageProvider/actions.js +1 -1
  97. package/v2Containers/Line/Container/actions.js +5 -5
  98. package/v2Containers/Line/Container/sagas.js +4 -4
  99. package/v2Containers/MobilePush/Create/actions.js +2 -2
  100. package/v2Containers/MobilePush/Create/index.js +1 -1
  101. package/v2Containers/MobilePush/Create/sagas.js +2 -2
  102. package/v2Containers/MobilePush/Edit/actions.js +3 -3
  103. package/v2Containers/MobilePush/Edit/index.js +26 -26
  104. package/v2Containers/MobilePush/Edit/sagas.js +5 -5
  105. package/v2Containers/Sms/Create/index.js +4 -4
  106. package/v2Containers/TagList/index.js +6 -6
  107. package/v2Containers/Templates/actions.js +5 -5
  108. package/v2Containers/Templates/index.js +23 -2
  109. package/v2Containers/Templates/sagas.js +4 -4
  110. package/v2Containers/Viber/actions.js +2 -2
  111. package/v2Containers/Viber/sagas.js +2 -2
  112. package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
  113. package/v2Containers/WeChat/MapTemplates/index.js +19 -19
  114. package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
  115. package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
  116. package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  117. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
@@ -103,7 +103,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
103
103
  }
104
104
  locale = this.getMappedLocale(locale);
105
105
  //locale = 'zh';
106
- console.log('Setting final locale as', locale);
106
+
107
107
  moment.locale(locale);
108
108
  window.addEventListener('storage', this.handleStorageChange, false);
109
109
  document.addEventListener(
@@ -404,7 +404,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
404
404
  const type = this.props.location.query.type;
405
405
  const toastMessages = this.props.Global.messages;
406
406
  const { isCreativesAccessible, showOrgChangeModal, showRefreshModal } = this.state;
407
- console.log('v2 locale loading', this.props.loader.localeLoading);
407
+
408
408
  return (
409
409
  <CapWrapper>
410
410
  { this.props.loader.localeLoading || this.props.Global.fetching_userdata ?
@@ -82,7 +82,7 @@ function capReducer(state = fromJS(initialState.cap), action) {
82
82
  .set('fetchingSchema', false);
83
83
  case types.GET_SCHEMA_FOR_ENTITY_SUCCESS: {
84
84
  const stateMeta = state.get('metaEntities');
85
- console.log('stateMeta', stateMeta);
85
+
86
86
  return state
87
87
  .set('fetchingSchema', false)
88
88
  .set('metaEntities', {
@@ -106,9 +106,9 @@ export function* fetchUserInfo(option) {
106
106
 
107
107
  export function* fetchSchemaForEntity(queryParams) {
108
108
  try {
109
- console.log('saga fetch Schema For Entity', queryParams);
109
+
110
110
  const result = yield call(Api.fetchSchemaForEntity, queryParams);
111
- console.log('cap saga', result);
111
+
112
112
  // const sidebar = result.response.sidebar;
113
113
  yield put({ type: types.GET_SCHEMA_FOR_ENTITY_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', entityType: queryParams.queryParams.type });
114
114
  } catch (error) {
@@ -129,7 +129,7 @@ function* getTopbarMenuData() {
129
129
 
130
130
 
131
131
  function* watchFetchSchemaForEntity() {
132
- console.log('inside watch get schema');
132
+
133
133
  const watcher = yield takeLatest(types.GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity);
134
134
  yield take(LOCATION_CHANGE);
135
135
  yield cancel(watcher);
@@ -31,7 +31,7 @@ const setInjectedTags = () => createSelector(
31
31
  const { tags } = metaEntities;
32
32
  const customTags = tags && (tags.custom || {});
33
33
  const extendedTags = tags && (tags.extended || {});
34
- console.log("selector cap: ", injectedTags, customTags, metaEntities, extendedTags);
34
+
35
35
  return (injectedTags = _.merge({}, injectedTags, customTags, extendedTags));
36
36
  }
37
37
  );
@@ -5,24 +5,12 @@
5
5
  */
6
6
 
7
7
  import {
8
- GENERATE_IMAGE_PREVIEW_REQUEST,
9
- GENERATE_VIDEO_PREVIEW_REQUEST,
10
- GENERATE_CAROUSEL_PREVIEW_REQUEST,
8
+ GENERATE_PREVIEW_REQUEST,
11
9
  CLEAR_PREVIEW,
12
10
  } from './constants';
13
11
 
14
- export const getImagePreview = (previewData) => ({
15
- type: GENERATE_IMAGE_PREVIEW_REQUEST,
16
- previewData,
17
- });
18
-
19
- export const getVideoPreview = (previewData) => ({
20
- type: GENERATE_VIDEO_PREVIEW_REQUEST,
21
- previewData,
22
- });
23
-
24
- export const getCarouselPreview = (previewData) => ({
25
- type: GENERATE_CAROUSEL_PREVIEW_REQUEST,
12
+ export const getPreview = (previewData) => ({
13
+ type: GENERATE_PREVIEW_REQUEST,
26
14
  previewData,
27
15
  });
28
16
 
@@ -5,17 +5,9 @@
5
5
  */
6
6
 
7
7
 
8
- export const GENERATE_IMAGE_PREVIEW_REQUEST = 'app/CapFacebookPreview/GET_IMAGE_PREVIEW_REQUEST';
9
- export const GENERATE_IMAGE_PREVIEW_SUCCESS = 'app/CapFacebookPreview/GET_IMAGE_PREVIEW_SUCCESS';
10
- export const GENERATE_IMAGE_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_IMAGE_PREVIEW_FAILURE';
11
-
12
- export const GENERATE_VIDEO_PREVIEW_REQUEST = 'app/CapFacebookPreview/GET_VIDEO_PREVIEW_REQUEST';
13
- export const GENERATE_VIDEO_PREVIEW_SUCCESS = 'app/CapFacebookPreview/GET_VIDEO_PREVIEW_SUCCESS';
14
- export const GENERATE_VIDEO_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_VIDEO_PREVIEW_FAILURE';
15
-
16
- export const GENERATE_CAROUSEL_PREVIEW_REQUEST = 'app/CapFacebookPreview/GET_CAROUSEL_PREVIEW_REQUEST';
17
- export const GENERATE_CAROUSEL_PREVIEW_SUCCESS = 'app/CapFacebookPreview/GET_CAROUSEL_PREVIEW_SUCCESS';
18
- export const GENERATE_CAROUSEL_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_CAROUSEL_PREVIEW_FAILURE';
8
+ export const GENERATE_PREVIEW_REQUEST = 'app/CapFacebookPreview/GET_PREVIEW_REQUEST';
9
+ export const GENERATE_PREVIEW_SUCCESS = 'app/CapFacebookPreview/GET_PREVIEW_SUCCESS';
10
+ export const GENERATE_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_PREVIEW_FAILURE';
19
11
 
20
12
  export const CLEAR_PREVIEW = 'app/CapFacebookPreview/CLEAR_PREVIEW';
21
13
 
@@ -42,7 +42,7 @@ export const CapFacebookPreview = (props) => {
42
42
  selectedAd,
43
43
  primaryText,
44
44
  callToAction,
45
- orgUnitFacebookPageSettingsMap,
45
+ orgUnitFacebookPageSettingsMap = {},
46
46
  accessToken,
47
47
  accountId,
48
48
  } = props;
@@ -222,11 +222,11 @@ export const CapFacebookPreview = (props) => {
222
222
  value: {link: webSiteLink},
223
223
  };
224
224
  }
225
- facebookPreviewActions.getImagePreview(data);
225
+ facebookPreviewActions.getPreview(data);
226
226
  } else {
227
227
  data.params.creative.object_story_spec.video_data = {
228
228
  image_url: videoData.previewUrl,
229
- videoUrl: videoData.videoSrc,
229
+ video_id: videoData.videoId,
230
230
  message: primaryText,
231
231
  link_description: linkDesc,
232
232
  };
@@ -236,7 +236,7 @@ export const CapFacebookPreview = (props) => {
236
236
  value: {link: webSiteLink},
237
237
  };
238
238
  }
239
- facebookPreviewActions.getVideoPreview(data);
239
+ facebookPreviewActions.getPreview(data);
240
240
  }
241
241
  } else {
242
242
  const childData = previewData.map((obj) => {
@@ -254,7 +254,7 @@ export const CapFacebookPreview = (props) => {
254
254
  if (obj.subType === VIDEO) {
255
255
  arrayData = {
256
256
  ...arrayData,
257
- videoUrl: obj.videoData.videoSrc,
257
+ video_id: obj.videoData.videoId,
258
258
  picture: obj.videoData.previewUrl,
259
259
  };
260
260
  } else {
@@ -273,7 +273,7 @@ export const CapFacebookPreview = (props) => {
273
273
  multi_share_end_card: false,
274
274
  },
275
275
  };
276
- facebookPreviewActions.getCarouselPreview(data);
276
+ facebookPreviewActions.getPreview(data);
277
277
  }
278
278
  setDisableAfterPreviewGenerate(true);
279
279
  };
@@ -16,20 +16,14 @@ const initialState = fromJS({
16
16
 
17
17
  function capFacebookPreviewReducer(state = initialState, action) {
18
18
  switch (action.type) {
19
- case types.GENERATE_IMAGE_PREVIEW_REQUEST:
20
- case types.GENERATE_VIDEO_PREVIEW_REQUEST:
21
- case types.GENERATE_CAROUSEL_PREVIEW_REQUEST:
19
+ case types.GENERATE_PREVIEW_REQUEST:
22
20
  return state.set('isFetchingPreview', true)
23
21
  .set('previewIframe', "")
24
22
  .set("previewIframeError", "");
25
- case types.GENERATE_IMAGE_PREVIEW_SUCCESS:
26
- case types.GENERATE_VIDEO_PREVIEW_SUCCESS:
27
- case types.GENERATE_CAROUSEL_PREVIEW_SUCCESS:
23
+ case types.GENERATE_PREVIEW_SUCCESS:
28
24
  return state.set('isFetchingPreview', false)
29
25
  .set('previewIframe', get(action, 'payload.fbPreview[0].body', ""));
30
- case types.GENERATE_IMAGE_PREVIEW_FAILURE:
31
- case types.GENERATE_VIDEO_PREVIEW_FAILURE:
32
- case types.GENERATE_CAROUSEL_PREVIEW_FAILURE:
26
+ case types.GENERATE_PREVIEW_FAILURE:
33
27
  return state.set('isFetchingPreview', false)
34
28
  .set('previewIframe', "")
35
29
  .set("previewIframeError", get(action, 'payload.message', ""));
@@ -3,70 +3,24 @@ import { LOCATION_CHANGE } from 'react-router-redux';
3
3
  import * as Api from '../../services/api';
4
4
  import * as type from './constants';
5
5
 
6
- export function* getImageFacebookPreview(previewData) {
6
+ export function* getFacebookPreview(previewData) {
7
7
  try {
8
- const response = yield call(Api.getImageFacebookPreview, previewData );
8
+ const response = yield call(Api.getFacebookPreview, previewData );
9
9
  const { status, response: responsePreview } = response;
10
10
  if (status && status.isError) {
11
11
  yield put({
12
- type: type.GENERATE_IMAGE_PREVIEW_FAILURE,
12
+ type: type.GENERATE_PREVIEW_FAILURE,
13
13
  payload: status,
14
14
  });
15
15
  } else {
16
16
  yield put({
17
- type: type.GENERATE_IMAGE_PREVIEW_SUCCESS,
17
+ type: type.GENERATE_PREVIEW_SUCCESS,
18
18
  payload: responsePreview,
19
19
  });
20
20
  }
21
21
  } catch (error) {
22
22
  yield put({
23
- type: type.GENERATE_IMAGE_PREVIEW_FAILURE,
24
- payload: error,
25
- });
26
- }
27
- }
28
-
29
- export function* getVideoFacebookPreview(previewData) {
30
- try {
31
- const response = yield call(Api.getVideoFacebookPreview, previewData);
32
- const { status, response: responsePreview } = response;
33
- if (status && status.isError) {
34
- yield put({
35
- type: type.GENERATE_VIDEO_PREVIEW_FAILURE,
36
- payload: status,
37
- });
38
- } else {
39
- yield put({
40
- type: type.GENERATE_VIDEO_PREVIEW_SUCCESS,
41
- payload: responsePreview,
42
- });
43
- }
44
- } catch (error) {
45
- yield put({
46
- type: type.GENERATE_VIDEO_PREVIEW_FAILURE,
47
- payload: error,
48
- });
49
- }
50
- }
51
-
52
- export function* getCarouselFacebookPreview(previewData) {
53
- try {
54
- const response = yield call(Api.getCarouselFacebookPreview, previewData);
55
- const { status, response: responsePreview } = response;
56
- if (status && status.isError) {
57
- yield put({
58
- type: type.GENERATE_CAROUSEL_PREVIEW_FAILURE,
59
- payload: status,
60
- });
61
- } else {
62
- yield put({
63
- type: type.GENERATE_CAROUSEL_PREVIEW_SUCCESS,
64
- payload: responsePreview,
65
- });
66
- }
67
- } catch (error) {
68
- yield put({
69
- type: type.GENERATE_CAROUSEL_PREVIEW_FAILURE,
23
+ type: type.GENERATE_PREVIEW_FAILURE,
70
24
  payload: error,
71
25
  });
72
26
  }
@@ -74,26 +28,13 @@ export function* getCarouselFacebookPreview(previewData) {
74
28
 
75
29
 
76
30
  function* watchImageFacebookPreview() {
77
- const watcher = yield takeLatest(type.GENERATE_IMAGE_PREVIEW_REQUEST, getImageFacebookPreview);
78
- yield take(LOCATION_CHANGE);
79
- yield cancel(watcher);
80
- }
81
-
82
- function* watchVideoFacebookPreview() {
83
- const watcher = yield takeLatest(type.GENERATE_VIDEO_PREVIEW_REQUEST, getVideoFacebookPreview);
31
+ const watcher = yield takeLatest(type.GENERATE_PREVIEW_REQUEST, getFacebookPreview);
84
32
  yield take(LOCATION_CHANGE);
85
33
  yield cancel(watcher);
86
34
  }
87
35
 
88
- function* watchCarouselFacebookPreview() {
89
- const watcher = yield takeLatest(type.GENERATE_CAROUSEL_PREVIEW_REQUEST, getCarouselFacebookPreview);
90
- yield take(LOCATION_CHANGE);
91
- yield cancel(watcher);
92
- }
93
36
 
94
37
  export default [
95
38
  watchImageFacebookPreview,
96
- watchVideoFacebookPreview,
97
- watchCarouselFacebookPreview,
98
39
  ];
99
40
 
@@ -136,6 +136,7 @@ function SlideBoxContent(props) {
136
136
  onShowTemplates,
137
137
  handleClose,
138
138
  onFTPSubmit,
139
+ campaignSettings,
139
140
  } = props;
140
141
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
141
142
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -266,32 +267,40 @@ function SlideBoxContent(props) {
266
267
  return template.content;
267
268
  }
268
269
  case constants.FACEBOOK: {
269
- const template = cloneDeep(templateDataObject.versions.base);
270
+ const template = cloneDeep(templateDataObject.versions.base) || {};
271
+ const {FacebookAd = [], pageOrgUnitId} = template.content || {};
270
272
  const {
271
273
  type: fbType = "",
272
274
  primaryText = "",
273
275
  callToAction = "",
274
276
  displayLink = "",
275
- } = template.content.FacebookAd[0] || {};
277
+ } = FacebookAd[0] || {};
276
278
  const previewData = Object.values(template.content.FacebookAd).map((obj) => ({
277
279
  imageData: obj.imgSrc ? {imageSrc: obj.imgSrc} : {},
278
280
  linkDesc: obj.linkDesc,
279
281
  linkHeadLine: obj.linkHeadLine,
280
282
  subType: obj.subType,
281
- videoData: obj.video ? { videoSrc: obj.originalContentUrl,
282
- videoName: obj.videoName,
283
- videoHeight: obj.videoHeight,
284
- videoWidth: obj.videoWidth,
285
- previewUrl: obj.previewImageUrl,
283
+ videoData: obj.video ? { videoSrc: obj.video.originalContentUrl,
284
+ videoName: obj.video.videoName,
285
+ previewUrl: obj.video.previewImageUrl,
286
+ videoId: obj.video.videoId,
287
+
286
288
  } : {},
287
289
  webSiteLink: obj.webSiteLink,
288
290
  }));
291
+ const facebookAccountSettings = get(campaignSettings, 'accountSettings.socialAccountSettings.facebookAccountSettings', []);
292
+ const {accountId, employeeAccessToken: accessToken, orgUnitFacebookPageSettingsMap = {}} = facebookAccountSettings[0] || {};
293
+ const {pageAccessToken, pageId} = orgUnitFacebookPageSettingsMap[pageOrgUnitId];
289
294
  const fbContent = {
290
295
  selectedAd: fbType,
291
296
  previewData,
292
297
  primaryText,
293
298
  callToAction,
294
299
  displayLink,
300
+ pageAccessToken,
301
+ pageId,
302
+ accountId,
303
+ accessToken,
295
304
  };
296
305
  return fbContent;
297
306
  }
@@ -619,6 +619,7 @@ class Creatives extends React.Component {
619
619
  onPreviewTemplate={this.onPreviewTemplate}
620
620
  slidBoxContent={slidBoxContent}
621
621
  templateData={templateData}
622
+ campaignSettings={this.props.Templates.campaignSettings}
622
623
  location={this.props.location}
623
624
  messageDetails={this.props.messageDetails}
624
625
  getFormData={this.getFormData}
@@ -14,7 +14,7 @@ export function createTemplate(template) {
14
14
  }
15
15
 
16
16
  export function getTemplateDetails(id, channel) {
17
- console.log('getting template', id, channel);
17
+
18
18
  return {
19
19
  type: types.GET_TEMPLATE_DETAILS_REQUEST,
20
20
  id,
@@ -585,13 +585,13 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
585
585
  type: 'LAYOUT',
586
586
  };
587
587
  this.props.globalActions.fetchSchemaForEntity(query);
588
- console.log('Form Data After 2', this.state.formData, this.props.Ebill.cmsData);
588
+
589
589
  }
590
590
 
591
591
  componentWillReceiveProps(nextProps) {
592
592
  if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
593
593
  this.injectEvents(nextProps.metaEntities.layouts[0].definition);
594
- console.log('isTagLoaded', this.isTagLoaded);
594
+
595
595
  const query = {
596
596
  layout: 'EBILL',
597
597
  type: 'TAG',
@@ -627,18 +627,18 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
627
627
  this.props.globalActions.addMessageToQueue(message);
628
628
  }
629
629
 
630
- console.log('Form Data After ', nextProps.Ebill.cmsData, this.props.Ebill.cmsData);
630
+
631
631
  if (nextProps.Ebill.cmsData !== '' && !_.isEqual(nextProps.Ebill.cmsData, this.props.Ebill.cmsData)) {
632
632
  const formData = _.cloneDeep(this.state.formData);
633
633
  formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] = nextProps.Ebill.cmsData.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/\\&quot;/g, "\"");
634
- console.log('Manoj Form Data After 21', formData);
634
+
635
635
  this.setState({formData});
636
636
  }
637
637
 
638
638
  if (nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && this.state.formData[this.state.currentTab - 1] && this.state.formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] !== '') {
639
639
  const formData = _.cloneDeep(this.state.formData);
640
640
  formData[this.state.currentTab - 1][`ebill-editor${this.state.currentTab > 1 ? this.state.currentTab : ''}`] = nextProps.Templates.selectedEmailLayout;
641
- console.log('Manoj Form Data After 01', formData);
641
+
642
642
  this.setState({formData});
643
643
  }
644
644
 
@@ -654,7 +654,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
654
654
  }
655
655
 
656
656
  onTagSelect = (data, currentTab, value) => {
657
- console.log('On Tag selection ', data, currentTab, value);
657
+
658
658
  if (this.state.isDragDrop) {
659
659
  const msg = {
660
660
  action: "InsertToCursor",
@@ -669,12 +669,12 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
669
669
  };
670
670
 
671
671
  onTabChange = (data, formData) => {
672
- console.log('inside parent ontabchange', data, this.state);
672
+
673
673
  this.setState({currentTab: data, formData});
674
674
  };
675
675
 
676
676
  onFormDataChange = (formData, tabCount, currentTab) => {
677
- console.log('Form data changed is ', formData, tabCount, currentTab);
677
+
678
678
  const tmpFormData = _.cloneDeep(formData);
679
679
  if (this.props.Templates.selectedEmailLayout !== '' && tmpFormData['0']['ebill-editor'] === '') {
680
680
  tmpFormData['0']['ebill-editor'] = this.props.Templates.selectedEmailLayout;
@@ -687,18 +687,18 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
687
687
  };
688
688
 
689
689
  onTagSelect = (data, currentTab) => {
690
- console.log('parent data tag', data, currentTab);
690
+
691
691
  const editorId = currentTab > 1 ? `ebill-editor${currentTab}` : 'ebill-editor';
692
692
  this.insertAtCursor(document.getElementById(editorId), `{{${data}}}`, currentTab);
693
693
  document.getElementById(editorId).focus();
694
694
  };
695
695
 
696
696
  onTemplateNameChange = (name) => {
697
- console.log('Template name changed to ', name);
697
+
698
698
  };
699
699
 
700
700
  onTemplateContentChange = (content) => {
701
- console.log('Template content changed to ', content);
701
+
702
702
  };
703
703
 
704
704
  setEditState = (data) => {
@@ -719,7 +719,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
719
719
  }
720
720
  if (type === 'embedded' || count > 0) {
721
721
  setTimeout( () => {
722
- console.log('removing standalone');
722
+
723
723
  if (type === 'embedded') {
724
724
  that.removeStandAlone();
725
725
  } else {
@@ -735,13 +735,13 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
735
735
  formData[0].base = true;
736
736
  }
737
737
  formData.base = data.versions.base;
738
- console.log('form data after discarding ', formData);
738
+
739
739
  this.setState({tabCount, formData, editData: data, currentTab: 1}, () => {
740
740
  });
741
741
  };
742
742
 
743
743
  getMappedEvent = (id, event) => {
744
- console.log('Map ', this.map, id, event);
744
+
745
745
  return this.map[id][event];
746
746
  };
747
747
 
@@ -769,11 +769,11 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
769
769
  saveFormData = (formData) => {
770
770
  //Logic to save in db etc
771
771
  // const isValidated = this.validateFormData(formData);
772
- // console.log('whyyyy');
772
+ //
773
773
  // if (!isValidated) {
774
774
  // return;
775
775
  // }
776
- console.log('Saving form data', formData, this.state.tabCount);
776
+
777
777
  const obj = {};
778
778
  obj.versions = {
779
779
  base: {},
@@ -790,11 +790,11 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
790
790
  });
791
791
  obj.name = formData['template-name'];
792
792
  obj.versions.base = formData.base;
793
- console.log('HTML file ', obj.versions.history);
793
+
794
794
  _.forEach(obj.versions.history, (index, version) => {
795
- console.log('Encoding ', index, version);
795
+
796
796
  });
797
- console.log('obj', obj);
797
+
798
798
  this.props.actions.createTemplate(obj);
799
799
  };
800
800
 
@@ -811,17 +811,17 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
811
811
  }
812
812
  }
813
813
  if (isValid) {
814
- console.log('isValid');
814
+
815
815
  return true;
816
816
  }
817
817
  const message = getMessageObject('error', this.props.intl.formatMessage(messages.templateDataNotValid), true);
818
818
  this.props.globalActions.addMessageToQueue(message);
819
- console.log('not valid');
819
+
820
820
  return false;
821
821
  };
822
822
 
823
823
  handleOnTagsContextChange = (data) => {
824
- console.log('parent tags context', data);
824
+
825
825
  const query = {
826
826
  layout: 'EBILL',
827
827
  type: 'TAG',
@@ -905,7 +905,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
905
905
 
906
906
 
907
907
  injectEvents(schema) {
908
- console.log('now injecting events', schema);
908
+
909
909
  const temp = schema;
910
910
  temp.standalone.sections = this.injectSections(temp.standalone.sections);
911
911
  _.forEach(temp.containers, (container) => {
@@ -913,7 +913,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
913
913
  tempContainer = this.injectContainer(tempContainer);
914
914
  return tempContainer;
915
915
  });
916
- console.log('final injected schema', schema);
916
+
917
917
  this.setState({schema}, () => {
918
918
  const type = this.props.location.query.type;
919
919
  if (type === 'embedded') {
@@ -955,7 +955,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
955
955
  console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
956
956
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
957
957
  });
958
- console.log('should translate multicol', temp);
958
+
959
959
  if (temp.type === 'icon') {
960
960
  return true;
961
961
  }
@@ -986,7 +986,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
986
986
  _.forEach(col.supportedEvents, (event) => {
987
987
  temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
988
988
  });
989
- console.log('should translate multicol action', temp);
989
+
990
990
  if (temp.type === 'icon') {
991
991
  return true;
992
992
  }
@@ -1020,7 +1020,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1020
1020
  _.forEach(inputField.supportedEvents, (event) => {
1021
1021
  temp.injectedEvents[event] = this.getMappedEvent(inputField.id, event);
1022
1022
  });
1023
- console.log('should translate collabel', temp);
1023
+
1024
1024
  if (temp.type === 'icon') {
1025
1025
  return true;
1026
1026
  }
@@ -1049,7 +1049,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1049
1049
  _.forEach(actionField.supportedEvents, (event) => {
1050
1050
  temp.injectedEvents[event] = this.getMappedEvent(actionField.id, event);
1051
1051
  });
1052
- console.log('should translate collabel action', temp);
1052
+
1053
1053
  if (temp.type === 'icon') {
1054
1054
  return true;
1055
1055
  }
@@ -1099,7 +1099,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1099
1099
  }
1100
1100
 
1101
1101
  cloneColLabel(sectionObj, tabIndex) {
1102
- console.log('cloning cloneColLabel', sectionObj, tabIndex);
1102
+
1103
1103
  const section = _.cloneDeep(sectionObj);
1104
1104
  const inputFields = _.forEach(section.inputFields, (inputField) => {
1105
1105
  const inputF = inputField;
@@ -1108,12 +1108,12 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1108
1108
  return inputF;
1109
1109
  });
1110
1110
  section.inputFields = inputFields;
1111
- console.log('cloned ifs are', section);
1111
+
1112
1112
  return section;
1113
1113
  }
1114
1114
 
1115
1115
  cloneMultiCol(sectionObj, tabIndex) {
1116
- console.log('cloning multicol ', sectionObj, tabIndex);
1116
+
1117
1117
  const section = _.cloneDeep(sectionObj);
1118
1118
  const inputFields = _.forEach(section.inputFields, (inputField) => {
1119
1119
  const inputF = inputField;
@@ -1127,7 +1127,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1127
1127
  return inputF;
1128
1128
  });
1129
1129
  section.inputFields = inputFields;
1130
- console.log('cloned cols are', section);
1130
+
1131
1131
  return section;
1132
1132
  }
1133
1133
 
@@ -1145,13 +1145,13 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
1145
1145
  } else if (childSection.type === 'parent') {
1146
1146
  sect = this.cloneParent(childSection, tabIndex);
1147
1147
  }
1148
- console.log('returning cloned parent section', sect);
1148
+
1149
1149
  childSections.push(sect);
1150
1150
  return true;
1151
1151
  });
1152
1152
  console.log('returning cloned parent section final 1', JSON.stringify(childSections));
1153
1153
  parentsect.childSections = childSections;
1154
- console.log('returning cloned parent section final', parentsect);
1154
+
1155
1155
  return _.cloneDeep(parentsect);
1156
1156
  }
1157
1157
 
@@ -7,7 +7,7 @@ import * as types from './constants';
7
7
  export function* createTemplate(template) {
8
8
  let errorMsg = "";
9
9
  try {
10
- console.log('Template data ', template);
10
+
11
11
  const result = yield call(Api.createEbillTemplate, template);
12
12
  if ((result.message && typeof result.message === 'string') || result.status.code === 500) {
13
13
  errorMsg = result.message;
@@ -20,7 +20,7 @@ export function* createTemplate(template) {
20
20
 
21
21
  export function* getTemplateDetails(id, channel) {
22
22
  try {
23
- console.log('saga get Template details', id);
23
+
24
24
  const result = yield call(Api.getTemplateDetails, id, channel);
25
25
  // const sidebar = result.response.sidebar;
26
26
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
@@ -32,7 +32,7 @@ export function* getTemplateDetails(id, channel) {
32
32
  export function* getCmsData({cmsType, projectId}) {
33
33
  try {
34
34
  const result = yield call(Api.getCmsData, cmsType, projectId);
35
- console.log('CMS Data ', result);
35
+
36
36
  yield put({ type: types.GET_CMS_EDITOR_DATA_SUCCESS, data: decodeURIComponent(result.data.response.cmsData.htmlContent) });
37
37
  } catch (error) {
38
38
  yield put({ type: types.GET_CMS_EDITOR_DATA_FAILURE, error });
@@ -14,7 +14,7 @@ const initialState = fromJS({
14
14
  });
15
15
 
16
16
  function emailReducer(state = initialState, action) {
17
- //console.log('email reducer', action);
17
+ //
18
18
  switch (action.type) {
19
19
  case types.CREATE_TEMPLATE_REQUEST:
20
20
  return state