@capillarytech/creatives-library 7.1.6 → 7.1.10

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 (66) hide show
  1. package/config/app.js +0 -2
  2. package/index.js +1 -15
  3. package/package.json +1 -2
  4. package/reducers.js +1 -4
  5. package/routes.js +1 -7
  6. package/services/api.js +0 -11
  7. package/utils/common.js +0 -178
  8. package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
  9. package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
  10. package/v2Components/TemplatePreview/index.js +18 -108
  11. package/v2Containers/App/constants.js +3 -5
  12. package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -84
  13. package/v2Containers/CreativesContainer/SlideBoxHeader.js +0 -2
  14. package/v2Containers/CreativesContainer/constants.js +0 -4
  15. package/v2Containers/CreativesContainer/index.js +5 -48
  16. package/v2Containers/Email/index.js +0 -1
  17. package/v2Containers/Line/Create/_lineCreate.scss +64 -0
  18. package/v2Containers/Line/Create/actions.js +94 -0
  19. package/v2Containers/Line/Create/constants.js +43 -0
  20. package/v2Containers/Line/Create/index.js +1132 -0
  21. package/v2Containers/Line/Create/initialSchema.js +378 -0
  22. package/v2Containers/Line/Create/messages.js +229 -0
  23. package/v2Containers/Line/Create/reducer.js +99 -0
  24. package/v2Containers/Line/Create/sagas.js +113 -0
  25. package/v2Containers/Line/Create/selectors.js +30 -0
  26. package/v2Containers/Line/CreateWrapper/constants.js +2 -0
  27. package/v2Containers/Line/CreateWrapper/index.js +117 -0
  28. package/v2Containers/Line/CreateWrapper/messages.js +55 -0
  29. package/v2Containers/Line/Edit/_lineEdit.scss +23 -0
  30. package/v2Containers/Line/Edit/actions.js +79 -0
  31. package/v2Containers/Line/Edit/constants.js +27 -0
  32. package/v2Containers/Line/Edit/index.js +1051 -0
  33. package/v2Containers/Line/Edit/messages.js +173 -0
  34. package/v2Containers/Line/Edit/reducer.js +83 -0
  35. package/v2Containers/Line/Edit/sagas.js +81 -0
  36. package/v2Containers/Line/Edit/selectors.js +29 -0
  37. package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
  38. package/v2Containers/Line/Edit/tests/index.test.js +10 -0
  39. package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
  40. package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
  41. package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
  42. package/v2Containers/Templates/_templates.scss +0 -57
  43. package/v2Containers/Templates/actions.js +110 -117
  44. package/v2Containers/Templates/constants.js +0 -2
  45. package/v2Containers/Templates/index.js +7 -88
  46. package/v2Containers/Templates/messages.js +0 -4
  47. package/v2Containers/Templates/reducer.js +0 -2
  48. package/v2Containers/TemplatesV2/index.js +1 -22
  49. package/v2Containers/TemplatesV2/messages.js +0 -8
  50. package/assets/viber.png +0 -0
  51. package/v2Components/TemplatePreview/assets/images/viberMobile.svg +0 -135
  52. package/v2Containers/FTP/_FTP.scss +0 -103
  53. package/v2Containers/FTP/actions.js +0 -7
  54. package/v2Containers/FTP/constants.js +0 -3
  55. package/v2Containers/FTP/index.js +0 -534
  56. package/v2Containers/FTP/messages.js +0 -60
  57. package/v2Containers/FTP/reducer.js +0 -32
  58. package/v2Containers/FTP/sagas.js +0 -26
  59. package/v2Containers/FTP/selectors.js +0 -20
  60. package/v2Containers/Viber/actions.js +0 -74
  61. package/v2Containers/Viber/constants.js +0 -30
  62. package/v2Containers/Viber/index.js +0 -727
  63. package/v2Containers/Viber/messages.js +0 -145
  64. package/v2Containers/Viber/reducer.js +0 -84
  65. package/v2Containers/Viber/sagas.js +0 -107
  66. package/v2Containers/Viber/selectors.js +0 -21
@@ -16,19 +16,15 @@ import {updateCharCount} from '../../utils/smsCharCountV2';
16
16
  import messages from './messages';
17
17
  import { WECHAT } from '../../v2Containers/CreativesContainer/constants';
18
18
  import Carousel from '../Carousel';
19
- import { VIBER } from '../../v2Containers/App/constants';
20
19
  const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
21
20
  const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
22
21
  const lineMobileAndroid = require('../../assets/line.png');
23
- const viberMobileAndroid = require('./assets/images/viberMobile.svg');
24
-
25
22
  const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
26
23
  const lineStickerPlaceholder = require('../../assets/smiley-placeholder.svg');
27
24
  const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
28
25
  const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
29
26
  const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
30
-
31
- import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08, CAP_G06, CAP_G15, CAP_PURPLE01, CAP_G16 } from '@capillarytech/cap-ui-library/styled/variables';
27
+ import { CAP_COLOR_03, CAP_WHITE, FONT_COLOR_01, CAP_G08, CAP_G06 } from '@capillarytech/cap-ui-library/styled/variables';
32
28
  import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
33
29
 
34
30
  class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -131,8 +127,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
131
127
 
132
128
  render() {
133
129
  let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
134
- const { channel, showTestAndPreviewIcon, module, viberBrandName, viberAccountName } = this.props;
135
- const { buttonText, imageURL, messageContent: viberMessageContent } = content || {};
130
+ const { channel, showTestAndPreviewIcon, module} = this.props;
136
131
  let smsDetails = {};
137
132
  // let smsText = '';
138
133
  if (this.props.content && this.props.charCounterEnabled) {
@@ -160,11 +155,11 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
160
155
  });
161
156
  }
162
157
  const disablePreviewAndTest = this.props.channel === 'MOBILEPUSH' ? !this.props.content.header : (this.props.channel === 'SMS' ? !this.props.content : false);
163
- const showTestAndPreview = showTestAndPreviewIcon &&
158
+ const showTestAndPreview = showTestAndPreviewIcon &&
164
159
  channel !== WECHAT &&
165
160
  ['outbound', 'library'].includes(module);
166
161
 
167
- const renderLineMultiText = (content) => {
162
+ const renderLineMultiText = (content) => {
168
163
  let textCount = 0;
169
164
  return content.map((item) => {
170
165
  const { type, messageContent = '' } = item || {};
@@ -175,17 +170,12 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
175
170
  {this.props.intl.formatMessage(messages.textMessageLabel)}
176
171
  {textCount}: ({messageContent.length}/{1600} {this.props.intl.formatMessage(messages.textMessageCharacter)})
177
172
  </p>
178
- );
173
+ )
179
174
  }
180
- return null;
175
+ return null
181
176
  });
182
- };
183
- const viberSectionStyle = {
184
- "padding": '3.5px 0 0',
185
- 'border-radius': '8px',
186
- 'background-color': CAP_G15,
187
- 'width': '81%',
188
- };
177
+ }
178
+
189
179
  const getVideoContent = ({
190
180
  video,
191
181
  actionUrl,
@@ -255,7 +245,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
255
245
  />
256
246
  )
257
247
  }
258
- </div>
248
+ </div>
259
249
  );
260
250
 
261
251
  return (
@@ -403,8 +393,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
403
393
  marginLeft: 40,
404
394
  }}
405
395
  >
406
- <div
407
- className="sms-icon"
396
+ <div className="sms-icon"
408
397
  style={{
409
398
  left: 0,
410
399
  top: 8,
@@ -412,7 +401,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
412
401
  width: 20,
413
402
  height: 20,
414
403
  background: CAP_COLOR_03,
415
- paddingRight: 5,
404
+ paddingRight: 5
416
405
  }}
417
406
  >
418
407
  {this.props.LineAccountName}
@@ -475,7 +464,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
475
464
  },
476
465
  }}
477
466
  />
478
- </div>
467
+ </div>
479
468
  );
480
469
  }
481
470
  if (type === VIDEO) {
@@ -506,7 +495,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
506
495
  },
507
496
  }}
508
497
  />
509
- </div>
498
+ </div>
510
499
  );
511
500
  }
512
501
  if (type === STICKER && selectedSticker) {
@@ -521,7 +510,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
521
510
  alignItems: 'center',
522
511
  }}
523
512
  >
524
- <CapImage
513
+ <CapImage
525
514
  src={selectedSticker.stickerUrl}
526
515
  style={{maxWidth: '100%', marginBottom: 5 }}
527
516
  rest={{
@@ -530,11 +519,11 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
530
519
  marginBottom: 5,
531
520
  },
532
521
  height: 70,
533
- onMouseOut: (e) => (e.currentTarget.src = selectedSticker.stickerUrl),
534
- onMouseOver: (e) => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
522
+ onMouseOut: e => (e.currentTarget.src = selectedSticker.stickerUrl),
523
+ onMouseOver: e => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
535
524
  }}
536
525
  />
537
- </div>
526
+ </div>
538
527
  );
539
528
  }
540
529
  if ((type === IMAGE_CAROUSEL || type === TEMPLATE) && imageCarousel) {
@@ -546,7 +535,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
546
535
  >
547
536
  <Carousel imageCarousel={imageCarousel}/>
548
537
  </div>
549
- );
538
+ )
550
539
  }
551
540
  return null;
552
541
  })
@@ -557,86 +546,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
557
546
  </div>
558
547
  ) : ''
559
548
  }
560
- {
561
- channel && channel.toLowerCase() === VIBER ? (
562
- <div className="shell-v2 align-center" id="sms-preview">
563
- <CapImage className="preview-image" src={viberMobileAndroid} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
564
- <div style={{ position: 'absolute', top: '12%', left: '36%'}}>{viberBrandName}</div>
565
- <div
566
- className="msgContainer viber-preview"
567
- style={{
568
- maxHeight: 292,
569
- marginLeft: 28,
570
- }}
571
- >
572
- <div
573
- className="sms-icon"
574
- style={{
575
- "width": 20,
576
- "height": 20,
577
- "margin": '0 4px 277px 0',
578
- 'border-radius': '4px',
579
- 'background-color': CAP_PURPLE01,
580
- 'font-size': '12px',
581
- 'font-weight': 900,
582
- "color": CAP_WHITE,
583
- }}
584
- >
585
- {viberAccountName}
586
- </div>
587
- <div
588
- className="message-pop align-left"
589
- style={viberSectionStyle}>
590
- {/* Text Viber preview */}
591
- <p
592
- style={{
593
- 'font-size': '10px',
594
- "color": CAP_G16,
595
- "margin": '1.5px 6px 1px 7px',
596
- }}>{viberMessageContent || ''}
597
- </p>
598
- {/* Image Viber preview */}
599
- {imageURL && <CapImage
600
- src={imageURL}
601
- alt="brand-name"
602
- rest={{
603
- style: {
604
- maxWidth: '100%',
605
- marginBottom: 5,
606
- },
607
- }}
608
- />
609
- }
610
- {/* button viber preview */}
611
- {buttonText && <div
612
- style={{
613
- 'border-radius': '16px',
614
- 'background-color': CAP_PURPLE01,
615
- "margin-top": '14px',
616
- 'text-align': 'center',
617
- "width": '140px',
618
- "height": '20px',
619
- "margin-left": "8px",
620
- }}>
621
- <p
622
- style={{ 'font-size': '12px',
623
- 'font-weight': '500',
624
- "display": '-webkit-box',
625
- '-webkit-line-clamp': '1',
626
- '-webkit-box-orient': 'vertical',
627
- 'overflow': 'hidden',
628
- "color": CAP_WHITE }}
629
- >
630
- {buttonText || ''}</p>
631
- </div>
632
- }
633
- <div style={{ paddingBottom: 32}}></div>
634
- </div>
635
549
 
636
- </div>
637
- </div>
638
- ) : ''
639
- }
640
550
  </div>
641
551
 
642
552
  </CapColumn>
@@ -19,10 +19,8 @@ export const TRACK_CREATE_MPUSH = 'createMpush';
19
19
  export const TRACK_CREATE_WECHAT = 'createWeChat';
20
20
  export const TRACK_CREATE_IMAGE = 'createImage';
21
21
  export const TRACK_CREATE_LINE = 'createLine';
22
- export const CREATE = 'create';
23
- export const EDIT = 'edit';
24
- export const PREVIEW = 'preview';
25
- export const VIBER = 'viber';
22
+
23
+
26
24
  export const TRACK_EDIT_SMS = 'editSms';
27
25
  export const TRACK_EDIT_EMAIL = 'editEmail';
28
26
  export const TRACK_EDIT_MPUSH = 'editMpush';
@@ -49,5 +47,5 @@ export const CHANNEL_EDIT_TRACK_MAPPING = {
49
47
  };
50
48
  export const GTM_TRACKING_ID = 'UA-110024621-2';
51
49
  export const BEE_PLUGIN = 'BEE_PLUGIN';
52
- export const NO_COMMUNICATION = 'NO_COMMUNICATION';
50
+
53
51
  export const CREATIVES_UI_VIEW = 'CREATIVES_UI_VIEW';
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import get from 'lodash/get';
5
- import cloneDeep from 'lodash/cloneDeep';
6
5
  import TemplatesV2 from '../TemplatesV2';
7
6
  import TemplatePreview from '../../v2Components/TemplatePreview';
8
7
  import SmsCreate from '../Sms/Create';
@@ -19,8 +18,6 @@ import CallTask from '../CallTask';
19
18
  import MobliPushEdit from '../MobilePush/Edit';
20
19
  import * as constants from './constants';
21
20
  import LineContainer from '../Line/Container';
22
- import FTP from '../FTP';
23
- import Viber from '../Viber';
24
21
  const CreativesWrapper = styled.div`
25
22
  .ant-popover,
26
23
  .ant-notification,
@@ -35,6 +32,7 @@ function getWechatTemplateType(mode, templateData, weChatTemplateType = '') {
35
32
  }
36
33
  return weChatTemplateType;
37
34
  }
35
+
38
36
  const getLineType = ({
39
37
  slidBoxContent,
40
38
  channel,
@@ -72,22 +70,6 @@ const getLineType = ({
72
70
  }
73
71
  return {};
74
72
  };
75
- const getViber = ({
76
- slidBoxContent,
77
- channel,
78
- isFullMode,
79
- templateData,
80
- }) => {
81
- if ((channel === constants.VIBER || (slidBoxContent === 'editTemplate' && templateData && templateData.type === constants.VIBER)) && slidBoxContent !== 'templates') {
82
- const isCreate = slidBoxContent === 'createTemplate';
83
- const isEdit = slidBoxContent === 'editTemplate';
84
- return {
85
- isCreate,
86
- isEdit,
87
- };
88
- }
89
- return {};
90
- };
91
73
 
92
74
  function SlideBoxContent(props) {
93
75
  const {
@@ -135,7 +117,6 @@ function SlideBoxContent(props) {
135
117
  selectedAccount,
136
118
  onShowTemplates,
137
119
  handleClose,
138
- onFTPSubmit,
139
120
  } = props;
140
121
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
141
122
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -154,15 +135,6 @@ function SlideBoxContent(props) {
154
135
  isFullMode,
155
136
  templateData,
156
137
  });
157
- const {isCreate: isCreateViber = false,
158
- isEdit: isEditViber = false } = getViber({
159
- slidBoxContent,
160
- channel,
161
- isFullMode,
162
- templateData,
163
- });
164
-
165
-
166
138
  const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
167
139
  const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
168
140
  const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
@@ -175,7 +147,6 @@ function SlideBoxContent(props) {
175
147
  let isEditCallTask = false;
176
148
  let isEditMPush = false;
177
149
  let isEditFacebook = false;
178
- let isEditFTP = false;
179
150
  const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
180
151
  if (templateData && channel) {
181
152
  channel = templateData.type;// for edit mode with template data
@@ -185,10 +156,9 @@ function SlideBoxContent(props) {
185
156
  isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
186
157
  isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
187
158
  isEditFacebook = slidBoxContent === 'editTemplate' && channel === constants.FACEBOOK;
188
- isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE || channel === constants.VIBER);
159
+ isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE);
189
160
  isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
190
161
  isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
191
- isEditFTP = slidBoxContent === 'editTemplate' && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
192
162
  }
193
163
 
194
164
  const getChannelPreviewContent = (templateDataObject) => {
@@ -253,20 +223,11 @@ function SlideBoxContent(props) {
253
223
  return previewContent;
254
224
  });
255
225
  }
256
- case constants.VIBER: {
257
- const template = cloneDeep(templateDataObject);
258
- const { text = "", imageURL = "", buttonText = "" } = get(template, 'versions.base.content.viber', {});
259
- template.content = {
260
- messageContent: text,
261
- imageURL,
262
- buttonText,
263
- };
264
- return template.content;
265
- }
266
226
  default:
267
227
  return get(templateDataObject, `versions.base.content`);
268
228
  }
269
229
  };
230
+
270
231
  return (
271
232
  <CreativesWrapper>
272
233
  {!isFullMode && slidBoxContent === 'templates' && (
@@ -289,17 +250,11 @@ function SlideBoxContent(props) {
289
250
  onCreateComplete={onCreateComplete}
290
251
  getFormSubscriptionData={getFormData}
291
252
  handleClose={handleClose}
292
- onFTPSubmit={onFTPSubmit}
293
- slidBoxContent={slidBoxContent}
294
- FTPMode="create"
295
- selectedOfferDetails={selectedOfferDetails}
296
253
  />
297
254
  )}
298
255
  {isPreview && (
299
256
  <TemplatePreview
300
257
  content={getChannelPreviewContent(templateData)}
301
- viberBrandName={selectedAccount || ""}
302
- viberAccountName={(selectedAccount || "")[0]}
303
258
  unicodeEnabled={get(templateData, `versions.base['unicode-validity']`)}
304
259
  channel={(templateData.type || '').toLowerCase()}
305
260
  charCounterEnabled={channel === constants.SMS}
@@ -361,14 +316,6 @@ function SlideBoxContent(props) {
361
316
  onTestContentClicked={onTestContentClicked}
362
317
  />
363
318
  )}
364
- {isEditFTP && (
365
- <FTP
366
- mode="edit"
367
- onFTPSubmit={onFTPSubmit}
368
- messageDetails={messageDetails}
369
- selectedOfferDetails={selectedOfferDetails}
370
- />
371
- )}
372
319
  {
373
320
  isEditCallTask &&
374
321
  <CallTask
@@ -553,33 +500,6 @@ function SlideBoxContent(props) {
553
500
  />
554
501
  )
555
502
  }
556
- {isCreateViber && (
557
- <Viber
558
- location={creativesLocationProps}
559
- onCreateComplete={onCreateComplete}
560
- isFullMode={isFullMode}
561
- handleClose={handleClose}
562
- isGetFormData={isGetFormData}
563
- getFormSubscriptionData={getFormData}
564
- onShowTemplates={onShowTemplates}
565
- templateData={templateData}
566
- createNew/>
567
- )}
568
-
569
- {isEditViber && <Viber
570
- location={creativesLocationProps}
571
- params={{
572
- id: templateData._id,
573
- }}
574
- onCreateComplete={onCreateComplete}
575
- isFullMode={isFullMode}
576
- handleClose={handleClose}
577
- isGetFormData={isGetFormData}
578
- getFormSubscriptionData={getFormData}
579
- onShowTemplates={onShowTemplates}
580
- templateData={templateData}
581
- createNew/> }
582
-
583
503
  </CreativesWrapper>
584
504
  );
585
505
  }
@@ -623,6 +543,5 @@ SlideBoxContent.propTypes = {
623
543
  onCreateComplete: PropTypes.func,
624
544
  saveMessage: PropTypes.func,
625
545
  selectedAccount: PropTypes.object,
626
- onFTPSubmit: PropTypes.func,
627
546
  };
628
547
  export default SlideBoxContent;
@@ -15,8 +15,6 @@ function getChannelLabel(channel = '') {
15
15
  email: 'Email',
16
16
  mobilepush: 'Push notification',
17
17
  wechat: 'Wechat',
18
- no_communication: 'NO_COMMUNICATION',
19
- ftp: 'FTP',
20
18
  };
21
19
  return labels[channel.toLowerCase()];
22
20
  }
@@ -13,9 +13,5 @@ export const CALL_TASK = "CALL_TASK";
13
13
  export const MOBILE_PUSH = "MOBILEPUSH";
14
14
  export const WECHAT = "WECHAT";
15
15
  export const FACEBOOK = "FACEBOOK";
16
- export const FTP = "FTP";
17
- export const NO_COMMUNICATION = "NO_COMMUNICATION";
18
- export const VIBER = "VIBER";
19
-
20
16
  export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
21
17
  export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
@@ -5,7 +5,7 @@ import {
5
5
  } from '@capillarytech/cap-ui-library';
6
6
  import { injectIntl, FormattedMessage } from 'react-intl';
7
7
  import classnames from 'classnames';
8
- import {isEmpty, get, forEach, cloneDeep} from 'lodash';
8
+ import {isEmpty, get, forEach} from 'lodash';
9
9
  import { connect } from 'react-redux';
10
10
  import { createStructuredSelector } from 'reselect';
11
11
  import { bindActionCreators } from 'redux';
@@ -18,6 +18,7 @@ import SlideBoxHeader from './SlideBoxHeader';
18
18
  import SlideBoxFooter from './SlideBoxFooter';
19
19
  import * as constants from './constants';
20
20
  import * as commonUtil from '../../utils/common';
21
+
21
22
  import './index.scss';
22
23
  import * as templateActions from '../Templates/actions';
23
24
  import * as globalActions from '../Cap/actions';
@@ -142,13 +143,6 @@ class Creatives extends React.Component {
142
143
  const {channel} = templateData;
143
144
  let creativesTemplateData = {type: channel };
144
145
  switch (channel) {
145
- case constants.NO_COMMUNICATION: {
146
- creativesTemplateData = {
147
- type: channel,
148
- ...templateData,
149
- };
150
- break;
151
- }
152
146
  case constants.SMS: {
153
147
  const formData = {
154
148
  "sms-editor": templateData.messageBody,
@@ -253,24 +247,6 @@ class Creatives extends React.Component {
253
247
  };
254
248
  break;
255
249
  }
256
- case constants.VIBER: {
257
- const { messageBody, isDefault } = templateData;
258
- const viber = JSON.parse(messageBody || '{}');
259
- creativesTemplateData = {
260
- type: constants.VIBER,
261
- isDefault,
262
- edit: true,
263
- name: "",
264
- versions: {
265
- base: {
266
- content: {
267
- ...viber,
268
- },
269
- },
270
- },
271
- };
272
- break;
273
- }
274
250
  default:
275
251
  break;
276
252
  }
@@ -356,24 +332,6 @@ class Creatives extends React.Component {
356
332
  };
357
333
  }
358
334
  break;
359
- case constants.VIBER:
360
- if (template.value) {
361
- const { Templates, templateData: templateDataProps } = this.props;
362
- const { accountDetails: selectedAccountDetails, accountId: selectedAccountId } = templateDataProps || {};
363
- const selectedViberAccount = Templates && Templates.selectedViberAccount;
364
- const accountDetails = selectedAccountDetails || (selectedViberAccount ? JSON.stringify(selectedViberAccount) : '');
365
- const accountId = selectedAccountId || (selectedViberAccount ? selectedViberAccount.id : '');
366
- const { versions } = template.value;
367
- const content = cloneDeep(versions.base.content);
368
- content.scenarioKey = get(accountDetails, 'configs.scenario_key');
369
- templateData = {
370
- channel,
371
- accountId,
372
- accountDetails,
373
- messageBody: JSON.stringify(content),
374
- };
375
- }
376
- break;
377
335
  default:
378
336
  break;
379
337
  }
@@ -488,8 +446,8 @@ class Creatives extends React.Component {
488
446
  }
489
447
  }
490
448
 
491
- const isLineViberChannel = templateData && [constants.LINE, constants.VIBER].includes(templateData);
492
- if ([constants.LINE, constants.VIBER].includes(channel) || isLineViberChannel) {
449
+ const isLineChannel = templateData && templateData.type === constants.LINE;
450
+ if (channel === constants.LINE || isLineChannel) {
493
451
  showFooter = false;
494
452
  }
495
453
 
@@ -648,7 +606,6 @@ class Creatives extends React.Component {
648
606
  selectedAccount={this.props.selectedAccount}
649
607
  onShowTemplates={this.onShowTemplates}
650
608
  handleClose={this.handleCloseSlideBox}
651
- onFTPSubmit={getCreativesData}
652
609
  editor={editor}
653
610
  />
654
611
  }
@@ -718,4 +675,4 @@ function mapDispatchToProps(dispatch) {
718
675
  actions: bindActionCreators(actions, dispatch),
719
676
  };
720
677
  }
721
- export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
678
+ export default connect(mapStatesToProps, mapDispatchToProps)(injectIntl(Creatives));
@@ -2358,7 +2358,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2358
2358
  const response = {
2359
2359
  action: "getFormData",
2360
2360
  postAction: this.state.getFormDataValue || 'next',
2361
- id : _.get(this.props, 'Email.templateDetails._id', ''),
2362
2361
  value: this.transformFormData(passedData),
2363
2362
  validity: this.state.isFormValid,
2364
2363
  type: 'EMAIL',
@@ -0,0 +1,64 @@
1
+ @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
+
3
+ .line-row{
4
+ margin-bottom: 16px;
5
+ }
6
+ .slidebox-content-container {
7
+ overflow-x: hidden;
8
+ }
9
+ .line-image {
10
+ position: relative;
11
+ }
12
+ .image-container {
13
+ display: flex;
14
+ & > div {
15
+ min-width: 516px;
16
+ }
17
+ border-radius: 5px;
18
+ .image-placeholder{
19
+ line-height: 150px;
20
+ }
21
+ img {
22
+ object-fit: cover;
23
+ max-width: 100%;
24
+ max-height: 100%;
25
+ height: auto !important;
26
+ width: auto !important;
27
+ }
28
+ }
29
+
30
+ .pagination-container.gallery-upload {
31
+ height: calc(100vh - 60px);
32
+
33
+ .cap-custom-card-list-col {
34
+ max-width: 156px;
35
+ max-height: 156px;
36
+ display: inline-block;
37
+ margin-left: $CAP_SPACE_04;
38
+ margin-right: $CAP_SPACE_04;
39
+ }
40
+
41
+ .ant-card-body {
42
+ padding-top: 0;
43
+
44
+ .ant-card-meta-description img {
45
+ height: 80px;
46
+ width: auto;
47
+ }
48
+ }
49
+ }
50
+
51
+ .gallery-image {
52
+ height: 156px;
53
+ width: 156px;
54
+ border-radius: 4px;
55
+ margin: 3px;
56
+ }
57
+
58
+ .sms-text {
59
+ img {
60
+ display: block;
61
+ max-width: 100%;
62
+ object-fit: cover;
63
+ }
64
+ }