@capillarytech/creatives-library 7.6.1 → 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 (134) 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/config/app.js +2 -0
  14. package/containers/Assets/Gallery/index.js +2 -2
  15. package/containers/Assets/Gallery/sagas.js +1 -1
  16. package/containers/Cap/actions.js +2 -2
  17. package/containers/Cap/reducer.js +1 -1
  18. package/containers/Cap/sagas.js +3 -3
  19. package/containers/Cap/selectors.js +1 -1
  20. package/containers/Ebill/actions.js +1 -1
  21. package/containers/Ebill/index.js +34 -34
  22. package/containers/Ebill/sagas.js +3 -3
  23. package/containers/Email/actions.js +2 -2
  24. package/containers/Email/index.js +171 -171
  25. package/containers/Email/reducer.js +1 -1
  26. package/containers/Email/sagas.js +6 -6
  27. package/containers/LanguageProvider/actions.js +1 -1
  28. package/containers/Line/Create/actions.js +5 -5
  29. package/containers/Line/Create/index.js +37 -37
  30. package/containers/Line/Create/sagas.js +7 -7
  31. package/containers/Line/Edit/actions.js +3 -3
  32. package/containers/Line/Edit/index.js +24 -24
  33. package/containers/Line/Edit/sagas.js +4 -4
  34. package/containers/MobilePush/Create/actions.js +2 -2
  35. package/containers/MobilePush/Create/index.js +35 -35
  36. package/containers/MobilePush/Create/sagas.js +2 -2
  37. package/containers/MobilePush/Edit/actions.js +3 -3
  38. package/containers/MobilePush/Edit/index.js +32 -32
  39. package/containers/MobilePush/Edit/sagas.js +5 -5
  40. package/containers/Sms/Create/actions.js +2 -2
  41. package/containers/Sms/Create/index.js +57 -57
  42. package/containers/Sms/Create/sagas.js +2 -2
  43. package/containers/Sms/Edit/actions.js +3 -3
  44. package/containers/Sms/Edit/index.js +44 -44
  45. package/containers/Sms/Edit/sagas.js +3 -3
  46. package/containers/TagList/index.js +9 -9
  47. package/containers/Templates/actions.js +5 -5
  48. package/containers/Templates/index.js +44 -44
  49. package/containers/Templates/sagas.js +5 -5
  50. package/containers/WeChat/MapTemplates/actions.js +1 -1
  51. package/containers/WeChat/MapTemplates/index.js +34 -34
  52. package/containers/WeChat/MapTemplates/sagas.js +2 -2
  53. package/containers/WeChat/RichmediaTemplates/Create/index.js +9 -9
  54. package/containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  55. package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
  56. package/index.js +6 -0
  57. package/package.json +1 -1
  58. package/reducers.js +2 -1
  59. package/routes.js +5 -0
  60. package/services/api.js +43 -14
  61. package/utils/authWrapper.js +2 -2
  62. package/utils/common.js +13 -1
  63. package/utils/smsCharCount.js +5 -5
  64. package/v2Components/CapTagList/index.js +1 -1
  65. package/v2Components/CapVideoUpload/index.js +14 -6
  66. package/v2Components/Card/index.js +1 -1
  67. package/v2Components/Ckeditor/index.js +5 -5
  68. package/v2Components/CustomPopOver/index.js +3 -3
  69. package/v2Components/Edmeditor/index.js +4 -4
  70. package/v2Components/EmailMobilePreview/index.js +4 -4
  71. package/v2Components/EmailPreviewV2/index.js +4 -4
  72. package/v2Components/FormBuilder/index.js +3 -3
  73. package/v2Components/PreviewSideBar/index.js +3 -3
  74. package/v2Components/SmsTest/index.js +4 -4
  75. package/v2Components/TemplatePreview/index.js +24 -3
  76. package/v2Components/Toastr/index.js +1 -1
  77. package/v2Containers/App/constants.js +21 -0
  78. package/v2Containers/Assets/Gallery/sagas.js +1 -1
  79. package/v2Containers/Cap/actions.js +1 -1
  80. package/v2Containers/Cap/index.js +2 -2
  81. package/v2Containers/Cap/messages.js +30 -0
  82. package/v2Containers/Cap/reducer.js +1 -1
  83. package/v2Containers/Cap/sagas.js +3 -3
  84. package/v2Containers/Cap/selectors.js +1 -1
  85. package/v2Containers/CapFacebookPreview/actions.js +3 -15
  86. package/v2Containers/CapFacebookPreview/constants.js +3 -11
  87. package/v2Containers/CapFacebookPreview/index.js +6 -6
  88. package/v2Containers/CapFacebookPreview/reducer.js +3 -9
  89. package/v2Containers/CapFacebookPreview/sagas.js +6 -65
  90. package/v2Containers/CreativesContainer/SlideBoxContent.js +64 -1
  91. package/v2Containers/CreativesContainer/index.js +19 -8
  92. package/v2Containers/Ebill/actions.js +1 -1
  93. package/v2Containers/Ebill/index.js +34 -34
  94. package/v2Containers/Ebill/sagas.js +3 -3
  95. package/v2Containers/Email/reducer.js +1 -1
  96. package/v2Containers/EmailWrapper/index.js +4 -4
  97. package/v2Containers/Facebook/Advertisement/index.js +38 -15
  98. package/v2Containers/Facebook/Advertisement/index.scss +9 -0
  99. package/v2Containers/Facebook/Advertisement/messages.js +2 -2
  100. package/v2Containers/Facebook/actions.js +63 -0
  101. package/v2Containers/Facebook/constants.js +25 -1
  102. package/v2Containers/Facebook/index.js +135 -107
  103. package/v2Containers/Facebook/reducer.js +98 -1
  104. package/v2Containers/Facebook/sagas.js +147 -0
  105. package/v2Containers/Facebook/selectors.js +10 -0
  106. package/v2Containers/LanguageProvider/actions.js +1 -1
  107. package/v2Containers/Line/Container/Video/index.js +38 -41
  108. package/v2Containers/Line/Container/actions.js +5 -5
  109. package/v2Containers/Line/Container/sagas.js +4 -4
  110. package/v2Containers/MobilePush/Create/actions.js +2 -2
  111. package/v2Containers/MobilePush/Create/index.js +1 -1
  112. package/v2Containers/MobilePush/Create/sagas.js +2 -2
  113. package/v2Containers/MobilePush/Edit/actions.js +3 -3
  114. package/v2Containers/MobilePush/Edit/index.js +26 -26
  115. package/v2Containers/MobilePush/Edit/sagas.js +5 -5
  116. package/v2Containers/Sms/Create/index.js +4 -4
  117. package/v2Containers/TagList/index.js +6 -6
  118. package/v2Containers/Templates/_templates.scss +26 -0
  119. package/v2Containers/Templates/actions.js +18 -5
  120. package/v2Containers/Templates/constants.js +8 -0
  121. package/v2Containers/Templates/index.js +139 -11
  122. package/v2Containers/Templates/messages.js +8 -4
  123. package/v2Containers/Templates/reducer.js +22 -0
  124. package/v2Containers/Templates/sagas.js +30 -5
  125. package/v2Containers/TemplatesV2/index.js +13 -13
  126. package/v2Containers/Viber/actions.js +2 -2
  127. package/v2Containers/Viber/index.js +2 -1
  128. package/v2Containers/Viber/sagas.js +2 -2
  129. package/v2Containers/WeChat/MapTemplates/actions.js +1 -1
  130. package/v2Containers/WeChat/MapTemplates/index.js +19 -19
  131. package/v2Containers/WeChat/MapTemplates/sagas.js +3 -3
  132. package/v2Containers/WeChat/RichmediaTemplates/Create/actions.js +1 -1
  133. package/v2Containers/WeChat/RichmediaTemplates/Edit/actions.js +1 -1
  134. package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +1 -1
@@ -188,11 +188,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
188
188
  this.setState({templateData});
189
189
  }
190
190
  getEditorInstanse = (instance, id) => {
191
- console.log('Got editor Instance ', instance, id);
191
+
192
192
  window.CKEDITOR.on( 'instanceReady', ( event ) => {
193
193
  this.setState({editorInstanse: event.editor});
194
194
  event.editor.on( 'focus', () => {
195
- console.log( 'focused', event.editor, this );
195
+
196
196
  this.setState({editorInstanse: event.editor});
197
197
  });
198
198
  });
@@ -208,7 +208,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
208
208
  this.setState({isFormValid});
209
209
  }
210
210
  getCurrentWindow(e) {
211
- console.log("moveToTemplates richmedia getCurrentWindow");
211
+
212
212
  const response = {
213
213
  action: e.action,
214
214
  value: 'edit',
@@ -217,7 +217,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
217
217
  parent.postMessage(JSON.stringify(response), '*');
218
218
  }
219
219
  getFormData(e) {
220
- console.log("getformdata wechat richmedia: ", this.state.templateData, this.props, this.state);
220
+
221
221
  const message = {
222
222
  mediaList: this.props.templateData.templateDetails.versions.base.mediaList,
223
223
  media_id: this.props.templateData.templateDetails.versions.base.mediaId,
@@ -241,7 +241,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
241
241
  value: data,
242
242
  validity: this.state.isFormValid,
243
243
  };
244
- console.log("getformdata2 wechat richmedia: ", data);
244
+
245
245
  e.source.postMessage(JSON.stringify(response), e.origin);
246
246
  }
247
247
  injectMessages(elem) {
@@ -300,7 +300,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
300
300
  // }
301
301
  // }
302
302
  moveToTemplates() {
303
- console.log("moveToTemplates richmedia");
303
+
304
304
  const modalContent = {
305
305
  title: this.props.intl.formatMessage(messages.modalTitle),
306
306
  body: this.props.intl.formatMessage(messages.modalBody),
@@ -314,7 +314,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
314
314
  this.setState({showModal: false});
315
315
  }
316
316
  showNext() {
317
- console.log("richmedia shownext");
317
+
318
318
  const response = {
319
319
  action: "showNext",
320
320
  value: true,
@@ -322,7 +322,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
322
322
  parent.postMessage(JSON.stringify(response), '*');
323
323
  }
324
324
  handleFrameTasks = (e) => {
325
- console.log("richmedia handleFrameTasks: ", e.data);
325
+
326
326
  const type = e.data;
327
327
  if (typeof type === 'object') {
328
328
  const action = type.action;
@@ -342,7 +342,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
342
342
  this.getFormData(e);
343
343
  break;
344
344
  case "moveToTemplates":
345
- console.log("moveToTemplates richmedia case");
345
+
346
346
  this.moveToTemplates();
347
347
  break;
348
348
  default:
@@ -13,7 +13,7 @@ export function defaultAction() {
13
13
  }
14
14
 
15
15
  export function getTemplateDetails(id, channel) {
16
- console.log('getting template', id);
16
+
17
17
  return {
18
18
  type: types.GET_TEMPLATE_DETAILS_REQUEST, id, channel,
19
19
  };
@@ -12,7 +12,7 @@ export function* getTemplateDetails({id, channel}) {
12
12
  const params = {
13
13
  id, channel,
14
14
  };
15
- console.log('saga get Template details', id);
15
+
16
16
  const result = yield call(Api.getTemplateDetails, params);
17
17
  // const sidebar = result.response.sidebar;
18
18
  yield put({ type: types.GET_TEMPLATE_DETAILS_SUCCESS, data: result.response });
package/index.js CHANGED
@@ -75,6 +75,10 @@ import viberSaga from './v2Containers/Viber/sagas';
75
75
 
76
76
  import TemplatesV2 from './v2Containers/TemplatesV2/index';
77
77
 
78
+ import FacebookPreview from './v2Containers/CapFacebookPreview';
79
+ import FacebookPreviewReducer from './v2Containers/CapFacebookPreview/reducer';
80
+ import FacebookPreviewSaga from './v2Containers/CapFacebookPreview/sagas';
81
+
78
82
  import CreativesContainer from './v2Containers/CreativesContainer';
79
83
  import CreativesContainerReducer from './v2Containers/CreativesContainer/reducer';
80
84
  import { updateCharCount } from './utils/smsCharCountV2';
@@ -101,6 +105,7 @@ const LineCreateContainer = {LineCreate, lineCreateReducer, lineCreateSaga};
101
105
  const TemplatesV2Container = {TemplatesV2, templateReducer, templateSaga};
102
106
  const FacebookContainer = {Facebook, facebookReducer, facebookSaga};
103
107
  const ViberContainer = {Viber, viberReducer, viberSaga};
108
+ const FacebookPreviewContainer = { FacebookPreview, FacebookPreviewReducer, FacebookPreviewSaga };
104
109
 
105
110
  const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
106
111
  const FTPContainer = {FTP, FTPReducer, FTPSagas};
@@ -145,4 +150,5 @@ export { CapContainer,
145
150
  GalleryContainer,
146
151
  FTPContainer,
147
152
  ViberContainer,
153
+ FacebookPreviewContainer,
148
154
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.6.1",
4
+ "version": "7.6.2",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/reducers.js CHANGED
@@ -9,7 +9,7 @@ import { LOCATION_CHANGE } from 'react-router-redux';
9
9
 
10
10
  import languageProviderReducer from 'v2Containers/LanguageProvider/reducer';
11
11
  import beeEditorReducer from 'v2Containers/BeeEditor/reducer';
12
-
12
+ import CapFacebookPreviewReducer from 'v2Containers/CapFacebookPreview/reducer';
13
13
 
14
14
  import capReducer from 'containers/Cap/reducer';
15
15
  import appReducer from 'containers/App/reducer';
@@ -64,6 +64,7 @@ export default function createReducer(asyncReducers) {
64
64
  email: emailReducer,
65
65
  ebill: ebillReducer,
66
66
  beeEditor: beeEditorReducer,
67
+ facebookPreview: CapFacebookPreviewReducer,
67
68
  FTP: ftpReducer,
68
69
  ...asyncReducers,
69
70
  });
package/routes.js CHANGED
@@ -637,6 +637,8 @@ export default function createRoutes(store) {
637
637
  import('v2Containers/Line/Container/reducer'),
638
638
  import('v2Containers/Viber/sagas'),
639
639
  import('v2Containers/Viber/reducer'),
640
+ import('v2Containers/CapFacebookPreview/sagas'),
641
+ import('v2Containers/CapFacebookPreview/reducer'),
640
642
  ]);
641
643
 
642
644
  const renderRoute = loadModule(cb);
@@ -658,6 +660,7 @@ export default function createRoutes(store) {
658
660
  facebookSagas, facebookReducer,
659
661
  lineCreateSagas, lineCreateReducer,
660
662
  viberSagas, viberReducer,
663
+ capFacebookPreviewSagas, capFacebookPreviewReducer,
661
664
  ]) => {
662
665
  injectReducer('templates', reducer.default);
663
666
  injectReducer('cap', capReducer.default);
@@ -675,6 +678,7 @@ export default function createRoutes(store) {
675
678
  injectReducer('facebook', facebookReducer.default);
676
679
  injectReducer('lineCreate', lineCreateReducer.default);
677
680
  injectReducer('viber', viberReducer.default);
681
+ injectReducer('facebookPreview', capFacebookPreviewReducer.default);
678
682
  injectSagas(gallerySagas.default);
679
683
  injectSagas(sagas.default);
680
684
  injectSagas(capSagas.default);
@@ -691,6 +695,7 @@ export default function createRoutes(store) {
691
695
  injectSagas(facebookSagas.default);
692
696
  injectSagas(lineCreateSagas.default);
693
697
  injectSagas(viberSagas.default);
698
+ injectSagas(capFacebookPreviewSagas.default);
694
699
  renderRoute(component);
695
700
  });
696
701
  importModules.catch(errorLoading);
package/services/api.js CHANGED
@@ -11,12 +11,15 @@ import { GA } from '@capillarytech/cap-ui-utils';
11
11
  let API_ENDPOINT = config.development.api_endpoint;
12
12
  let EXPORT_API_ENDPOINT = config.development.exports_api_endpoint;
13
13
  let CAMPAIGNS_API_ENDPOINT = config.development.campaigns_api_endpoint;
14
+ let CAMPAIGNS_API_ORG_ENDPOINT = config.development.campaigns_api_org_endpoint;
15
+
14
16
  let API_AUTH_ENDPOINT = config.development.auth_endpoint;
15
17
  let ARYA_ENDPOINT = config.development.arya_endpoint;
16
18
  let SUBSCRIPTION_API_ENDPOINT = config.development.subscription_api_endpoint;
17
19
  if (process.env.NODE_ENV === 'production') {
18
20
  API_ENDPOINT = config.production.api_endpoint;
19
21
  CAMPAIGNS_API_ENDPOINT = config.production.campaigns_api_endpoint;
22
+ CAMPAIGNS_API_ORG_ENDPOINT = config.production.campaigns_api_org_endpoint;
20
23
  API_AUTH_ENDPOINT = config.production.auth_endpoint;
21
24
  ARYA_ENDPOINT = config.production.arya_endpoint;
22
25
  SUBSCRIPTION_API_ENDPOINT = config.production.subscription_api_endpoint;
@@ -84,7 +87,7 @@ function request(url, options) {
84
87
  try {
85
88
  requestCallerName = getCallerName();
86
89
  } catch (e) {
87
- console.log('requestCallerName error :', e);
90
+
88
91
  }
89
92
  const fetchUrl = url.indexOf('?') !== -1 ? `${url}&time=${Date.now()}` : `${url}?time=${Date.now()}`;
90
93
  return fetch(fetchUrl, options)
@@ -187,30 +190,31 @@ export const getUserData = () => {
187
190
  };
188
191
 
189
192
  export const createTemplate = ({template}) => {
190
- console.log('in api.js', template);
193
+
191
194
  const url = `${API_ENDPOINT}/templates/SMS`;
192
195
  return request(url, getAPICallObject('POST', template));
193
196
  };
194
197
 
195
198
  export const editTemplate = ({template}) => {
196
- console.log('in api.js', template);
199
+
197
200
  const url = `${API_ENDPOINT}/templates/SMS`;
198
201
  return request(url, getAPICallObject('POST', template));
199
202
  };
200
203
 
201
204
  export const createWeChatTemplate = ({template}) => {
202
- console.log('in api.js', template);
205
+
203
206
  const url = `${API_ENDPOINT}/templates/WECHAT`;
204
207
  return request(url, getAPICallObject('POST', template));
205
208
  };
209
+
206
210
  export const createMobilePushTemplate = ({template}) => {
207
- console.log('in api.js', template);
211
+
208
212
  const url = `${API_ENDPOINT}/templates/MOBILEPUSH`;
209
213
  return request(url, getAPICallObject('POST', template));
210
214
  };
211
215
 
212
216
  export const duplicateTemplate = ({id, channel}) => {
213
- console.log('in api.js duplicateTemplate', id, channel);
217
+
214
218
  const url = `${API_ENDPOINT}/templates/duplicate/${id}/${channel}`;
215
219
  return request(url, getAPICallObject('GET'));
216
220
  };
@@ -221,37 +225,36 @@ export const getFTPServers = () => {
221
225
  };
222
226
 
223
227
  export const editWeChatTemplate = ({template}) => {
224
- console.log('in api.js', template);
228
+
225
229
  const url = `${API_ENDPOINT}/templates/WECHAT`;
226
230
  return request(url, getAPICallObject('POST', template));
227
231
  };
228
232
 
229
233
  export const createEmailTemplate = ({template}) => {
230
- console.log('in api.js', template);
234
+
231
235
  const url = `${API_ENDPOINT}/templates/EMAIL`;
232
236
  return request(url, getAPICallObject('POST', template));
233
237
  };
234
238
 
235
239
  export const createEbillTemplate = ({template}) => {
236
- console.log('in api.js', template);
240
+
237
241
  const url = `${API_ENDPOINT}/templates/EBILL`;
238
242
  return request(url, getAPICallObject('POST', template));
239
243
  };
240
244
 
241
245
  export const getTemplateDetails = ({id, channel}) => {
242
- console.log('in api.js', id);
246
+
243
247
  const url = `${API_ENDPOINT}/templates/${id}/${channel ? channel.toUpperCase() : 'SMS'}`;
244
248
  return request(url, getAPICallObject('GET'));
245
249
  };
246
250
 
247
251
  export const getAllTemplates = ({channel, queryParams}) => {
248
- console.log('in api.js', channel, queryParams);
249
252
  const url = `${API_ENDPOINT}/templates/${channel}?query=${encodeURIComponent(JSON.stringify(queryParams))}`;
250
253
  return request(url, getAPICallObject('GET'));
251
254
  };
252
255
 
253
256
  export const deleteTemplate = ({channel, id}) => {
254
- console.log('in api.js delete', id, channel);
257
+
255
258
  const url = `${API_ENDPOINT}/templates/${id}/${channel}`;
256
259
  return request(url, getAPICallObject('DELETE'));
257
260
  //return API.deleteResource(url);
@@ -347,7 +350,7 @@ export const getCmsData = (cmsType, projectId, langId) => {
347
350
  };
348
351
 
349
352
  export const getEdmTemplates = () => {
350
- console.log('in api.js');
353
+
351
354
  const url = `${API_ENDPOINT}/templates/email/default`;
352
355
  return request(url, getAPICallObject('GET'));
353
356
  };
@@ -360,7 +363,7 @@ export const getDefaultBeeTemplates = () => {
360
363
  // All about line
361
364
 
362
365
  export const createLineTemplate = ({template}) => {
363
- console.log('LINE : in api.js', template);
366
+
364
367
  const url = `${API_ENDPOINT}/templates/LINE`;
365
368
  return request(url, getAPICallObject('POST', template));
366
369
  };
@@ -370,6 +373,11 @@ export const createViberTemplate = ({template}) => {
370
373
  return request(url, getAPICallObject('POST', template));
371
374
  };
372
375
 
376
+ export const createFacebookADTemplate = ({template}) => {
377
+ const url = `${API_ENDPOINT}/templates/FACEBOOK`;
378
+ return request(url, getAPICallObject('POST', template));
379
+ };
380
+
373
381
  export const getLocizMessage = async (locale) => {
374
382
  const appName = 'creatives_v2';
375
383
  const url = `${ARYA_ENDPOINT}/translations/${appName}/${locale}`;
@@ -403,3 +411,24 @@ export const createCustomRow = (data) => {
403
411
  const url = `${API_ENDPOINT}/cms/saveRows`;
404
412
  return request(url, getAPICallObject('POST', data));
405
413
  };
414
+
415
+ export const getFacebookPreview = ({previewData}) => {
416
+ const url = `${API_ENDPOINT}/facebook/getPreview`;
417
+ return request(url, getAPICallObject('POST', previewData));
418
+ };
419
+
420
+
421
+ export const getOrgOUs = ({ orgID }) => {
422
+ const url = `${ARYA_ENDPOINT}/org/${orgID}/oulist`;
423
+ return request(url, getAPICallObject('GET'));
424
+ };
425
+
426
+ export const getOrgLevelCampaignSettings = () => {
427
+ const url = `${CAMPAIGNS_API_ORG_ENDPOINT}/settings`;
428
+ return request(url, getAPICallObject('GET', null, false, true));
429
+ };
430
+
431
+ export const getFacebookVideoId = ({videoUrl, accessToken, actId, pageAccessToken, pageId}) => {
432
+ const url = `${API_ENDPOINT}/facebook/getFacebookVideoId`;
433
+ return request(url, getAPICallObject('POST', {videoUrl, accessToken, actId, pageAccessToken, pageId}));
434
+ };
@@ -10,10 +10,10 @@ const getIsLoggedIn = () => {
10
10
  let isLoggedIn = false;
11
11
  if (process.env.NODE_ENV === "production" && JSON.parse(window.localStorage.getItem('isLoggedIn'))) {
12
12
  isLoggedIn = true;
13
- console.log("Auth wrapper production", isLoggedIn);
13
+
14
14
  } else if (localStorage.getItem("token")) {
15
15
  isLoggedIn = true;
16
- console.log("Auth wrapper development", isLoggedIn);
16
+
17
17
  }
18
18
  return isLoggedIn;
19
19
  };
package/utils/common.js CHANGED
@@ -49,7 +49,7 @@ export function getTreeStructuredTags({tagsList, userLocale = 'en', offerDetails
49
49
  name: tag.label[userLocale] || tag.label.en,
50
50
  value: tag.value,
51
51
  };
52
- } else if (tag['tag-header'] && mainTags[tag.value]) {
52
+ } else if (tag['tag-header'] && mainTags[tag.value]) {
53
53
  // to check it this tag header is already available in mainTags object,
54
54
  //If yes, it will concat the subtag
55
55
  mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
@@ -215,3 +215,15 @@ function getSubTags(subtagsParam) {
215
215
  });
216
216
  return result;
217
217
  }
218
+
219
+ export const bytes2Size = (bytes, decimals = 2) => {
220
+ if (bytes === 0) return '0 Bytes';
221
+
222
+ const k = 1024;
223
+ const dm = decimals < 0 ? 0 : decimals;
224
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
225
+
226
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
227
+
228
+ return `${Math.ceil((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
229
+ };
@@ -174,7 +174,7 @@ let updateSmsData = (chars) => {
174
174
  msgContent = msgContent.replace(/\r/g, " ").replace(/\f/g, " ");
175
175
 
176
176
  const matches = msgContent.split("");
177
- console.log('Test 1', msgContent, matches);
177
+
178
178
  let use7bit = true;
179
179
  let length7bit = 0;
180
180
  let length16bit = 0;
@@ -255,7 +255,7 @@ function _camp1(s) {
255
255
  try {
256
256
  return i18n.dgettext("camp1", s) !== '' ? this.i18n.dgettext("camp1", s) : s;
257
257
  } catch (err) {
258
- console.log('i18n Error', err.message);
258
+
259
259
  return s;
260
260
  }
261
261
  }
@@ -328,7 +328,7 @@ export function updateCharCount(boxVal) {
328
328
 
329
329
  // let unicodeFlag = 0;
330
330
  // let extraChars = 0;
331
- console.log('Box val', boxVal);
331
+
332
332
  let msgCount = 0;
333
333
  const lenCount = smsCharCount(boxVal);
334
334
  const len = lenCount[0];
@@ -337,9 +337,9 @@ export function updateCharCount(boxVal) {
337
337
  const totalChars = lenCount[2].total_chars;
338
338
  const charset = lenCount[2].charset;
339
339
  if (!charset && totalChars > 1000) {
340
- console.log("only 1000 character allowed in normal sms remaining character will be discarded");
340
+
341
341
  } else if (charset && totalChars > 500) {
342
- console.log("only 500 character allowed in unicode sms remaining character will be discarded");
342
+
343
343
  }
344
344
 
345
345
  // return `${len} characters = ${msgCount} Messages*, Characters left: ${charLeft}`;
@@ -139,7 +139,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
139
139
  supportedTagsString += `${supportedTag} ,`;
140
140
  });
141
141
  supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
142
- console.log(supportedTagsString);
142
+
143
143
  if (_.has(val, 'subtags')) {
144
144
  const temp = this.renderTags(val.subtags);
145
145
  list.push((
@@ -17,6 +17,7 @@ import {
17
17
  CapError,
18
18
  CapUploader,
19
19
  CapSpin,
20
+ CapNotification,
20
21
  } from '@capillarytech/cap-ui-library';
21
22
  import {bytes2Size} from '../../utils/common';
22
23
  import './index.scss';
@@ -48,6 +49,7 @@ function CapVideoUpload(props) {
48
49
  previewUrl,
49
50
  videoHeight,
50
51
  videoWidth,
52
+ videoId,
51
53
  } = uploadedAssetList;
52
54
 
53
55
  const [isTemplateDrawerRequired, updateTemplateDrawerRequirement] = useState(false);
@@ -82,11 +84,14 @@ function CapVideoUpload(props) {
82
84
  const metaVideoSrc = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.secure_file_path`, '');
83
85
  const previewImgUrl = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.video_file_path_preview`, '');
84
86
  const metaVideoName = get(videoData, `uploadedAssetDataVideo_${index}.metaInfo.name`, '');
87
+ const metaVideoId = get(videoData, `uploadedAssetDataVideo_${index}.videoIdResponse.fbVideo.id`, '');
88
+
85
89
  if (metaVideoSrc && videoSrc === "") {
86
90
  onVideoUploadUpdateAssestList(index, {
87
91
  previewUrl: previewImgUrl,
88
92
  videoSrc: metaVideoSrc,
89
93
  videoName: metaVideoName,
94
+ videoId: metaVideoId,
90
95
  },
91
96
  );
92
97
  }
@@ -100,6 +105,7 @@ function CapVideoUpload(props) {
100
105
  }
101
106
  }, [videoData[`assetUploadingVideo_${index}`]]);
102
107
 
108
+
103
109
  useEffect(() => {
104
110
  if (!isEmpty(uploadedAssetList)) {
105
111
  const {
@@ -184,12 +190,13 @@ function CapVideoUpload(props) {
184
190
  onVideoUploadUpdateAssestList(
185
191
  index,
186
192
  {
187
- previewUrl,
188
- videoName,
189
- videoHeight,
190
- videoWidth,
191
- videoSrc,
192
- videoDuration,
193
+ previewUrl: "",
194
+ videoName: "",
195
+ videoHeight: "",
196
+ videoWidth: "",
197
+ videoSrc: "",
198
+ videoDuration: "",
199
+ videoId: "",
193
200
  }
194
201
  );
195
202
  };
@@ -204,6 +211,7 @@ function CapVideoUpload(props) {
204
211
  index,
205
212
  {
206
213
  videoSrc,
214
+ videoId,
207
215
  videoName,
208
216
  videoHeight: metaVideoHeight,
209
217
  videoWidth: metaVideoWidth,
@@ -33,7 +33,7 @@ class CustomCard extends React.Component { // eslint-disable-line react/prefer-s
33
33
  }
34
34
 
35
35
  handleMouseHover(data) {
36
- console.log('hover mouse data', data);
36
+
37
37
  this.setState({isHovering: data});
38
38
  this.props.onHover(!this.state.isHovering, this.props.id);
39
39
  }
@@ -166,7 +166,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
166
166
  // setTimeout(() => {
167
167
  // this.editorInstance.name = this.id;
168
168
  // }, 5000);
169
- console.log('nextProps CKEditor', nextProps, this.state.content, this.props.id);
169
+
170
170
  }
171
171
  }
172
172
 
@@ -183,7 +183,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
183
183
  onLoad() {
184
184
  if (this.unmounting) return;
185
185
 
186
- console.log('CKEditor Loading');
186
+
187
187
  if (!window.CKEDITOR) {
188
188
  console.error("CKEditor not found");
189
189
  return;
@@ -191,13 +191,13 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
191
191
 
192
192
  let html = this.props.content;
193
193
  html = html.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"");
194
- console.log("ckeditor loading 1", this.node, html);
194
+
195
195
  this.editorInstance = window.CKEDITOR.appendTo(
196
196
  this.node,
197
197
  this.state.config,
198
198
  html
199
199
  );
200
- console.log('2');
200
+
201
201
 
202
202
  if (this.props.getEditorInstanse) {
203
203
  this.props.getEditorInstanse(this.editorInstance, this.props.id);
@@ -248,7 +248,7 @@ class Ckeditor extends React.Component { // eslint-disable-line react/prefer-sta
248
248
  };
249
249
 
250
250
  render() {
251
- console.log('ckeditor loading render', this.props);
251
+
252
252
  return (
253
253
  <div id={this.props.id} style={{borderRight: "1px solid #000 !important"}}>
254
254
  <div className={this.props.activeClass} ref={(node) => (this.node = node)}/>
@@ -17,17 +17,17 @@ import messages from './messages';
17
17
 
18
18
  class CustomPopOver extends React.Component { // eslint-disable-line react/prefer-stateless-function
19
19
  componentWillMount() {
20
- console.log('popOver List ', this.props.popOverList, this.props.excludeList);
20
+
21
21
  }
22
22
 
23
23
  componentWillReceiveProps(nextProps) {
24
- console.log('next popOver List ', nextProps.popOverList, nextProps.excludeList);
24
+
25
25
  }
26
26
 
27
27
  renderPopoverContent() {
28
28
  const elem = [];
29
29
  _.forEach(this.props.popOverList, (content, index) => {
30
- console.log('PopOver Content', content);
30
+
31
31
  if (this.props.excludeList.indexOf(content.iso_code) === -1) {
32
32
  elem.push(
33
33
  <p style={{ cursor: "pointer"}} key={index} onClick={() => this.props.handlePopOverClick(content)}>{content.language}</p>
@@ -25,13 +25,13 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
25
25
  }
26
26
 
27
27
  componentDidMount() {
28
- console.log('current language edm editor mounted', this.props.id, this.props.edmSrc);
28
+
29
29
  }
30
30
 
31
31
  componentWillReceiveProps(nextProps) {
32
- console.log('current language nextProps', nextProps, nextProps.id, nextProps.edmSrc);
32
+
33
33
  // if (!_.isEqual(nextProps.content, this.props.content)) {
34
- // console.log(nextProps.content);
34
+ //
35
35
  // this.editorInstance.content = nextProps.content;
36
36
  // }
37
37
  }
@@ -41,7 +41,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
41
41
  }
42
42
 
43
43
  render() {
44
- console.log('current language edm editor loading', this.props.id, this.props.edmSrc);
44
+
45
45
  return (
46
46
  this.props.edmSrc ?
47
47
  (<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
@@ -17,15 +17,15 @@ import moment from 'moment';
17
17
  import EmailPreviewV2 from '../EmailPreviewV2';
18
18
  import messages from '../EmailPreviewV2/messages';
19
19
  import './index.scss';
20
- import mobileBody from '../../assets/mobile.png';
20
+ import mobileBody from '../../assets/DeviceForEmail.png';
21
21
  import { removeLinksFromHtmlContent } from './../../utils/common';
22
22
  import {selectTemplateContent} from '../../containers/Templates/selectors';
23
23
  import * as templateActions from '../../containers/Templates/actions';
24
24
 
25
25
  const deviceAspectRatio = {
26
26
  mobile: {
27
- height: "415",
28
- width: "238",
27
+ height: "541",
28
+ width: "340",
29
29
  },
30
30
  };
31
31
 
@@ -95,7 +95,7 @@ class EmailMobilePreview extends React.Component {
95
95
  )}
96
96
  <div className={"shell align-center"}>
97
97
 
98
- <img src={mobileBody} alt="capillary" width="270" />
98
+ <img src={mobileBody} alt="capillary" width="386" />
99
99
  <div className={`${messageContainerName} ${emailSubjectLabel ? 'with-subject' : ''}`}>
100
100
  {emailSubjectLabel}
101
101
  <iframe srcDoc={copyContent} {...deviceAspectRatio.mobile} >
@@ -18,7 +18,7 @@ import moment from 'moment';
18
18
  import messages from './messages';
19
19
  import './_emailPreviewV2.scss';
20
20
  import tabletBody from '../../assets/iPad.svg';
21
- import mobileBody from '../../assets/mobile.png';
21
+ import mobileBody from '../../assets/DeviceForEmail.png';
22
22
  import { removeLinksFromHtmlContent } from './../../utils/common';
23
23
 
24
24
  import {selectTemplateContent} from '../../v2Containers/Templates/selectors';
@@ -34,8 +34,8 @@ const deviceAspectRatio = {
34
34
  width: "450",
35
35
  }),
36
36
  mobile: (emailSubject) => ({
37
- height: emailSubject ? "570" : "600",
38
- width: "310",
37
+ height: emailSubject ? "541" : "511",
38
+ width: "340",
39
39
  }),
40
40
  };
41
41
  const devices = {
@@ -127,7 +127,7 @@ class EmailPreviewV2 extends React.Component {
127
127
  tab: <StyledCapIcon type="mobile" active={currentDevice === 'mobile'} />,
128
128
  content: (<div className="email-preview-container">
129
129
  <div className="shell align-center">
130
- <img src={mobileBody} alt="capillary" width="350" />
130
+ <img src={mobileBody} alt="capillary" width="386" />
131
131
  {iframeDiv}
132
132
  </div>
133
133
  </div>),