@capillarytech/creatives-library 7.1.7 → 7.1.11

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 (69) hide show
  1. package/config/app.js +0 -2
  2. package/containers/Templates/index.js +1 -1
  3. package/favicon.ico +0 -0
  4. package/index.js +1 -15
  5. package/package.json +1 -2
  6. package/reducers.js +1 -4
  7. package/routes.js +1 -7
  8. package/services/api.js +0 -11
  9. package/utils/common.js +0 -178
  10. package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
  11. package/v2Components/TemplatePreview/index.js +18 -108
  12. package/v2Containers/App/constants.js +3 -5
  13. package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -84
  14. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -5
  15. package/v2Containers/CreativesContainer/constants.js +0 -4
  16. package/v2Containers/CreativesContainer/index.js +5 -48
  17. package/v2Containers/Email/index.js +0 -1
  18. package/v2Containers/Line/Create/_lineCreate.scss +64 -0
  19. package/v2Containers/Line/Create/actions.js +94 -0
  20. package/v2Containers/Line/Create/constants.js +43 -0
  21. package/v2Containers/Line/Create/index.js +1132 -0
  22. package/v2Containers/Line/Create/initialSchema.js +378 -0
  23. package/v2Containers/Line/Create/messages.js +229 -0
  24. package/v2Containers/Line/Create/reducer.js +99 -0
  25. package/v2Containers/Line/Create/sagas.js +113 -0
  26. package/v2Containers/Line/Create/selectors.js +30 -0
  27. package/v2Containers/Line/CreateWrapper/constants.js +2 -0
  28. package/v2Containers/Line/CreateWrapper/index.js +117 -0
  29. package/v2Containers/Line/CreateWrapper/messages.js +55 -0
  30. package/v2Containers/Line/Edit/_lineEdit.scss +23 -0
  31. package/v2Containers/Line/Edit/actions.js +79 -0
  32. package/v2Containers/Line/Edit/constants.js +27 -0
  33. package/v2Containers/Line/Edit/index.js +1051 -0
  34. package/v2Containers/Line/Edit/messages.js +173 -0
  35. package/v2Containers/Line/Edit/reducer.js +83 -0
  36. package/v2Containers/Line/Edit/sagas.js +81 -0
  37. package/v2Containers/Line/Edit/selectors.js +29 -0
  38. package/v2Containers/Line/Edit/tests/actions.test.js +18 -0
  39. package/v2Containers/Line/Edit/tests/index.test.js +10 -0
  40. package/v2Containers/Line/Edit/tests/reducer.test.js +9 -0
  41. package/v2Containers/Line/Edit/tests/sagas.test.js +15 -0
  42. package/v2Containers/Line/Edit/tests/selectors.test.js +10 -0
  43. package/v2Containers/Templates/_templates.scss +0 -57
  44. package/v2Containers/Templates/actions.js +110 -117
  45. package/v2Containers/Templates/constants.js +0 -2
  46. package/v2Containers/Templates/index.js +7 -88
  47. package/v2Containers/Templates/messages.js +0 -4
  48. package/v2Containers/Templates/reducer.js +0 -2
  49. package/v2Containers/TemplatesV2/index.js +1 -22
  50. package/v2Containers/TemplatesV2/messages.js +0 -8
  51. package/assets/viber.png +0 -0
  52. package/old_favicon.ico +0 -0
  53. package/v2Components/TemplatePreview/assets/images/viberMobile.svg +0 -135
  54. package/v2Containers/FTP/_FTP.scss +0 -114
  55. package/v2Containers/FTP/actions.js +0 -7
  56. package/v2Containers/FTP/constants.js +0 -3
  57. package/v2Containers/FTP/index.js +0 -599
  58. package/v2Containers/FTP/messages.js +0 -68
  59. package/v2Containers/FTP/reducer.js +0 -32
  60. package/v2Containers/FTP/sagas.js +0 -26
  61. package/v2Containers/FTP/selectors.js +0 -20
  62. package/v2Containers/FTP/temp.js +0 -11838
  63. package/v2Containers/Viber/actions.js +0 -74
  64. package/v2Containers/Viber/constants.js +0 -30
  65. package/v2Containers/Viber/index.js +0 -727
  66. package/v2Containers/Viber/messages.js +0 -145
  67. package/v2Containers/Viber/reducer.js +0 -84
  68. package/v2Containers/Viber/sagas.js +0 -107
  69. package/v2Containers/Viber/selectors.js +0 -21
package/config/app.js CHANGED
@@ -11,7 +11,6 @@ const config = {
11
11
  dashboard_url: '/sms',
12
12
  dashboard_url_v2: '/v2',
13
13
  subscription_api_endpoint: '/arya/api/v1/org-settings/subscription',
14
- exports_api_endpoint: '/arya/api/v1/export/data',
15
14
  accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
16
15
  },
17
16
  development: {
@@ -20,7 +19,6 @@ const config = {
20
19
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
21
20
  arya_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1',
22
21
  subscription_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/org-settings/subscription',
23
- exports_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/export/data',
24
22
  login_url: '/auth/login',
25
23
  dashboard_url: '/sms',
26
24
  dashboard_url_v2: '/v2',
@@ -1115,7 +1115,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1115
1115
  {content}
1116
1116
  </div>
1117
1117
  {!layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={(e) => this.handleEditClick(e, template._id)} className="edit-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectButton) : this.props.intl.formatMessage(messages.editButton)}</CapButton> : ''}
1118
- {layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={(event) =>{this.handleEdmDefaultTemplateSelection(true, template._id); event.stopPropagation();}} className="select-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectDefaultButton) : this.props.intl.formatMessage(messages.selectDefaultButton)}</CapButton> : ''}
1118
+ {layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={() => this.handleEdmDefaultTemplateSelection(true, template._id)} className="select-button" type="secondary">{type === 'embedded' ? this.props.intl.formatMessage(messages.selectDefaultButton) : this.props.intl.formatMessage(messages.selectDefaultButton)}</CapButton> : ''}
1119
1119
  {!layoutSelection && template._id === this.state.hoveredItem ? <CapButton onClick={() => this.handlePreviewClick(template)} className="preview-button" type="cancel">{this.props.intl.formatMessage(messages.previewButton)}</CapButton> : ''}
1120
1120
  </div>);
1121
1121
  } else if (this.state.channel.toLowerCase() === 'mobilepush') {
package/favicon.ico CHANGED
Binary file
package/index.js CHANGED
@@ -56,10 +56,6 @@ import MobilepushCreate from './v2Containers/MobilePush/Create';
56
56
  import mobilepushCreateReducer from './v2Containers/MobilePush/Create/reducer';
57
57
  import mobilepushCreateSaga from './v2Containers/MobilePush/Create/sagas';
58
58
 
59
- import FTP from './v2Containers/FTP';
60
- import FTPReducer from './v2Containers/FTP/reducer';
61
- import FTPSagas from './v2Containers/FTP/sagas';
62
-
63
59
  import MobilepushEdit from './v2Containers/MobilePush/Edit';
64
60
  import mobilepushEditReducer from './v2Containers/MobilePush/Edit/reducer';
65
61
  import mobilepushEditSaga from './v2Containers/MobilePush/Edit/sagas';
@@ -69,10 +65,6 @@ import LineCreate from './v2Containers/Line/Container';
69
65
  import lineCreateReducer from './v2Containers/Line/Container/reducer';
70
66
  import lineCreateSaga from './v2Containers/Line/Container/sagas';
71
67
 
72
- import Viber from './v2Containers/Viber';
73
- import viberReducer from './v2Containers/Viber/reducer';
74
- import viberSaga from './v2Containers/Viber/sagas';
75
-
76
68
  import TemplatesV2 from './v2Containers/TemplatesV2/index';
77
69
 
78
70
  import CreativesContainer from './v2Containers/CreativesContainer';
@@ -90,7 +82,7 @@ const TemplatesContainer = {Templates, templateReducer, templateSaga};
90
82
  const SmsCreateContainer = {SmsCreate, smsCreateReducer, smsCreateSaga};
91
83
  const SmsEditContainer = {SmsEdit, smsEditReducer, smsEditSaga};
92
84
  const EmailContainer = {Email, emailReducer, emailSaga};
93
- const BeeContainer = { BeeEditor, beeReducer, beeSaga};
85
+ const BeeContainer ={ BeeEditor,beeReducer,beeSaga}
94
86
  const CallTaskContainer = {CallTask, callTaskReducer, callTaskSaga};
95
87
  const WeChatMapTemplateContainer = {WeChatMapTemplate, weChatMapTemplateReducer, weChatMapTemplateSaga};
96
88
  const WeChatRichMediaCreateContainer = {WeChatRichMediaCreate, weChatRichMediaCreateReducer, weChatRichMediaCreateSaga};
@@ -100,10 +92,7 @@ const MobilePushEditContainer = {MobilepushEdit, mobilepushEditReducer, mobilepu
100
92
  const LineCreateContainer = {LineCreate, lineCreateReducer, lineCreateSaga};
101
93
  const TemplatesV2Container = {TemplatesV2, templateReducer, templateSaga};
102
94
  const FacebookContainer = {Facebook, facebookReducer, facebookSaga};
103
- const ViberContainer = {Viber, viberReducer, viberSaga};
104
-
105
95
  const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
106
- const FTPContainer = {FTP, FTPReducer, FTPSagas};
107
96
 
108
97
  export {default as TagList} from './v2Containers/TagList/index';
109
98
  export {default as TagListSaga} from './v2Containers/TagList/sagas';
@@ -115,7 +104,6 @@ export {default as CallTaskPreview} from './v2Components/CallTaskPreview';
115
104
  export {default as EmailMobilePreview} from './v2Components/EmailMobilePreview';
116
105
  export {default as MobilePushPreview} from './v2Components/MobilePushPreviewV2';
117
106
  export {default as WechatRichmediaTemplatePreview} from './v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
118
- export {default as FTP} from './v2Containers/FTP';
119
107
 
120
108
  CreativesContainer.CreativesContainerReducer = CreativesContainerReducer;
121
109
 
@@ -143,6 +131,4 @@ export { CapContainer,
143
131
  updateCharCount,
144
132
  FacebookContainer,
145
133
  GalleryContainer,
146
- FTPContainer,
147
- ViberContainer,
148
134
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.1.7",
4
+ "version": "7.1.11",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -30,7 +30,6 @@
30
30
  "redux-beacon": "^0.4.0",
31
31
  "redux-immutable": "3.0.8",
32
32
  "reselect": "2.5.4",
33
- "save": "^2.4.0",
34
33
  "styled-components": "^3.2.1",
35
34
  "webpack-bugsnag-plugins": "^1.4.3",
36
35
  "whatwg-fetch": "2.0.1"
package/reducers.js CHANGED
@@ -9,8 +9,6 @@ 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
-
13
-
14
12
  import capReducer from 'containers/Cap/reducer';
15
13
  import appReducer from 'containers/App/reducer';
16
14
  import createSmsReducer from 'containers/Sms/Create/reducer';
@@ -19,7 +17,7 @@ import templateReducer from 'containers/Templates/reducer';
19
17
  import tagsReducer from 'containers/TagList/reducer';
20
18
  import emailReducer from 'containers/Email/reducer';
21
19
  import ebillReducer from 'containers/Ebill/reducer';
22
- import ftpReducer from 'v2Containers/FTP/reducer';
20
+
23
21
  /*
24
22
  * routeReducer
25
23
  *
@@ -64,7 +62,6 @@ export default function createReducer(asyncReducers) {
64
62
  email: emailReducer,
65
63
  ebill: ebillReducer,
66
64
  beeEditor: beeEditorReducer,
67
- FTP: ftpReducer,
68
65
  ...asyncReducers,
69
66
  });
70
67
  }
package/routes.js CHANGED
@@ -598,8 +598,7 @@ export default function createRoutes(store) {
598
598
 
599
599
  importModules.catch(errorLoading);
600
600
  },
601
- },
602
- {
601
+ }, {
603
602
  path: '/v2(/:channel)',
604
603
  name: 'templatesV2',
605
604
  getComponent(nextState, cb) {
@@ -635,8 +634,6 @@ export default function createRoutes(store) {
635
634
  import('v2Containers/Facebook/reducer'),
636
635
  import('v2Containers/Line/Container/sagas'),
637
636
  import('v2Containers/Line/Container/reducer'),
638
- import('v2Containers/Viber/sagas'),
639
- import('v2Containers/Viber/reducer'),
640
637
  ]);
641
638
 
642
639
  const renderRoute = loadModule(cb);
@@ -657,7 +654,6 @@ export default function createRoutes(store) {
657
654
  galleryReducer, gallerySagas,
658
655
  facebookSagas, facebookReducer,
659
656
  lineCreateSagas, lineCreateReducer,
660
- viberSagas, viberReducer,
661
657
  ]) => {
662
658
  injectReducer('templates', reducer.default);
663
659
  injectReducer('cap', capReducer.default);
@@ -674,7 +670,6 @@ export default function createRoutes(store) {
674
670
  injectReducer('gallery', galleryReducer.default);
675
671
  injectReducer('facebook', facebookReducer.default);
676
672
  injectReducer('lineCreate', lineCreateReducer.default);
677
- injectReducer('viber', viberReducer.default);
678
673
  injectSagas(gallerySagas.default);
679
674
  injectSagas(sagas.default);
680
675
  injectSagas(capSagas.default);
@@ -690,7 +685,6 @@ export default function createRoutes(store) {
690
685
  injectSagas(weChatRichmediaTemplatesEditSagas.default);
691
686
  injectSagas(facebookSagas.default);
692
687
  injectSagas(lineCreateSagas.default);
693
- injectSagas(viberSagas.default);
694
688
  renderRoute(component);
695
689
  });
696
690
  importModules.catch(errorLoading);
package/services/api.js CHANGED
@@ -9,7 +9,6 @@ import getSchema from './getSchema';
9
9
  import * as API from '../utils/ApiCaller';
10
10
  import { GA } from '@capillarytech/cap-ui-utils';
11
11
  let API_ENDPOINT = config.development.api_endpoint;
12
- let EXPORT_API_ENDPOINT = config.development.exports_api_endpoint;
13
12
  let CAMPAIGNS_API_ENDPOINT = config.development.campaigns_api_endpoint;
14
13
  let API_AUTH_ENDPOINT = config.development.auth_endpoint;
15
14
  let ARYA_ENDPOINT = config.development.arya_endpoint;
@@ -214,11 +213,6 @@ export const duplicateTemplate = ({id, channel}) => {
214
213
  return request(url, getAPICallObject('GET'));
215
214
  };
216
215
 
217
- export const getFTPServers = () => {
218
- const url = `${EXPORT_API_ENDPOINT}/ftplist`;
219
- return request(url, getAPICallObject('GET'));
220
- };
221
-
222
216
  export const editWeChatTemplate = ({template}) => {
223
217
  console.log('in api.js', template);
224
218
  const url = `${API_ENDPOINT}/templates/WECHAT`;
@@ -364,11 +358,6 @@ export const createLineTemplate = ({template}) => {
364
358
  return request(url, getAPICallObject('POST', template));
365
359
  };
366
360
 
367
- export const createViberTemplate = ({template}) => {
368
- const url = `${API_ENDPOINT}/templates/VIBER`;
369
- return request(url, getAPICallObject('POST', template));
370
- };
371
-
372
361
  export const getLocizMessage = async (locale) => {
373
362
  const appName = 'creatives_v2';
374
363
  const url = `${ARYA_ENDPOINT}/translations/${appName}/${locale}`;
package/utils/common.js CHANGED
@@ -37,181 +37,3 @@ export const hasStore2DoorFeature = Auth.hasFeatureAccess.bind(
37
37
  null,
38
38
  STORE2DOOR_PLUS_ENABLED,
39
39
  );
40
-
41
- export function getTreeStructuredTags({tagsList, userLocale = 'en', offerDetails = []}) {
42
- console.log('populating tags', (tagsList || []).length);
43
- const mainTags = {};
44
-
45
- _.forEach(tagsList, (temp) => {
46
- const tag = temp.definition;
47
- if (!tag['tag-header']) { //if tag doesn't have subtag(s), which means this tag itself is tag and not a tag header.
48
- mainTags[tag.value] = {
49
- name: tag.label[userLocale] || tag.label.en,
50
- value: tag.value,
51
- };
52
- } else if (tag['tag-header'] && mainTags[tag.value]) {
53
- // to check it this tag header is already available in mainTags object,
54
- //If yes, it will concat the subtag
55
- mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
56
- } else if (!mainTags[tag.value]) {
57
- //If tag is not available in mainTag object, new maintag will be added.
58
- mainTags[tag.value] = {
59
- 'tag-header': true,
60
- "name": tag.label[userLocale] || tag.label.en,
61
- "subtags": tag.subtags,
62
- "value": tag.value,
63
- };
64
- }
65
- });
66
-
67
- const mainTagsCloned = _.cloneDeep(mainTags);
68
- //Insert subtags in tag headers and reomve them from top level
69
- const result = {};
70
- _.forEach(mainTagsCloned, (tag, key) => {
71
- if (tag['tag-header']) {
72
- const tagWithChildren = populateTagForChildren(tag, mainTagsCloned, key);
73
- tagWithChildren.resolved = true;
74
- result[key] = tagWithChildren;
75
- } else {
76
- result[key] = tag;
77
- }
78
- });
79
-
80
- //Delete extra tag headers
81
- _.forEach(result, (tag) => {
82
- if (tag['tag-header']) {
83
- _.forEach(tag.subtags, (subtag, key) => {
84
- if (result[key]) {
85
- result[key].deleted = true;
86
- }
87
- });
88
- }
89
- });
90
- //Actually delete them
91
- _.forEach(result, (tag, key) => {
92
- if (tag.deleted) {
93
- delete result[key];
94
- }
95
- });
96
- let combinedTags = result;
97
- if (offerDetails.length) {
98
- combinedTags = transformCouponTags(offerDetails, result);
99
- }
100
- return getTreeStructureData(combinedTags);
101
- }
102
-
103
- function transformCouponTags(offerDetails, allTags) {
104
- const couponTags = {};
105
- const couponTagsKeys = Object.keys(_.get(allTags, 'coupon.subtags', []));
106
- const withCouponId = (obj, id) => {
107
- const tempObj = {};
108
- if (obj.subtags) {
109
- tempObj.subtags = _.mapValues(obj.subtags, (tag) => {
110
- let val = tag.value;
111
- val = `${val}(${id})`;
112
- const newObj = {
113
- ...tag,
114
- value: val,
115
- };
116
- return {
117
- ...withCouponId(newObj, id),
118
- };
119
- });
120
- }
121
- return {
122
- ...obj,
123
- ...tempObj,
124
- couponSeriesId: id,
125
- };
126
- };
127
- offerDetails.forEach((offer) => {
128
- const { id, couponName, description, couponSeriesId } = offer;
129
- const couponId = id || couponSeriesId;
130
- const couponSubTags = {};
131
- couponTagsKeys.forEach((couponTagKey) => {
132
- let val = allTags.coupon.subtags[couponTagKey].value;
133
- val = `${val}(${couponId})`;
134
- const newObj = {
135
- ...allTags.coupon.subtags[couponTagKey],
136
- value: val,
137
- };
138
- const couponSubTagsObj = withCouponId(newObj, couponId);
139
- couponSubTags[couponTagKey] = couponSubTagsObj;
140
- });
141
- const couponNameFinal = couponName || description;
142
- const key = couponNameFinal || couponId;
143
- couponTags[key] = {
144
- 'tag-header': true,
145
- 'name': couponNameFinal || couponId,
146
- 'desc': couponNameFinal || couponId,
147
- 'couponSeriesId': couponId,
148
- 'subtags': couponSubTags,
149
- 'resolved': true,
150
- 'couponTags': true,
151
- };
152
- });
153
- // eslint-disable-next-line no-param-reassign
154
- allTags.coupon.subtags = couponTags;
155
- return allTags;
156
- }
157
-
158
- function populateTagForChildren(targetTag, tagsObject, tagValue) {
159
- const tag = targetTag;
160
- if (tag && tag['tag-header'] && !tag.resolved) {
161
- const tempSubTags = {};
162
- _.forEach(tag.subtags, (subtag) => {
163
- if (tagsObject[subtag]) {
164
- const children = populateTagForChildren(tagsObject[subtag], tagsObject, subtag);
165
- children.resolved = true;
166
- tempSubTags[subtag] = children;
167
- }
168
- });
169
- tag.subtags = tempSubTags;
170
- return tag;
171
- }
172
- return tagsObject[tagValue];
173
- }
174
-
175
- function getTreeStructureData(data) {
176
- const result = [];
177
- _.forOwn(data, (mainTag) => {
178
- const { name, value, subtags = [] } = mainTag;
179
- if (!mainTag['tag-header']) {
180
- result.push({
181
- title: name,
182
- value: `{{${value}}}`,
183
- });
184
- } else {
185
- const obj = {
186
- title: name,
187
- value: `{{${value}}}`,
188
- selectable: false,
189
- };
190
- obj.children = getSubTags(subtags);
191
- result.push(obj);
192
- }
193
- });
194
- return result;
195
- }
196
-
197
- function getSubTags(subtagsParam) {
198
- const result = [];
199
- _.forOwn(subtagsParam, (subTag) => {
200
- const { name, value, subtags = [] } = subTag;
201
- if (_.isEmpty(subtags)) {
202
- result.push({
203
- title: name,
204
- value: `{{${value}}}`,
205
- });
206
- } else {
207
- const obj = {
208
- title: name,
209
- value: `{{${value}}}`,
210
- selectable: false,
211
- };
212
- obj.children = getSubTags(subtags);
213
- result.push(obj);
214
- }
215
- });
216
- return result;
217
- }
@@ -21,6 +21,8 @@
21
21
  left: 23%;
22
22
  width: 42%;
23
23
  height: 336px;
24
+ display: -webkit-box;
25
+ display: -ms-flexbox;
24
26
  display: flex;
25
27
 
26
28
  .sms-icon{
@@ -49,14 +51,6 @@
49
51
  left: 36px;
50
52
  margin-top: -6px;
51
53
  }
52
- }
53
- &.viber-preview{
54
- width: 43%;
55
- .message-pop {
56
- width: 80%;
57
- left: 36px;
58
- margin-top: -6px;
59
- }
60
54
  }
61
55
 
62
56
  .message-pop{
@@ -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';