@capillarytech/creatives-library 6.13.8 → 6.14.0

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 (39) hide show
  1. package/app.js +2 -5
  2. package/components/FormBuilder/index.js +2 -6
  3. package/containers/Ebill/index.js +0 -3
  4. package/containers/Email/index.js +8 -16
  5. package/containers/Sms/Create/index.js +1 -2
  6. package/containers/Templates/index.js +3 -0
  7. package/index.js +1 -8
  8. package/package.json +2 -2
  9. package/reducers.js +0 -2
  10. package/routes.js +1 -7
  11. package/services/api.js +3 -7
  12. package/translations/en.json +107 -50
  13. package/translations/zh.json +107 -50
  14. package/v2Components/FormBuilder/index.js +11 -5
  15. package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
  16. package/v2Components/TemplatePreview/index.js +18 -104
  17. package/v2Containers/App/constants.js +1 -1
  18. package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -71
  19. package/v2Containers/CreativesContainer/constants.js +0 -2
  20. package/v2Containers/CreativesContainer/index.js +3 -31
  21. package/v2Containers/Email/actions.js +1 -2
  22. package/v2Containers/Email/index.js +29 -45
  23. package/v2Containers/Email/sagas.js +2 -2
  24. package/v2Containers/EmailWrapper/index.js +0 -2
  25. package/v2Containers/Templates/_templates.scss +0 -57
  26. package/v2Containers/Templates/index.js +6 -59
  27. package/v2Containers/TemplatesV2/index.js +7 -14
  28. package/v2Containers/TemplatesV2/messages.js +0 -4
  29. package/v2Containers/WeChat/MapTemplates/index.js +1 -1
  30. package/assets/viber.png +0 -0
  31. package/utils/ignoredErrorMessages.js +0 -4
  32. package/v2Containers/Viber/_viber.scss +0 -3
  33. package/v2Containers/Viber/actions.js +0 -74
  34. package/v2Containers/Viber/constants.js +0 -30
  35. package/v2Containers/Viber/index.js +0 -707
  36. package/v2Containers/Viber/messages.js +0 -137
  37. package/v2Containers/Viber/reducer.js +0 -84
  38. package/v2Containers/Viber/sagas.js +0 -107
  39. package/v2Containers/Viber/selectors.js +0 -21
@@ -30,7 +30,6 @@ import { makeSelectEbill as makeSelectCreateEbill } from '../Ebill/selectors';
30
30
  import { makeSelectEmail as makeSelectCreateEmail } from '../Email/selectors';
31
31
  import { makeSelectEdit } from '../Sms/Edit/selectors';
32
32
  import { makeSelectLine } from '../Line/Container/selectors';
33
- import { makeSelectViber } from '../Viber/selectors';
34
33
  import { UserIsAuthenticated } from '../../utils/authWrapper';
35
34
  import messages from './messages';
36
35
  import {checkUnicode} from '../../utils/smsCharCountV2';
@@ -41,8 +40,6 @@ import * as smsEditActions from '../Sms/Edit/actions';
41
40
  import * as ebillActions from '../Ebill/actions';
42
41
  import * as emailActions from '../Email/actions';
43
42
  import * as lineActions from '../Line/Container/actions';
44
- import * as viberActions from '../Viber/actions';
45
-
46
43
  import CardGrid from '../../v2Components/CardGrid';
47
44
  import config from '../../config/app';
48
45
  import './_templates.scss';
@@ -53,13 +50,8 @@ import Pagination from '../../v2Components/Pagination';
53
50
  import EmailPreview from '../../v2Components/EmailPreview';
54
51
  import CreativesContainer from '../CreativesContainer';
55
52
  import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
56
- import {
57
- CHANNEL_CREATE_TRACK_MAPPING,
58
- CHANNEL_EDIT_TRACK_MAPPING,
59
- VIBER as VIBER_CHANNEL,
60
- } from '../App/constants';
61
- import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE, VIBER } from '../CreativesContainer/constants';
62
-
53
+ import { CHANNEL_CREATE_TRACK_MAPPING, CHANNEL_EDIT_TRACK_MAPPING } from '../App/constants';
54
+ import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
63
55
  import emailIllustration from '../Assets/images/emailIllustration.svg';
64
56
  import smsIllustration from '../Assets/images/smsIllustration.svg';
65
57
  import pushIllustration from '../Assets/images/pushIllustration.svg';
@@ -169,9 +161,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
169
161
  case EBILL:
170
162
  channel = 'Ebill';
171
163
  break;
172
- case VIBER:
173
- channel = 'Viber';
174
- break;
175
164
  case LINE:
176
165
  channel = "Line";
177
166
  if (!this.props.isFullMode) {
@@ -196,7 +185,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
196
185
  if (this.props.location.query.type === 'embedded') {
197
186
  this.props.actions.resetAccount();
198
187
  }
199
- if ((['line', VIBER_CHANNEL, 'sms', 'email', 'ebill'].includes((this.state.channel || '').toLowerCase())) || ((['wechat', 'mobilepush'].includes(this.state.channel.toLowerCase()) && !isEmpty(this.props.Templates.selectedWeChatAccount)))) {
188
+ if ((this.state.channel && (this.state.channel.toLowerCase() === 'line' || this.state.channel.toLowerCase() === 'sms' || this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill')) || ((this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === 'mobilepush') && !isEmpty(this.props.Templates.selectedWeChatAccount))) {
200
189
  const queryParams = {
201
190
  // name: this.state.searchText,
202
191
  // sortBy: this.state.sortBy,
@@ -256,12 +245,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
256
245
  this.setState({defaultAccount: true});
257
246
  nextProps.actions.getWeCrmAccounts(channel);
258
247
  }
259
- } else if (nextProps.route.name.toLowerCase() === VIBER_CHANNEL) {
260
- channel = 'Viber';
261
248
  }
262
-
263
249
  this.setState({ channel }, () => {
264
- if (['line', VIBER_CHANNEL, 'sms', 'email', 'ebill'].includes(this.state.channel.toLowerCase()) || (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount))) {
250
+ if ((this.state.channel.toLowerCase() === 'line' || this.state.channel.toLowerCase() === 'sms' || this.state.channel.toLowerCase() === 'email' || this.state.channel.toLowerCase() === 'ebill') || (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount))) {
265
251
  if (this.state.channel.toLowerCase() === 'wechat' && !isEmpty(nextProps.Templates.selectedWeChatAccount)) {
266
252
  params.wecrmId = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_app_id;
267
253
  params.wecrmToken = (nextProps.Templates.selectedWeChatAccount.configs || {}).wecrm_token;
@@ -350,8 +336,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
350
336
  this.props.ebillActions.clearCreateResponse();
351
337
  } else if (this.state.channel.toLowerCase() === "line") {
352
338
  this.props.lineActions.clearCreateResponse();
353
- } else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
354
- this.props.viberActions.clearCreateResponse();
355
339
  }
356
340
  }
357
341
  }
@@ -667,7 +651,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
667
651
  <video height="279">
668
652
  <source src={originalVideoContentUrl} type="video/mp4" />
669
653
  </video>
670
- );
654
+ )
671
655
  }
672
656
  if (carouselTemplate) {
673
657
  const carouselContent = get(carouselTemplate, 'columns', [{}]).map(({ imageUrl, action: { label: actionLabel } = {} }) => ({ imageUrl, actionLabel }) );
@@ -693,26 +677,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
693
677
  }
694
678
  break;
695
679
  }
696
- case VIBER: {
697
- const {
698
- content: {
699
- viber: {
700
- text = '',
701
- imageURL = '',
702
- buttonURL = '',
703
- buttonText = '',
704
- } = {},
705
- } = {},
706
- } = template.versions.base;
707
- templateData.content = text;
708
- if (imageURL) {
709
- templateData.url = imageURL;
710
- }
711
- if (buttonURL && buttonText) {
712
- templateData.buttonText = buttonText;
713
- }
714
- break;
715
- }
716
680
  default:
717
681
  templateData.content = "";
718
682
  }
@@ -1210,15 +1174,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1210
1174
  this.props.lineActions.clearCreateResponse();
1211
1175
  }
1212
1176
  });
1213
- } else if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
1214
- this.props.viberActions.createTemplate(duplicateObj, (response) => {
1215
- if (response && response.templateId) {
1216
- const message = `${this.state.channel} ${this.props.intl.formatMessage(messages.templateDuplicateSuccess)}`;
1217
- CapNotification.success({key: 'duplicateSucess', message});
1218
- this.getAllTemplates({params, resetPage: true});
1219
- this.props.viberActions.clearCreateResponse();
1220
- }
1221
- });
1222
1177
  }
1223
1178
  }
1224
1179
 
@@ -1300,9 +1255,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1300
1255
  pathName += `/${options.account}`;
1301
1256
  }
1302
1257
  }
1303
- if (this.state.channel.toLowerCase() === VIBER_CHANNEL) {
1304
- pathName = `/viber/edit/${id}/`;
1305
- }
1306
1258
  if (this.state.channel.toUpperCase() === WECHAT) {
1307
1259
  if (get(template, 'definition.msgcontent', '') === "RICH_MEDIA_WECHAT") {
1308
1260
  pathName = `/wechat/richmedia/edit/${id}`;
@@ -1601,7 +1553,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1601
1553
  } = Templates;
1602
1554
  const lineLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'line');
1603
1555
  const smsLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === 'sms');
1604
- const viberLoader = (getAllTemplatesInProgress && this.state.channel.toLowerCase() === VIBER_CHANNEL);
1605
1556
  const wechatLoader = (((this.state.selectedAccount !== '' && getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'wechat');
1606
1557
  const mobilePushLoader = (((getAllTemplatesInProgress) || (fetchingWeCrmAccounts)) && this.state.channel.toLowerCase() === 'mobilepush');
1607
1558
  const emailLoader = (
@@ -1615,8 +1566,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
1615
1566
  (emailLoader !== undefined ? emailLoader : false) ||
1616
1567
  (ebillLoader !== undefined ? ebillLoader : false) ||
1617
1568
  (mobilePushLoader !== undefined ? mobilePushLoader : false) ||
1618
- (lineLoader !== undefined ? lineLoader : false) ||
1619
- (viberLoader !== undefined ? viberLoader : false);
1569
+ (lineLoader !== undefined ? lineLoader : false);
1620
1570
  return isLoading;
1621
1571
  }
1622
1572
  getChannelTypeIllustrationInfo = (type) => {
@@ -2027,7 +1977,6 @@ Templates.propTypes = {
2027
1977
  isFullMode: PropTypes.bool,
2028
1978
  handlePeviewTemplate: PropTypes.func,
2029
1979
  router: PropTypes.object,
2030
- viberActions: PropTypes.object,
2031
1980
  };
2032
1981
 
2033
1982
  const mapStateToProps = createStructuredSelector({
@@ -2040,7 +1989,6 @@ const mapStateToProps = createStructuredSelector({
2040
1989
  EmailCreate: makeSelectCreateEmail(),
2041
1990
  Global: makeSelectAuthenticated(),
2042
1991
  Line: makeSelectLine(),
2043
- Viber: makeSelectViber(),
2044
1992
  });
2045
1993
 
2046
1994
  function mapDispatchToProps(dispatch) {
@@ -2053,7 +2001,6 @@ function mapDispatchToProps(dispatch) {
2053
2001
  emailActions: bindActionCreators(emailActions, dispatch),
2054
2002
  globalActions: bindActionCreators(globalActions, dispatch),
2055
2003
  lineActions: bindActionCreators(lineActions, dispatch),
2056
- viberActions: bindActionCreators(viberActions, dispatch),
2057
2004
  };
2058
2005
  }
2059
2006
 
@@ -22,7 +22,6 @@ import * as actions from './actions';
22
22
  import Templates from '../Templates';
23
23
  import CallTask from '../CallTask';
24
24
  import Facebook from '../Facebook';
25
- import Viber from '../Viber';
26
25
  import Line from '../Line/Container';
27
26
  import Gallery from '../Assets/Gallery';
28
27
  import withStyles from '../../hoc/withStyles';
@@ -53,9 +52,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
53
52
  //'wechat': {content: this.getTemplatesComponent('wechat'), tab: 'Wechat', key: 'wechat'},
54
53
  mPush: {content: <></>, tab: intl.formatMessage(messages.pushNotification), key: 'mobilepush'},
55
54
  line: {content: <></>, tab: intl.formatMessage(messages.line), key: 'line'},
56
- viber: {content: <></>, tab: intl.formatMessage(messages.viber), key: 'viber'},
57
-
58
-
59
55
  };
60
56
  let filteredPanes = Object.keys(defaultPanes)
61
57
  .filter((key) => !channelsToHide.includes(key)).reduce((obj = [], key) => {
@@ -155,18 +151,15 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
155
151
  />
156
152
  );
157
153
  }
158
- getViberComponent =() => (
159
- <Viber
160
- {...this.props}
161
- isCreateFlow
162
- ></Viber>
163
- )
164
- getLineComponent = () => (
165
- <Line
166
- {...this.props}
167
- isCreateFlow
154
+
155
+ getLineComponent = () => {
156
+ return (
157
+ <Line
158
+ {...this.props}
159
+ isCreateFlow
168
160
  />
169
161
  )
162
+ }
170
163
 
171
164
  getTemplatesComponent(channel) {
172
165
  // const templates = this.props.Templates[`${channel}Templates`];
@@ -46,10 +46,6 @@ export default defineMessages({
46
46
  id: 'creatives.containersV2.TemplatesV2.facebook',
47
47
  defaultMessage: 'Facebook',
48
48
  },
49
- viber: {
50
- id: 'creatives.containersV2.TemplatesV2.viber',
51
- defaultMessage: 'Viber',
52
- },
53
49
  gallery: {
54
50
  id: 'creatives.containersV2.TemplatesV2.gallery',
55
51
  defaultMessage: 'Gallery',
@@ -876,7 +876,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
876
876
  }
877
877
 
878
878
  getMappedEvent(id, event) {
879
- return (this.state.map[id] && this.state.map[id][event] ? this.state.map[id][event] : () => {});
879
+ return this.state.map[id][event];
880
880
  }
881
881
 
882
882
  handleOnTagsContextChange = (data) => {
package/assets/viber.png DELETED
Binary file
@@ -1,4 +0,0 @@
1
- export default [
2
- // ref: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded
3
- 'ResizeObserver loop limit exceeded'
4
- ];
@@ -1,3 +0,0 @@
1
- .cap-divider-margin{
2
- margin: 14px 0;
3
- }
@@ -1,74 +0,0 @@
1
-
2
- import * as types from './constants';
3
-
4
- export function defaultAction() {
5
- return {
6
- type: types.DEFAULT_ACTION,
7
- };
8
- }
9
-
10
- export const uploadViberAsset = (file, assetType, fileParams, templateType) => ({
11
- type: types.UPLOAD_VIBER_ASSET_REQUEST,
12
- file,
13
- assetType,
14
- fileParams,
15
- templateType,
16
- });
17
-
18
-
19
- export function createTemplate(template, callback) {
20
- return {
21
- type: types.CREATE_VIBER_TEMPLATE_REQUEST,
22
- template,
23
- callback,
24
- };
25
- }
26
-
27
-
28
- // FOR EDIT
29
-
30
- export function editTemplate(template, callback) {
31
- console.log('action trigereed editTemplate viber @@@');
32
- return {
33
- type: types.EDIT_VIBER_TEMPLATE_REQUEST,
34
- template,
35
- callback,
36
- };
37
- }
38
-
39
- export function getTemplateDetails(id, callback) {
40
- console.log('getting template viber @@@', id);
41
- return {
42
- type: types.GET_VIBER_TEMPLATE_DETAILS_REQUEST,
43
- id,
44
- channel: 'VIBER',
45
- callback,
46
- };
47
- }
48
-
49
- export function clearData() {
50
- return {
51
- type: types.CLEAR_VIBER_DATA,
52
- };
53
- }
54
-
55
- export function clearEditResponse() {
56
- return {
57
- type: types.CLEAR_VIBER_EDIT_RESPONSE_REQUEST,
58
- };
59
- }
60
-
61
-
62
- export function clearCreateResponse() {
63
- return {
64
- type: types.CLEAR_VIBER_CREATE_RESPONSE_REQUEST,
65
- };
66
- }
67
-
68
- export function clearViberAsset(templateType) {
69
- return {
70
- type: types.CLEAR_VIBER_ASSET,
71
- templateType,
72
- };
73
- }
74
-
@@ -1,30 +0,0 @@
1
- export const DEFAULT_ACTION = 'app/v2Containers/Viber/DEFAULT_ACTION';
2
- export const ALLOWED_EXTENSIONS_REGEX = (/\.(jpe?g|png)$/i);
3
- export const VIBER_IMG_HEIGHT = 400;
4
- export const VIBER_IMG_WIDTH = 300;
5
- export const VIBER_IMG_SIZE = 10000000;
6
- export const charLimit = 1000;
7
-
8
- export const UPLOAD_VIBER_ASSET_REQUEST = 'app/v2Containers/Viber/UPLOAD_ASSET_REQUEST';
9
- export const UPLOAD_VIBER_ASSET_SUCCESS = 'app/v2Containers/Viber/UPLOAD_ASSET_SUCCESS';
10
- export const UPLOAD_VIBER_ASSET_FAILURE = 'app/v2Containers/Viber/UPLOAD_ASSET_FAILURE';
11
-
12
-
13
- export const CREATE_VIBER_TEMPLATE_REQUEST = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_REQUEST';
14
- export const CREATE_VIBER_TEMPLATE_SUCCESS = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_SUCCESS';
15
- export const CREATE_VIBER_TEMPLATE_FAILURE = 'app/v2Containers/Viber/CREATE_VIBER_TEMPLATE_FAILURE';
16
-
17
-
18
- export const GET_VIBER_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_REQUEST';
19
- export const GET_VIBER_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_SUCCESS';
20
- export const GET_VIBER_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Viber/EDIT/CREATE_VIBER_TEMPLATE_DETAILS_FAILURE';
21
-
22
- export const EDIT_VIBER_TEMPLATE_REQUEST = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_REQUEST';
23
- export const EDIT_VIBER_TEMPLATE_SUCCESS = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_SUCCESS';
24
- export const EDIT_VIBER_TEMPLATE_FAILURE = 'app/v2Containers/VIBER/Edit/EDIT_VIBER_TEMPLATE_FAILURE';
25
-
26
- export const CLEAR_VIBER_EDIT_RESPONSE_REQUEST = 'app/v2Containers/VIBER/Edit/CLEAR_EDIT_RESPONSE_REQUEST';
27
- export const CLEAR_VIBER_DATA = 'app/v2Containers/VIBER/Edit/CLEAR_DATA';
28
- export const CLEAR_VIBER_CREATE_RESPONSE_REQUEST = 'app/v2Containers/VIBER/Create/CLEAR_EDIT_RESPONSE_REQUEST';
29
- export const CLEAR_VIBER_ASSET = 'app/v2Containers/Viber/CLEAR_ASSET';
30
-