@capillarytech/creatives-library 7.6.13 → 7.7.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 (61) hide show
  1. package/app.js +0 -5
  2. package/index.html +2 -2
  3. package/index.js +3 -3
  4. package/package.json +2 -2
  5. package/services/api.js +0 -2
  6. package/v2Components/TemplatePreview/index.js +0 -1
  7. package/v2Containers/App/constants.js +0 -11
  8. package/v2Containers/Cap/index.js +29 -23
  9. package/v2Containers/CapFacebookPreview/index.js +3 -5
  10. package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -16
  11. package/v2Containers/CreativesContainer/index.js +12 -122
  12. package/v2Containers/Email/index.js +3 -14
  13. package/v2Containers/EmailWrapper/index.js +3 -10
  14. package/v2Containers/Facebook/Advertisement/index.js +36 -72
  15. package/v2Containers/Facebook/Advertisement/index.scss +1 -1
  16. package/v2Containers/Facebook/Facebook.style.js +1 -1
  17. package/v2Containers/Facebook/constants.js +0 -4
  18. package/v2Containers/Facebook/index.js +122 -198
  19. package/v2Containers/Facebook/messages.js +4 -24
  20. package/v2Containers/Line/Container/index.js +4 -32
  21. package/v2Containers/MobilePush/Create/index.js +4 -25
  22. package/v2Containers/MobilePush/Edit/index.js +5 -27
  23. package/v2Containers/MobilePush/Edit/sagas.js +1 -1
  24. package/v2Containers/MobilePush/commonMethods.js +1 -19
  25. package/v2Containers/Sms/Create/index.js +2 -14
  26. package/v2Containers/Sms/Edit/index.js +2 -15
  27. package/v2Containers/Templates/index.js +27 -43
  28. package/v2Containers/Templates/reducer.js +1 -1
  29. package/v2Containers/TemplatesV2/index.js +6 -23
  30. package/v2Containers/TemplatesV2/messages.js +0 -4
  31. package/v2Containers/Viber/index.js +3 -19
  32. package/v2Containers/WeChat/MapTemplates/index.js +3 -12
  33. package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +2 -11
  34. package/utils/gtmTrackers/gtmEvents/creativeDetails.js +0 -41
  35. package/utils/gtmTrackers/index.js +0 -17
  36. package/v2Components/TemplatePreview/assets/images/mobile.svg +0 -24
  37. package/v2Containers/Line/Create/_lineCreate.scss +0 -64
  38. package/v2Containers/Line/Create/actions.js +0 -94
  39. package/v2Containers/Line/Create/constants.js +0 -43
  40. package/v2Containers/Line/Create/index.js +0 -1132
  41. package/v2Containers/Line/Create/initialSchema.js +0 -378
  42. package/v2Containers/Line/Create/messages.js +0 -229
  43. package/v2Containers/Line/Create/reducer.js +0 -99
  44. package/v2Containers/Line/Create/sagas.js +0 -113
  45. package/v2Containers/Line/Create/selectors.js +0 -30
  46. package/v2Containers/Line/CreateWrapper/constants.js +0 -2
  47. package/v2Containers/Line/CreateWrapper/index.js +0 -117
  48. package/v2Containers/Line/CreateWrapper/messages.js +0 -55
  49. package/v2Containers/Line/Edit/_lineEdit.scss +0 -23
  50. package/v2Containers/Line/Edit/actions.js +0 -79
  51. package/v2Containers/Line/Edit/constants.js +0 -27
  52. package/v2Containers/Line/Edit/index.js +0 -1051
  53. package/v2Containers/Line/Edit/messages.js +0 -173
  54. package/v2Containers/Line/Edit/reducer.js +0 -83
  55. package/v2Containers/Line/Edit/sagas.js +0 -81
  56. package/v2Containers/Line/Edit/selectors.js +0 -29
  57. package/v2Containers/Line/Edit/tests/actions.test.js +0 -18
  58. package/v2Containers/Line/Edit/tests/index.test.js +0 -10
  59. package/v2Containers/Line/Edit/tests/reducer.test.js +0 -9
  60. package/v2Containers/Line/Edit/tests/sagas.test.js +0 -15
  61. package/v2Containers/Line/Edit/tests/selectors.test.js +0 -10
@@ -49,10 +49,6 @@ import {
49
49
  VIBER_IMG_SIZE,
50
50
  charLimit,
51
51
  } from './constants';
52
- import { GA } from '@capillarytech/cap-ui-utils';
53
- import { CREATE, EDIT, TRACK_CREATE_VIBER, TRACK_EDIT_VIBER } from '../App/constants';
54
- import { gtmPush } from '../../utils/gtmTrackers';
55
- import { VIBER } from '../CreativesContainer/constants';
56
52
  const { CapHeadingSpan } = CapHeading;
57
53
  const { TextArea } = CapInput;
58
54
 
@@ -566,7 +562,7 @@ const Viber = (props) => {
566
562
  };
567
563
  };
568
564
 
569
- const createCallback = ({errorMessage, resp}, isEdit) => {
565
+ const createCallback = (errorMessage, isEdit) => {
570
566
  if (!errorMessage) {
571
567
  CapNotification.success({
572
568
  message: isEdit ? formatMessage(messages.viberEditNotification) : formatMessage(messages.viberCreateNotification),
@@ -576,18 +572,6 @@ const Viber = (props) => {
576
572
  } else {
577
573
  actions.clearCreateResponse();
578
574
  }
579
- const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_VIBER : TRACK_CREATE_VIBER, {
580
- category: 'Creatives',
581
- action: isEdit ? TRACK_EDIT_VIBER : TRACK_CREATE_VIBER,
582
- });
583
- gtmPush('creativeDetails', {
584
- id: resp.templateId._id || resp.templateId,
585
- name: messageTitle,
586
- channel: VIBER,
587
- timeTaken,
588
- content: messageContent,
589
- mode: isEdit ? EDIT : CREATE
590
- });
591
575
  } else {
592
576
  CapNotification.error({
593
577
  message: errorMessage,
@@ -599,7 +583,7 @@ const Viber = (props) => {
599
583
  actions.createTemplate(
600
584
  formatSubmitPayload(),
601
585
  (resp, errorMessage) => {
602
- createCallback({resp, errorMessage});
586
+ createCallback(errorMessage);
603
587
  onCreateComplete();
604
588
  }
605
589
  );
@@ -612,7 +596,7 @@ const Viber = (props) => {
612
596
  _id: params.id,
613
597
  },
614
598
  (resp, errorMessage) => {
615
- createCallback({resp, errorMessage}, true);
599
+ createCallback(errorMessage, true);
616
600
  onCreateComplete();
617
601
  });
618
602
  };
@@ -30,9 +30,7 @@ import * as templateActions from '../../Templates/actions';
30
30
  import './_mapTemplates.scss';
31
31
  import withCreatives from '../../../hoc/withCreatives';
32
32
  import { GA } from '@capillarytech/cap-ui-utils';
33
- import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../App/constants';
34
- import { gtmPush } from '../../../utils/gtmTrackers';
35
- import { WECHAT } from '../../CreativesContainer/constants';
33
+ import { TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../App/constants';
36
34
 
37
35
  const SELECT_TEMPLATE_MODE = "selectTemplate";
38
36
  const MAP_TEMPLATE_MODE = "mapTemplateMode";
@@ -1174,19 +1172,12 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
1174
1172
  getFormData(this.getFormData(obj));
1175
1173
  }, 0);
1176
1174
  }
1177
- const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
1175
+ GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
1178
1176
  category: 'Creatives',
1179
1177
  action: isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT,
1180
1178
  label : 'MapTemplates',
1181
1179
  });
1182
- gtmPush('creativeDetails', {
1183
- id: response.templateId._id || response.templateId,
1184
- name: obj?.versions?.base?.Title,
1185
- channel: `${WECHAT} Maptemplate`,
1186
- timeTaken,
1187
- content: this.state.formData?.base?.['sms-editor'],
1188
- mode: isEdit ? EDIT : CREATE
1189
- });
1180
+
1190
1181
  });
1191
1182
  }
1192
1183
 
@@ -29,9 +29,7 @@ import noImage from '../../../../assets/noImage.png';
29
29
  import Pagination from '../../../../v2Components/Pagination';
30
30
  import { CAP_SPACE_08, CAP_SPACE_12, CAP_SPACE_16 } from '@capillarytech/cap-ui-library/styled/variables';
31
31
  import { GA } from '@capillarytech/cap-ui-utils';
32
- import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
33
- import { gtmPush } from '../../../../utils/gtmTrackers';
34
- import { WECHAT } from '../../../CreativesContainer/constants';
32
+ import { TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
35
33
  export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
36
34
  constructor(props) {
37
35
  super(props);
@@ -558,18 +556,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
558
556
  // CapNotification.success({
559
557
  // message: this.props.intl.formatMessage(messages.saveSuccess),
560
558
  // });
561
- const timeTaken = GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
559
+ GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT, {
562
560
  category: 'Creatives',
563
561
  action: isEdit ? TRACK_EDIT_WECHAT : TRACK_CREATE_WECHAT,
564
562
  label: 'RichMedia',
565
563
  });
566
- gtmPush('creativeDetails', {
567
- id: response.templateId._id || response.templateId,
568
- name: saveObj?.name,
569
- channel: `${WECHAT} Richmedia`,
570
- timeTaken,
571
- mode: isEdit ? EDIT : CREATE
572
- });
573
564
  if (getFormData) {
574
565
  getFormData(this.getFormData({
575
566
  mediaId: response.mediaId,
@@ -1,41 +0,0 @@
1
- import { CREATIVES } from "../../../v2Containers/App/constants";
2
-
3
- const creativeDetails = ({
4
- name,
5
- id,
6
- channel,
7
- videoAdded,
8
- imageAdded,
9
- stickersAdded,
10
- timeTaken,
11
- content,
12
- mode
13
- }) => {
14
- const parsedObj = {
15
- name,
16
- id,
17
- creationSource: CREATIVES,
18
- channel,
19
- timeTaken,
20
- isLabelsUsed: isLabelsUsed(content),
21
- mode,
22
- imageAdded,
23
- videoAdded,
24
- stickersAdded
25
- };
26
- window.dataLayer.push({
27
- creativeDetails: parsedObj,
28
- event: 'creativeDetails',
29
- });
30
- };
31
-
32
- const isLabelsUsed = (content = '') => {
33
- const tagRegex = /{{[(A-Z\w+(\s\w+)*$\(\)@!#$%^&*~.,/\\]+}}/g; // eslint-disable-line no-useless-escape
34
- content = content.replaceAll('{{optout}}', '');
35
- content = content.replaceAll('{{unsubscribe}}', '');
36
- const tags = [...content.matchAll(tagRegex)];
37
- return !!tags.length;
38
- };
39
-
40
-
41
- export default creativeDetails;
@@ -1,17 +0,0 @@
1
- import Bugsnag from '@bugsnag/js';
2
-
3
- const gtmEvents = require.context('./gtmEvents', true, /\.js$/, 'lazy');
4
-
5
- export const gtmPush = (eventType, eventObject) => {
6
- try {
7
- gtmEvents(`./${eventType}.js`)
8
- .then(event => {
9
- event.default(eventObject);
10
- })
11
- .catch(err => {
12
- Bugsnag.notify(err);
13
- });
14
- } catch (e) {
15
- Bugsnag.notify(e);
16
- }
17
- };