@capillarytech/creatives-library 7.5.4 → 7.5.6

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 (48) hide show
  1. package/assets/facebookEmptyPlaceholder.png +0 -0
  2. package/config/app.js +2 -0
  3. package/index.js +6 -0
  4. package/package.json +1 -1
  5. package/reducers.js +2 -1
  6. package/routes.js +5 -0
  7. package/services/api.js +34 -1
  8. package/utils/common.js +13 -1
  9. package/v2Components/CapImageUpload/index.js +260 -0
  10. package/v2Components/CapImageUpload/index.scss +32 -0
  11. package/v2Components/CapImageUpload/messages.js +49 -0
  12. package/v2Components/CapRadioCardCustom/index.js +66 -0
  13. package/v2Components/CapVideoUpload/index.js +299 -0
  14. package/v2Components/CapVideoUpload/index.scss +29 -0
  15. package/v2Components/CapVideoUpload/messages.js +54 -0
  16. package/v2Components/TemplatePreview/index.js +19 -2
  17. package/v2Containers/App/constants.js +21 -0
  18. package/v2Containers/Cap/messages.js +30 -0
  19. package/v2Containers/CapFacebookPreview/actions.js +31 -0
  20. package/v2Containers/CapFacebookPreview/constants.js +21 -0
  21. package/v2Containers/CapFacebookPreview/index.js +396 -0
  22. package/v2Containers/CapFacebookPreview/messages.js +138 -0
  23. package/v2Containers/CapFacebookPreview/reducer.js +37 -0
  24. package/v2Containers/CapFacebookPreview/sagas.js +99 -0
  25. package/v2Containers/CapFacebookPreview/selectors.js +25 -0
  26. package/v2Containers/CreativesContainer/SlideBoxContent.js +55 -1
  27. package/v2Containers/CreativesContainer/index.js +19 -9
  28. package/v2Containers/Facebook/Advertisement/constant.js +12 -0
  29. package/v2Containers/Facebook/Advertisement/index.js +955 -0
  30. package/v2Containers/Facebook/Advertisement/index.scss +49 -0
  31. package/v2Containers/Facebook/Advertisement/messages.js +155 -0
  32. package/v2Containers/Facebook/Advertisement/video.js +0 -0
  33. package/v2Containers/Facebook/actions.js +62 -0
  34. package/v2Containers/Facebook/constants.js +25 -1
  35. package/v2Containers/Facebook/index.js +133 -107
  36. package/v2Containers/Facebook/reducer.js +95 -1
  37. package/v2Containers/Facebook/sagas.js +136 -0
  38. package/v2Containers/Facebook/selectors.js +10 -0
  39. package/v2Containers/Line/Container/Video/index.js +38 -41
  40. package/v2Containers/Templates/_templates.scss +26 -0
  41. package/v2Containers/Templates/actions.js +14 -1
  42. package/v2Containers/Templates/constants.js +8 -0
  43. package/v2Containers/Templates/index.js +117 -10
  44. package/v2Containers/Templates/messages.js +8 -4
  45. package/v2Containers/Templates/reducer.js +22 -0
  46. package/v2Containers/Templates/sagas.js +26 -1
  47. package/v2Containers/TemplatesV2/index.js +13 -13
  48. package/v2Containers/Viber/index.js +2 -1
@@ -8,14 +8,34 @@ import { fromJS } from 'immutable';
8
8
  import {
9
9
  SET_MARKETING_OBJECTIVES_SUCCESS,
10
10
  SET_MARKETING_OBJECTIVES_FAILURE,
11
+ UPLOAD_FB_AD_ASSET_REQUEST,
12
+ UPLOAD_FB_AD_ASSET_SUCCESS,
13
+ UPLOAD_FB_AD_ASSET_FAILURE,
14
+ CREATE_FACEBOOK_AD_TEMPLATE_REQUEST,
15
+ CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS,
16
+ CREATE_FACEBOOK_AD_TEMPLATE_FAILURE,
17
+ CLEAR_FACEBOOK_AD_ASSET,
18
+ EDIT_FACEBOOK_AD_TEMPLATE_REQUEST,
19
+ EDIT_FACEBOOK_AD_TEMPLATE_SUCCESS,
20
+ EDIT_FACEBOOK_AD_TEMPLATE_FAILURE,
21
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST,
22
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS,
23
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE,
24
+ CLEAR_FACEBOOK_AD_EDIT_RESPONSE_REQUEST,
25
+ CLEAR_FACEBOOK_AD_CREATE_RESPONSE_REQUEST,
26
+ CLEAR_FACEBOOK_AD_DATA,
27
+ GET_ORG_OU_LIST_REQUEST,
28
+ GET_ORG_OU_LIST_FAILURE,
29
+ GET_ORG_OU_LIST_SUCCESS,
11
30
  } from './constants';
12
31
 
13
32
  export const initialState = fromJS({
14
33
  marketinObjectives: {},
34
+ uploadedAssetData: {},
15
35
  });
16
36
 
17
37
  function facebookReducer(state = initialState, action) {
18
- const { type, payload } = action;
38
+ const { type, payload, templateType} = action;
19
39
  switch (type) {
20
40
  case SET_MARKETING_OBJECTIVES_SUCCESS: {
21
41
  return state.set('marketinObjectivesData', payload).set('marketinObjectivesError', null);
@@ -23,6 +43,80 @@ function facebookReducer(state = initialState, action) {
23
43
  case SET_MARKETING_OBJECTIVES_FAILURE: {
24
44
  return state.set('marketinObjectivesData', []).set('marketinObjectivesError', payload);
25
45
  }
46
+ case UPLOAD_FB_AD_ASSET_REQUEST:
47
+ return state
48
+ .set('uploadAssetSuccess', false)
49
+ .set(templateType !== undefined ? `assetUploading${templateType}` : 'assetUploading', true);
50
+ case UPLOAD_FB_AD_ASSET_SUCCESS:
51
+ return state
52
+ .set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
53
+ .set(templateType !== undefined ? `assetUploading${templateType}` : 'assetUploading', false)
54
+ .set(templateType !== undefined ? `uploadedAssetData${templateType}` : 'uploadedAssetData', action.data);
55
+ case UPLOAD_FB_AD_ASSET_FAILURE:
56
+ return state
57
+ .set('uploadAssetSuccess', false)
58
+ .set(templateType !== undefined ? `assetUploading${templateType}` : 'assetUploading', false);
59
+ case CREATE_FACEBOOK_AD_TEMPLATE_REQUEST:
60
+ return state
61
+ .set('createTemplateInProgress', true)
62
+ .set('createTemplateError', false)
63
+ .set('createTemplateErrorMessage', fromJS(""));
64
+ case CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS:
65
+ return state.set('createTemplateInProgress', false)
66
+ .set('response', action.data)
67
+ .set('createTemplateError', (action.statusCode !== undefined && action.statusCode > 300))
68
+ .set('createTemplateErrorMessage', fromJS(action.errorMsg));
69
+ case CREATE_FACEBOOK_AD_TEMPLATE_FAILURE:
70
+ return state
71
+ .set('createTemplateInProgress', false)
72
+ .set('createTemplateError', true)
73
+ .set('createTemplateErrorMessage', fromJS(action.errorMsg));
74
+ case CLEAR_FACEBOOK_AD_ASSET:
75
+ return state
76
+ .delete(templateType !== undefined ? `uploadedAssetData${templateType}` : 'uploadedAssetData');
77
+ // FOR EDIT
78
+ case EDIT_FACEBOOK_AD_TEMPLATE_REQUEST:
79
+ return state
80
+ .set('editTemplateInProgress', true)
81
+ .set('editTemplateError', false)
82
+ .set('editTemplateErrorMessage', fromJS(""));
83
+ case EDIT_FACEBOOK_AD_TEMPLATE_SUCCESS:
84
+ return state.set('editTemplateInProgress', false)
85
+ .set('editResponse', action.data)
86
+ .set('editTemplateError', (action.statusCode !== undefined && action.statusCode > 300))
87
+ .set('editTemplateErrorMessage', fromJS(action.errorMsg));
88
+ case EDIT_FACEBOOK_AD_TEMPLATE_FAILURE:
89
+ return state
90
+ .set('editTemplateInProgress', false)
91
+ .set('editTemplateError', true)
92
+ .set('editTemplateErrorMessage', fromJS(action.errorMsg));
93
+ case GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST:
94
+ return state.set('getTemplateDetailsInProgress', true);
95
+ case GET_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS:
96
+ return state.set('getTemplateDetailsInProgress', false)
97
+ .set('templateDetails', action.data);
98
+ case GET_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE:
99
+ case CLEAR_FACEBOOK_AD_EDIT_RESPONSE_REQUEST:
100
+ return state.set('editResponse', {});
101
+ case CLEAR_FACEBOOK_AD_CREATE_RESPONSE_REQUEST:
102
+ return state.set('response', {});
103
+ case CLEAR_FACEBOOK_AD_DATA:
104
+ return state
105
+ .delete('uploadedAssetData')
106
+ .delete('metaEntities')
107
+ .delete('templateDetails');
108
+ case GET_ORG_OU_LIST_REQUEST: {
109
+ return state.set('orgOuData', fromJS({ status: 'REQUEST' }));
110
+ }
111
+ case GET_ORG_OU_LIST_SUCCESS: {
112
+ return state.set(
113
+ 'orgOuData',
114
+ fromJS({ status: 'SUCCESS', data: action.payload }),
115
+ );
116
+ }
117
+ case GET_ORG_OU_LIST_FAILURE: {
118
+ return state.set('orgOuData', fromJS({ status: 'FAILURE' }));
119
+ }
26
120
  default:
27
121
  return state;
28
122
  }
@@ -5,6 +5,21 @@ import {
5
5
  GET_MARKETING_OBJECTIVES,
6
6
  SET_MARKETING_OBJECTIVES_SUCCESS,
7
7
  SET_MARKETING_OBJECTIVES_FAILURE,
8
+ UPLOAD_FB_AD_ASSET_REQUEST,
9
+ UPLOAD_FB_AD_ASSET_SUCCESS,
10
+ UPLOAD_FB_AD_ASSET_FAILURE,
11
+ CREATE_FACEBOOK_AD_TEMPLATE_REQUEST,
12
+ CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS,
13
+ CREATE_FACEBOOK_AD_TEMPLATE_FAILURE,
14
+ EDIT_FACEBOOK_AD_TEMPLATE_REQUEST,
15
+ EDIT_TEMPLATE_FACEBOOK_AD_SUCCESS,
16
+ EDIT_FACEBOOK_AD_TEMPLATE_FAILURE,
17
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST,
18
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS,
19
+ GET_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE,
20
+ GET_ORG_OU_LIST_FAILURE,
21
+ GET_ORG_OU_LIST_SUCCESS,
22
+ GET_ORG_OU_LIST_REQUEST,
8
23
  } from './constants';
9
24
 
10
25
  export function* fetchMarketingObjectives() {
@@ -29,13 +44,134 @@ export function* fetchMarketingObjectives() {
29
44
  });
30
45
  }
31
46
  }
47
+ export function* getOrgOUs({ orgID } = {}) {
48
+ try {
49
+ const apiResponse = yield call(Api.getOrgOUs, { orgID });
50
+ if (apiResponse.status === 200) {
51
+ yield put({
52
+ type: GET_ORG_OU_LIST_SUCCESS,
53
+ payload: apiResponse.result,
54
+ });
55
+ } else {
56
+ yield put({
57
+ type: GET_ORG_OU_LIST_FAILURE,
58
+ payload: apiResponse,
59
+ });
60
+ }
61
+ } catch (error) {
62
+ yield put({
63
+ type: GET_ORG_OU_LIST_FAILURE,
64
+ payload: error,
65
+ });
66
+ }
67
+ }
68
+
69
+ export function* uploadFbAdAsset(file, assetType, fileParams ) {
70
+ try {
71
+ const result = yield call(Api.uploadFile, file, assetType, fileParams);
72
+ yield put({
73
+ type: UPLOAD_FB_AD_ASSET_SUCCESS,
74
+ data: result.response.asset,
75
+ statusCode: result.status ? result.status.code : '',
76
+ templateType: file.templateType,
77
+ });
78
+ } catch (error) {
79
+ yield put({ type: UPLOAD_FB_AD_ASSET_FAILURE, error });
80
+ }
81
+ }
82
+ export function* createFacebookADTemplate({ template, callback }) {
83
+ let errorMsg;
84
+ try {
85
+ const result = yield call(Api.createFacebookADTemplate, { template });
86
+ if (result.status.code >= 400) {
87
+ errorMsg = result.message;
88
+ throw errorMsg;
89
+ }
90
+ yield put({ type: CREATE_FACEBOOK_AD_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
91
+ if (callback) {
92
+ callback(result.response);
93
+ }
94
+ } catch (error) {
95
+ yield put({ type: CREATE_FACEBOOK_AD_TEMPLATE_FAILURE, error, errorMsg });
96
+ if (callback) {
97
+ callback(null, errorMsg);
98
+ }
99
+ }
100
+ }
101
+
102
+
103
+ export function* editTemplate({ template, callback }) {
104
+ let errorMsg;
105
+ try {
106
+ const result = yield call(Api.createFacebookADTemplate, {template});
107
+ if (result.status.code >= 400) {
108
+ errorMsg = result.message;
109
+ throw errorMsg;
110
+ }
111
+ if (callback) {
112
+ callback(result.response);
113
+ }
114
+ yield put({ type: EDIT_TEMPLATE_FACEBOOK_AD_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg });
115
+ } catch (error) {
116
+ yield put({ type: EDIT_FACEBOOK_AD_TEMPLATE_FAILURE, error, errorMsg });
117
+ if (callback) {
118
+ callback(null, errorMsg);
119
+ }
120
+ }
121
+ }
122
+
123
+ export function* getTemplateDetails({id, callback}) {
124
+ try {
125
+ const result = yield call(Api.getTemplateDetails, {id, channel: 'FACEBOOK'});
126
+ yield put({ type: GET_FACEBOOK_AD_TEMPLATE_DETAILS_SUCCESS, data: result.response });
127
+ if (callback) {
128
+ callback(false);
129
+ }
130
+ } catch (error) {
131
+ yield put({ type: GET_FACEBOOK_AD_TEMPLATE_DETAILS_FAILURE, error });
132
+ }
133
+ }
134
+
135
+
136
+ function* watchCreateTemplate() {
137
+ const watcher = yield takeLatest(CREATE_FACEBOOK_AD_TEMPLATE_REQUEST, createFacebookADTemplate);
138
+ yield take(LOCATION_CHANGE);
139
+ yield cancel(watcher);
140
+ }
141
+
142
+ function* watchGetTemplateDetails() {
143
+ const watcher = yield takeLatest(GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
144
+ yield take(LOCATION_CHANGE);
145
+ yield cancel(watcher);
146
+ }
147
+
148
+ function* watchEditTemplate() {
149
+ const watcher = yield takeLatest(EDIT_FACEBOOK_AD_TEMPLATE_REQUEST, editTemplate);
150
+ yield take(LOCATION_CHANGE);
151
+ yield cancel(watcher);
152
+ }
153
+
32
154
 
33
155
  function* watchFetchMarketingObjective() {
34
156
  const watcher = yield takeLatest(GET_MARKETING_OBJECTIVES, fetchMarketingObjectives);
35
157
  yield take(LOCATION_CHANGE);
36
158
  yield cancel(watcher);
37
159
  }
160
+ function* watchUploadFbADAsset() {
161
+ const watcher = yield takeLatest(UPLOAD_FB_AD_ASSET_REQUEST, uploadFbAdAsset);
162
+ yield take(LOCATION_CHANGE);
163
+ yield cancel(watcher);
164
+ }
165
+ export function* watchGetOrgOUs() {
166
+ yield takeLatest(GET_ORG_OU_LIST_REQUEST, getOrgOUs);
167
+ }
38
168
 
39
169
  export default [
40
170
  watchFetchMarketingObjective,
171
+ watchUploadFbADAsset,
172
+ watchEditTemplate,
173
+ watchGetTemplateDetails,
174
+ watchCreateTemplate,
175
+ watchGetOrgOUs,
41
176
  ];
177
+
@@ -5,6 +5,11 @@ import { createSelector } from 'reselect';
5
5
  */
6
6
  const selectFacebookDomain = () => (state) => state.get('facebook');
7
7
 
8
+ const selectTemplateDomain = () => (state) => state.get('templates');
9
+ export const makeSelectTemplate = () => createSelector(
10
+ selectTemplateDomain(),
11
+ (substate) => substate && substate.toJS()
12
+ );
8
13
  /**
9
14
  * Other specific selectors
10
15
  */
@@ -18,3 +23,8 @@ export const makeSelectMarketingObjectiveList = () => createSelector(
18
23
  selectFacebookDomain(),
19
24
  (substate) => substate && substate.get('marketinObjectivesData'),
20
25
  );
26
+
27
+ export const makeSelectFbAd = () => createSelector(
28
+ selectFacebookDomain(),
29
+ (substate) => substate && substate.toJS()
30
+ );
@@ -46,7 +46,6 @@ export const LineVideo = ({
46
46
  updateUploadedAssetList,
47
47
  deleteUploadedImgList,
48
48
  }) => {
49
-
50
49
  if (activeKey !== 'video') {
51
50
  return null;
52
51
  }
@@ -118,7 +117,7 @@ export const LineVideo = ({
118
117
  updateVideoDuration(videoDuration);
119
118
  updateActionUrl(linkUri || actionUrl);
120
119
  updateActionLabel(videoActionLabel);
121
- updateSelectedAction(selectedAction || (!!videoActionLabel ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON));
120
+ updateSelectedAction(selectedAction || (videoActionLabel ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON));
122
121
  updateTitle(altText);
123
122
  if (videoPreviewUrl) {
124
123
  updateImagePreview(videoPreviewUrl);
@@ -224,11 +223,9 @@ export const LineVideo = ({
224
223
  messageType: 'videoSrc',
225
224
  });
226
225
  }
227
- }
226
+ };
228
227
 
229
- const checkAction = useCallback((label = actionLabel, url = actionUrl, type = selectedAction) => {
230
- return type === DISPLAY_ACTION_BUTTON ? (url && label && !updateActionLabelError(label) && !updateActionUrlError(url)) : true;
231
- }, [actionLabel, actionUrl, selectedAction]);
228
+ const checkAction = useCallback((label = actionLabel, url = actionUrl, type = selectedAction) => type === DISPLAY_ACTION_BUTTON ? (url && label && !updateActionLabelError(label) && !updateActionUrlError(url)) : true, [actionLabel, actionUrl, selectedAction]);
232
229
 
233
230
  const submitVideoAction = useCallback((data, incorrectFile) => {
234
231
  const {
@@ -305,7 +302,7 @@ export const LineVideo = ({
305
302
  selectedAction,
306
303
  messageType: 'videoSrc',
307
304
  });
308
- }
305
+ };
309
306
 
310
307
  const onReUpload = () => {
311
308
  updateVideoStatus(false);
@@ -332,24 +329,24 @@ export const LineVideo = ({
332
329
  selectedAction,
333
330
  messageType: 'videoSrc',
334
331
  });
335
- }
332
+ };
336
333
 
337
334
  const onSelectTemplate = useCallback((event) => {
338
335
  event.stopPropagation();
339
336
  updateTemplateDrawerRequirement(true);
340
- }, [])
337
+ }, []);
341
338
 
342
339
  const playVideo = (e) => {
343
340
  if (e.target.paused && !isPlaying) {
344
341
  e.target.play();
345
342
  }
346
- }
343
+ };
347
344
 
348
345
  const pauseVideo = (e) => {
349
346
  if (!e.target.paused && isPlaying) {
350
347
  e.target.pause();
351
348
  }
352
- }
349
+ };
353
350
 
354
351
  const getVideoSection = () => {
355
352
  if (!isVideo) {
@@ -412,7 +409,7 @@ export const LineVideo = ({
412
409
  onMouseOut={pauseVideo}
413
410
  ref={videoEl}
414
411
  >
415
- <source src={videoSrc} type="video/mp4" />
412
+ <source src={videoSrc} type="video/mp4" />
416
413
  </video>
417
414
  <div style={{ marginLeft: CAP_SPACE_24 }}>
418
415
  <CapHeading type="h6">
@@ -425,7 +422,7 @@ export const LineVideo = ({
425
422
  </div>
426
423
  </Fragment>
427
424
  );
428
- }
425
+ };
429
426
 
430
427
  const onTitleChange = ({ target: { value } }) => {
431
428
  updateTitle(value);
@@ -451,7 +448,7 @@ export const LineVideo = ({
451
448
  selectedAction,
452
449
  messageType: 'videoSrc',
453
450
  });
454
- }
451
+ };
455
452
 
456
453
  const onChangeSelectedAction = () => {
457
454
  event.stopPropagation();
@@ -474,7 +471,7 @@ export const LineVideo = ({
474
471
  selectedAction: value,
475
472
  messageType: 'videoSrc',
476
473
  });
477
- }
474
+ };
478
475
 
479
476
  const updateActionLabelError = (value = '') => {
480
477
  if (value.length > MAX_ACTION_LABEL_LENGTH) {
@@ -486,7 +483,7 @@ export const LineVideo = ({
486
483
  } else {
487
484
  updateActionLabelErrorMessage();
488
485
  }
489
- }
486
+ };
490
487
 
491
488
  const updateActionUrlError = (value) => {
492
489
  if (value === '') {
@@ -498,7 +495,7 @@ export const LineVideo = ({
498
495
  } else {
499
496
  updateActionUrlErrorMessage();
500
497
  }
501
- }
498
+ };
502
499
 
503
500
  const onActionLabelChange = ({ target: { value } }) => {
504
501
  updateActionLabel(value);
@@ -520,7 +517,7 @@ export const LineVideo = ({
520
517
  selectedAction,
521
518
  messageType: 'videoSrc',
522
519
  });
523
- }
520
+ };
524
521
 
525
522
  const onActionUrlChange = ({ target: { value } }) => {
526
523
  updateActionUrl(value);
@@ -542,10 +539,9 @@ export const LineVideo = ({
542
539
  selectedAction,
543
540
  messageType: 'videoSrc',
544
541
  });
545
- }
542
+ };
546
543
 
547
- const getActionSection = () => {
548
- return (
544
+ const getActionSection = () => (
549
545
  <>
550
546
  <CapHeading type="h6" style={{ marginTop: CAP_SPACE_12 }}>
551
547
  <FormattedMessage {...messages.actionButtonLabel} />
@@ -558,12 +554,12 @@ export const LineVideo = ({
558
554
  options={[
559
555
  {
560
556
  label: 'Hide',
561
- value: HIDE_ACTION_BUTTON
557
+ value: HIDE_ACTION_BUTTON,
562
558
  },
563
559
  {
564
560
  label: 'Display',
565
- value: DISPLAY_ACTION_BUTTON
566
- }
561
+ value: DISPLAY_ACTION_BUTTON,
562
+ },
567
563
  ]}
568
564
  />
569
565
  {
@@ -593,18 +589,18 @@ export const LineVideo = ({
593
589
  : null
594
590
  }
595
591
  </>
596
- )
597
- }
592
+ );
598
593
 
599
594
  const getLineVideoSection = () => {
600
595
  if (!isCreateNew) {
601
596
  return (
602
- <div className="form-builder-dragger" style={{
603
- textAlign: 'center',
604
- border: `1px dashed ${CAP_G06}`,
605
- minHeight: 120,
606
- padding: 60
607
- }}>
597
+ <div
598
+ className="form-builder-dragger" style={{
599
+ textAlign: 'center',
600
+ border: `1px dashed ${CAP_G06}`,
601
+ minHeight: 120,
602
+ padding: 60,
603
+ }}>
608
604
  <CapHeader
609
605
  className="choice-title"
610
606
  size="regular"
@@ -634,7 +630,8 @@ export const LineVideo = ({
634
630
  >
635
631
  <FormattedMessage {...messages.textMessageSelectTemplate} />
636
632
  </CapButton>
637
- </div>);
633
+ </div>
634
+ );
638
635
  } else {
639
636
  return (
640
637
  <>
@@ -652,7 +649,7 @@ export const LineVideo = ({
652
649
  </>
653
650
  );
654
651
  }
655
- }
652
+ };
656
653
 
657
654
  const setNewContent = useCallback(() => updateCreateNew(true), []);
658
655
 
@@ -688,9 +685,9 @@ export const LineVideo = ({
688
685
  updateVideoDuration(videoDuration);
689
686
  updateActionUrl(linkUri);
690
687
  updateActionLabel(label);
691
- updateSelectedAction(!!label ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON);
688
+ updateSelectedAction(label ? DISPLAY_ACTION_BUTTON : HIDE_ACTION_BUTTON);
692
689
  updateTitle(altText);
693
- }
690
+ };
694
691
 
695
692
  const getLineVideoDrawerContent = () => {
696
693
  const lineTextTemplates = Templates.templates;
@@ -699,8 +696,8 @@ export const LineVideo = ({
699
696
  }
700
697
 
701
698
  const cardDataList = [];
702
- lineTextTemplates.forEach(template => {
703
- let templateData = {};
699
+ lineTextTemplates.forEach((template) => {
700
+ const templateData = {};
704
701
  const {
705
702
  content: {
706
703
  messages: [{
@@ -780,7 +777,7 @@ export const LineVideo = ({
780
777
  />
781
778
  </form>
782
779
  </div>
783
- )
784
- }
780
+ );
781
+ };
785
782
 
786
- export default injectIntl(withStyles(LineVideo, style));
783
+ export default injectIntl(withStyles(LineVideo, style));
@@ -20,6 +20,32 @@
20
20
 
21
21
  .creatives-templates-list {
22
22
  .pagination-container {
23
+ .FACEBOOK {
24
+ .ant-card-body {
25
+ background-color: $CAP_G09;
26
+ height: 320px;
27
+ }
28
+
29
+ &.no-image .ant-card-meta {
30
+ height: 276px;
31
+ background: $CAP_WHITE;
32
+ padding: $CAP_SPACE_16 $CAP_SPACE_12;
33
+
34
+ .ant-card-meta-description {
35
+ height: 250px;
36
+ word-wrap: break-word;
37
+ }
38
+ }
39
+
40
+ &.carousel-img-section {
41
+ .ant-card-body {
42
+ padding: $CAP_SPACE_24 0;
43
+ }
44
+ .ant-card-meta {
45
+ padding: 0;
46
+ }
47
+ }
48
+ }
23
49
  .LINE {
24
50
  .ant-card-body {
25
51
  background-color: $CAP_G09;
@@ -7,7 +7,7 @@
7
7
  import * as types from './constants';
8
8
 
9
9
  export function getAllTemplates(channel, queryParams) {
10
- console.log('get all templates action trigereed', channel, queryParams);
10
+ // console.log('get all templates action trigereed', channel, queryParams);
11
11
  return {
12
12
  type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
13
13
  };
@@ -44,6 +44,12 @@ export function getWeCrmAccounts(source) {
44
44
  };
45
45
  }
46
46
 
47
+ export function getAccountsSettings() {
48
+ return {
49
+ type: types.GET_ORG_LEVEL_CAMPAIGN_SETTINGS_REQUEST,
50
+ };
51
+ }
52
+
47
53
  export function setWeChatAccount(weChatAccount) {
48
54
  console.log('setting wechat account', weChatAccount);
49
55
  return {
@@ -66,6 +72,13 @@ export function setViberAccount(viberAccount) {
66
72
  };
67
73
  }
68
74
 
75
+ export function setFacebookAccount(faceBookAccount) {
76
+ return {
77
+ type: types.SET_FACEBOOK_ACCOUNT,
78
+ faceBookAccount,
79
+ };
80
+ }
81
+
69
82
  export function handleHtmlUpload(selectedTemplate) {
70
83
  return {
71
84
  type: types.SET_SELECTED_LAYOUT,
@@ -44,8 +44,16 @@ export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPL
44
44
 
45
45
  export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
46
46
  export const SET_VIBER_ACCOUNT = "app/v2Containers/Templates/SET_VIBER_ACCOUNT";
47
+ export const SET_FACEBOOK_ACCOUNT = "app/v2Containers/Templates/SET_FACEBOOK_ACCOUNT";
47
48
 
48
49
 
49
50
  export const GET_DEAFULT_BEE_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_REQUEST';
50
51
  export const GET_DEAFULT_BEE_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_SUCCESS';
51
52
  export const GET_DEAFULT_BEE_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_FAILURE';
53
+
54
+ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_REQUEST =
55
+ 'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_REQUEST';
56
+ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS =
57
+ 'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS';
58
+ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE =
59
+ 'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE';