@capillarytech/creatives-library 2.0.13 → 2.0.14

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.
@@ -25,6 +25,7 @@ import makeSelectEbill from './selectors';
25
25
  import messages from './messages';
26
26
  import EmailPreview from '../../components/EmailPreview';
27
27
  import './_ebill.scss';
28
+ import callNativeEvent from '../../utils/callNativeEvent';
28
29
  const BreadcrumbItem = Breadcrumb.Item;
29
30
 
30
31
  export class Ebill extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -902,7 +903,7 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
902
903
  myField.value += myValue;
903
904
  }
904
905
  const event = new Event('input', { bubbles: true });
905
- myField.dispatchEvent(event);
906
+ callNativeEvent({field, value: myField.value, event});
906
907
  };
907
908
 
908
909
  injectMessages(elem) {
@@ -17,6 +17,7 @@ import { makeSelectMetaEntities } from '../../Cap/selectors';
17
17
  import {getMessageObject} from '../../../utils/messageUtils';
18
18
  import { makeSelectTemplates } from '../../Templates/selectors';
19
19
  import './_lineCreate.scss';
20
+ import callNativeEvent from '../../../utils/callNativeEvent';
20
21
 
21
22
  const BreadcrumbItem = Breadcrumb.Item;
22
23
 
@@ -554,7 +555,7 @@ export class Line extends Component {
554
555
  myField.value += myValue;
555
556
  }
556
557
  const event = new Event('input', { bubbles: true });
557
- myField.dispatchEvent(event);
558
+ callNativeEvent({field, value: myField.value, event});
558
559
  };
559
560
 
560
561
  startTemplateCreation = (data) => {
@@ -24,6 +24,8 @@ import * as templatesActions from "../../Templates/actions";
24
24
  import {makeSelectTemplates} from "../../Templates/selectors";
25
25
  import messages from './messages';
26
26
  import './_lineEdit.scss';
27
+ import callNativeEvent from '../../../utils/callNativeEvent';
28
+
27
29
  const BreadcrumbItem = Breadcrumb.Item;
28
30
 
29
31
  export class Edit extends React.Component { // eslint-disable-line react/prefer-stateless-function
@@ -31,43 +33,43 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
31
33
  super(props);
32
34
  const map = {
33
35
  "template-name": {
34
- "onChange": this.onTemplateNameChange,
36
+ onChange: this.onTemplateNameChange,
35
37
  },
36
38
  "discard-button": {
37
- "discardValues": this.discardValues,
39
+ discardValues: this.discardValues,
38
40
  },
39
41
  "cancel-button": {
40
- "cancelTemplate": this.cancelTemplate,
42
+ cancelTemplate: this.cancelTemplate,
41
43
  },
42
44
  "save-button": {
43
45
  saveFormData: this.saveFormData,
44
46
  },
45
47
  "message-editor": {
46
- "onChange": this.onTemplateContentChange,
48
+ onChange: this.onTemplateContentChange,
47
49
  },
48
50
  "message-editor2": {
49
- "onChange": this.onTemplateContentChange,
51
+ onChange: this.onTemplateContentChange,
50
52
  },
51
53
  "message-tagList": {
52
- "onTagSelect": this.onTagSelect,
54
+ onTagSelect: this.onTagSelect,
53
55
  },
54
56
  "message-tagList2": {
55
- "onTagSelect": this.onTagSelect,
57
+ onTagSelect: this.onTagSelect,
56
58
  },
57
59
  "title-tagList": {
58
- "onTagSelect": this.onTagSelect,
60
+ onTagSelect: this.onTagSelect,
59
61
  },
60
62
  "title-tagList2": {
61
- "onTagSelect": this.onTagSelect,
63
+ onTagSelect: this.onTagSelect,
62
64
  },
63
65
  "pane": {
64
66
  onTabChange: this.onTabChange,
65
67
  },
66
68
  "image-upload": {
67
- "onUpload": this.uploadImage,
69
+ onUpload: this.uploadImage,
68
70
  },
69
71
  "line-template": {
70
- "onSelect": this.onTemplateChange,
72
+ onSelect: this.onTemplateChange,
71
73
  },
72
74
  };
73
75
  this.state = {
@@ -367,16 +369,16 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
367
369
  delete android.base;
368
370
  if (!_.isEmpty(android)) {
369
371
  obj.versions.base.ANDROID = {
370
- "luid": "{{luid}}",
371
- "cuid": "{{cuid}}",
372
- "communicationId": "{{communicationId}}",
373
- "title": android['message-title'],
374
- "message": android['message-editor'],
372
+ luid: "{{luid}}",
373
+ cuid: "{{cuid}}",
374
+ communicationId: "{{communicationId}}",
375
+ title: android['message-title'],
376
+ message: android['message-editor'],
375
377
  expandableDetails: {
376
- "style": "BIG_TEXT",
377
- "message": android['message-editor'],
378
+ style: "BIG_TEXT",
379
+ message: android['message-editor'],
378
380
  },
379
- "custom": _.map(android, (field, key) => {
381
+ custom: _.map(android, (field, key) => {
380
382
  if (key.indexOf('custom-value') > -1) {
381
383
  return field !== "" ? {key: key.replace('custom-value-', "").replace('-cta-deeplink-select', '').replace('-cta-deeplink-secondary-cta-0-select', '').replace('-cta-deeplink-secondary-cta-1-select', ''), value: field} : undefined;
382
384
  }
@@ -386,9 +388,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
386
388
  }
387
389
  if (android['cta-deeplink'] && android['cta-deeplink'] !== "") {
388
390
  obj.versions.base.ANDROID.cta = {
389
- "type": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
390
- "actionLink": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? android['cta-deeplink-select'] : android['cta-deeplink-text'],
391
- "deepLinkName": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? this.getLinkName(android['cta-deeplink-select']) : undefined,
391
+ type: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
392
+ actionLink: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? android['cta-deeplink-select'] : android['cta-deeplink-text'],
393
+ deepLinkName: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? this.getLinkName(android['cta-deeplink-select']) : undefined,
392
394
  };
393
395
  if (this.props.location.query.type === 'embedded') {
394
396
  delete obj.versions.base.ANDROID.cta.deepLinkName;
@@ -396,20 +398,20 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
396
398
  }
397
399
  if (!_.isEmpty(ios)) {
398
400
  obj.versions.base.IOS = {
399
- "luid": "{{luid}}",
400
- "cuid": "{{cuid}}",
401
- "communicationId": "{{communicationId}}",
402
- "title": ios['message-title2'],
403
- "message": ios['message-editor2'],
404
- "expandableDetails": {
405
- "style": "BIG_TEXT",
406
- "message": ios['message-title2'],
407
- "ctas": [
401
+ luid: "{{luid}}",
402
+ cuid: "{{cuid}}",
403
+ communicationId: "{{communicationId}}",
404
+ title: ios['message-title2'],
405
+ message: ios['message-editor2'],
406
+ expandableDetails: {
407
+ style: "BIG_TEXT",
408
+ message: ios['message-title2'],
409
+ ctas: [
408
410
 
409
411
  ],
410
- "categoryId": ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
412
+ categoryId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
411
413
  },
412
- "custom": _.map(ios, (field, key) => {
414
+ custom: _.map(ios, (field, key) => {
413
415
  if (key.indexOf('custom-value') > -1) {
414
416
  return field !== "" ? {key: key.replace('custom-value-', "").replace('-cta-deeplink2-select', '').replace('-cta-deeplink-secondary-cta-0-select', '').replace('-cta-deeplink-secondary-cta-1-select2', ''), value: field} : undefined;
415
417
  }
@@ -419,9 +421,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
419
421
  }
420
422
  if (ios['cta-deeplink2'] && ios['cta-deeplink2'] !== "") {
421
423
  obj.versions.base.IOS.cta = {
422
- "type": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
423
- "actionLink": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? ios['cta-deeplink2-select'] : ios['cta-deeplink2-text'],
424
- "deepLinkName": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? this.getLinkName(ios['cta-deeplink2-select']) : undefined,
424
+ type: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
425
+ actionLink: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? ios['cta-deeplink2-select'] : ios['cta-deeplink2-text'],
426
+ deepLinkName: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? this.getLinkName(ios['cta-deeplink2-select']) : undefined,
425
427
  };
426
428
  if (this.props.location.query.type === 'embedded') {
427
429
  delete obj.versions.base.IOS.cta.deepLinkName;
@@ -453,10 +455,10 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
453
455
  obj.versions.base.ANDROID.expandableDetails.ctas = [];
454
456
  if (secondaryCta1) {
455
457
  const cta = {
456
- "actionText": android['secondary-cta-0-label'],
457
- "type": android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
458
- "actionLink": android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-0-select'] : android['cta-deeplink-secondary-cta-0-text'],
459
- "seccdeepLinkName": this.getLinkName(android['cta-deeplink-secondary-cta-0-select']),
458
+ actionText: android['secondary-cta-0-label'],
459
+ type: android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
460
+ actionLink: android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-0-select'] : android['cta-deeplink-secondary-cta-0-text'],
461
+ seccdeepLinkName: this.getLinkName(android['cta-deeplink-secondary-cta-0-select']),
460
462
  };
461
463
  if (this.props.location.query.type === 'embedded') {
462
464
  delete cta.seccdeepLinkName;
@@ -478,10 +480,10 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
478
480
  }
479
481
  if (secondaryCta2) {
480
482
  obj.versions.base.ANDROID.expandableDetails.ctas.push({
481
- "actionText": android['secondary-cta-1-label'],
482
- "type": android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
483
- "actionLink": android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-1-select'] : android['cta-deeplink-secondary-cta-1-text'],
484
- "seccdeepLinkName": this.getLinkName(android['cta-deeplink-secondary-cta-1-select']),
483
+ actionText: android['secondary-cta-1-label'],
484
+ type: android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
485
+ actionLink: android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-1-select'] : android['cta-deeplink-secondary-cta-1-text'],
486
+ seccdeepLinkName: this.getLinkName(android['cta-deeplink-secondary-cta-1-select']),
485
487
  });
486
488
  if (obj.versions.base.ANDROID.expandableDetails.ctas[obj.versions.base.ANDROID.expandableDetails.ctas.length - 1].type === "DEEP_LINK") {
487
489
  const params = _.map(android, (field, key) => {
@@ -523,13 +525,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
523
525
  if (secondaryCtaIos) {
524
526
  obj.versions.base.IOS.expandableDetails.ctas = [];
525
527
  const cta = {
526
- "actionText": ios['secondary-cta-1-label'],
527
- "actionLabel": ios['secondary-cta-1-action'],
528
- "actionLabel2": ios['secondary-cta-1-action2'],
529
- "type": ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
530
- "actionLink": ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? ios['cta-deeplink-secondary-cta-1-select2'] : ios['cta-deeplink-secondary-cta-1-text2']),
531
- "ioscdeepLinkName": this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
532
- 'templateCtaId': ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].ctaTemplateDetails[0].id : undefined,
528
+ actionText: ios['secondary-cta-1-label'],
529
+ actionLabel: ios['secondary-cta-1-action'],
530
+ actionLabel2: ios['secondary-cta-1-action2'],
531
+ type: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
532
+ actionLink: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? ios['cta-deeplink-secondary-cta-1-select2'] : ios['cta-deeplink-secondary-cta-1-text2']),
533
+ ioscdeepLinkName: this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
534
+ templateCtaId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].ctaTemplateDetails[0].id : undefined,
533
535
  };
534
536
  if (this.props.location.query.type === 'embedded') {
535
537
  delete cta.ioscdeepLinkName;
@@ -727,7 +729,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
727
729
  myField.value += myValue;
728
730
  }
729
731
  const event = new Event('input', { bubbles: true });
730
- myField.dispatchEvent(event);
732
+ callNativeEvent({field, value: myField.value, event});
731
733
  };
732
734
 
733
735
  selectCtaIos = (selectedConfig) => {
@@ -22,6 +22,8 @@ import * as actions from './actions';
22
22
  import {getMessageObject} from '../../../utils/messageUtils';
23
23
  import { makeSelectTemplates } from '../../Templates/selectors';
24
24
  import messages from './messages';
25
+ import callNativeEvent from '../../../utils/callNativeEvent';
26
+
25
27
  const BreadcrumbItem = Breadcrumb.Item;
26
28
  export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
27
29
  constructor(props) {
@@ -29,121 +31,121 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
29
31
  if (this.props.Templates.selectedWeChatAccount) {
30
32
  const map = {
31
33
  "template-name": {
32
- "onChange": this.onTemplateNameChange,
34
+ onChange: this.onTemplateNameChange,
33
35
  },
34
36
  "cta-deeplink-secondary-cta-0": {
35
- "onChange": this.onLinkTypeChange,
37
+ onChange: this.onLinkTypeChange,
36
38
  },
37
39
  "cta-deeplink-secondary-cta-1": {
38
- "onChange": this.onLinkTypeChange,
40
+ onChange: this.onLinkTypeChange,
39
41
  },
40
42
  "cta-deeplink-secondary-cta-12": {
41
- "onChange": this.onLinkTypeChange,
43
+ onChange: this.onLinkTypeChange,
42
44
  },
43
45
  "cta-deeplink-delete": {
44
- "onDelete": this.deletePrimaryCTA,
46
+ onDelete: this.deletePrimaryCTA,
45
47
  },
46
48
  "cta-deeplink2-delete": {
47
- "onDelete": this.deletePrimaryCTA,
49
+ onDelete: this.deletePrimaryCTA,
48
50
  },
49
51
  "secondary-cta-0-delete": {
50
- "onDelete": this.deleteSecondaryCTA,
52
+ onDelete: this.deleteSecondaryCTA,
51
53
  },
52
54
  "secondary-cta-1-delete": {
53
- "onDelete": this.deleteSecondaryCTA,
55
+ onDelete: this.deleteSecondaryCTA,
54
56
  },
55
57
  "secondary-cta-1-delete-ios": {
56
- "onDelete": this.deleteSecondaryCtaIos,
58
+ onDelete: this.deleteSecondaryCtaIos,
57
59
  },
58
60
  "discard-button": {
59
- "discardValues": this.discardValues,
61
+ discardValues: this.discardValues,
60
62
  },
61
63
  "cancel-button": {
62
- "cancelTemplate": this.cancelTemplate,
64
+ cancelTemplate: this.cancelTemplate,
63
65
  },
64
66
  "copy-android-content": {
65
- "onClick": this.copyAndroidContent,
67
+ onClick: this.copyAndroidContent,
66
68
  },
67
69
  "copy-iphone-content": {
68
- "onClick": this.copyIphoneContent,
70
+ onClick: this.copyIphoneContent,
69
71
  },
70
72
  "save-button": {
71
73
  saveFormData: this.saveFormData,
72
74
  },
73
75
  "message-editor": {
74
- "onChange": this.onTemplateContentChange,
76
+ onChange: this.onTemplateContentChange,
75
77
  },
76
78
  "message-editor2": {
77
- "onChange": this.onTemplateContentChange,
79
+ onChange: this.onTemplateContentChange,
78
80
  },
79
81
  "message-tagList": {
80
- "onTagSelect": this.onTagSelect,
82
+ onTagSelect: this.onTagSelect,
81
83
  },
82
84
  "message-tagList2": {
83
- "onTagSelect": this.onTagSelect,
85
+ onTagSelect: this.onTagSelect,
84
86
  },
85
87
  "title-tagList": {
86
- "onTagSelect": this.onTagSelect,
88
+ onTagSelect: this.onTagSelect,
87
89
  },
88
90
  "title-tagList2": {
89
- "onTagSelect": this.onTagSelect,
91
+ onTagSelect: this.onTagSelect,
90
92
  },
91
93
  "pane": {
92
94
  onTabChange: this.onTabChange,
93
95
  },
94
96
  "cta-deeplink": {
95
- "onChange": this.onLinkTypeChange,
97
+ onChange: this.onLinkTypeChange,
96
98
  },
97
99
  "cta-deeplink2": {
98
- "onChange": this.onLinkTypeChange,
100
+ onChange: this.onLinkTypeChange,
99
101
  },
100
102
  "cta-deeplink-secondary-cta-1-select": {
101
- "onSelect": this.showCtaKeys,
103
+ onSelect: this.showCtaKeys,
102
104
  },
103
105
  "cta-deeplink-secondary-cta-0-select": {
104
- "onSelect": this.showCtaKeys,
106
+ onSelect: this.showCtaKeys,
105
107
  },
106
108
  "cta-deeplink-secondary-cta-1-select2": {
107
- "onSelect": this.showCtaKeys,
109
+ onSelect: this.showCtaKeys,
108
110
  },
109
111
  "cta-deeplink-select": {
110
- "onSelect": this.showCtaKeys,
112
+ onSelect: this.showCtaKeys,
111
113
  },
112
114
  "cta-deeplink2-select": {
113
- "onSelect": this.showCtaKeys,
115
+ onSelect: this.showCtaKeys,
114
116
  },
115
117
  "add-pri-cta": {
116
- "addPrimaryCta": this.addPrimaryCta,
118
+ addPrimaryCta: this.addPrimaryCta,
117
119
  },
118
120
  "add-pri-cta-ios": {
119
- "addPrimaryCta": this.addPrimaryCta,
121
+ addPrimaryCta: this.addPrimaryCta,
120
122
  },
121
123
  "add-sec-cta": {
122
- "addSecondaryCta": this.addSecondoryCta,
124
+ addSecondaryCta: this.addSecondoryCta,
123
125
  },
124
126
  "add-sec-cta-ios": {
125
- "addSecondaryCtaIos": this.addSecondoryCtaIos,
127
+ addSecondaryCtaIos: this.addSecondoryCtaIos,
126
128
  },
127
129
  "image-upload-android": {
128
- "onUpload": this.uploadImage,
130
+ onUpload: this.uploadImage,
129
131
  },
130
132
  "image-upload-ios": {
131
- "onUpload": this.uploadImage,
133
+ onUpload: this.uploadImage,
132
134
  },
133
135
  "secondary-cta-1-table": {
134
- "onRowClick": this.selectCtaIos,
136
+ onRowClick: this.selectCtaIos,
135
137
  },
136
138
  "cta-deeplink-select-show-keys": {
137
- "onShowCtaKeys": this.showCtaKeys,
139
+ onShowCtaKeys: this.showCtaKeys,
138
140
  },
139
141
  "cta-deeplink-secondary-cta-0-select-show-keys": {
140
- "onShowCtaKeys": this.showCtaKeys,
142
+ onShowCtaKeys: this.showCtaKeys,
141
143
  },
142
144
  "cta-deeplink-secondary-cta-1-select-show-keys": {
143
- "onShowCtaKeys": this.showCtaKeys,
145
+ onShowCtaKeys: this.showCtaKeys,
144
146
  },
145
147
  "wechat-template": {
146
- "onSelect": this.onTemplateChange,
148
+ onSelect: this.onTemplateChange,
147
149
  },
148
150
  };
149
151
  this.state = {
@@ -543,16 +545,16 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
543
545
  delete android.base;
544
546
  if (!_.isEmpty(android)) {
545
547
  obj.versions.base.ANDROID = {
546
- "luid": "{{luid}}",
547
- "cuid": "{{cuid}}",
548
- "communicationId": "{{communicationId}}",
549
- "title": android['message-title'],
550
- "message": android['message-editor'],
548
+ luid: "{{luid}}",
549
+ cuid: "{{cuid}}",
550
+ communicationId: "{{communicationId}}",
551
+ title: android['message-title'],
552
+ message: android['message-editor'],
551
553
  expandableDetails: {
552
- "style": "BIG_TEXT",
553
- "message": android['message-editor'],
554
+ style: "BIG_TEXT",
555
+ message: android['message-editor'],
554
556
  },
555
- "custom": _.map(android, (field, key) => {
557
+ custom: _.map(android, (field, key) => {
556
558
  if (key.indexOf('custom-value') > -1) {
557
559
  return field !== "" ? {key: key.replace('custom-value-', "").replace('-cta-deeplink-select', '').replace('-cta-deeplink-secondary-cta-0-select', '').replace('-cta-deeplink-secondary-cta-1-select', ''), value: field} : undefined;
558
560
  }
@@ -562,9 +564,9 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
562
564
  }
563
565
  if (android['cta-deeplink'] && android['cta-deeplink'] !== "") {
564
566
  obj.versions.base.ANDROID.cta = {
565
- "type": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
566
- "actionLink": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? android['cta-deeplink-select'] : android['cta-deeplink-text'],
567
- "deepLinkName": android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? this.getLinkName(android['cta-deeplink-select']) : undefined,
567
+ type: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
568
+ actionLink: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? android['cta-deeplink-select'] : android['cta-deeplink-text'],
569
+ deepLinkName: android['cta-deeplink'] && android['cta-deeplink'].toLowerCase() === "deeplink" ? this.getLinkName(android['cta-deeplink-select']) : undefined,
568
570
  };
569
571
  if (this.props.location.query.type === 'embedded') {
570
572
  delete obj.versions.base.ANDROID.cta.deepLinkName;
@@ -572,19 +574,19 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
572
574
  }
573
575
  if (!_.isEmpty(ios)) {
574
576
  obj.versions.base.IOS = {
575
- "luid": "{{luid}}",
576
- "cuid": "{{cuid}}",
577
- "communicationId": "{{communicationId}}",
578
- "title": ios['message-title2'],
579
- "message": ios['message-editor2'],
580
- "expandableDetails": {
581
- "style": "BIG_TEXT",
582
- "message": ios['message-title2'],
583
- "ctas": [
577
+ luid: "{{luid}}",
578
+ cuid: "{{cuid}}",
579
+ communicationId: "{{communicationId}}",
580
+ title: ios['message-title2'],
581
+ message: ios['message-editor2'],
582
+ expandableDetails: {
583
+ style: "BIG_TEXT",
584
+ message: ios['message-title2'],
585
+ ctas: [
584
586
  ],
585
- "categoryId": ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
587
+ categoryId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].id : undefined,
586
588
  },
587
- "custom": _.map(ios, (field, key) => {
589
+ custom: _.map(ios, (field, key) => {
588
590
  if (key.indexOf('custom-value') > -1) {
589
591
  return field !== "" ? {key: key.replace('custom-value-', "").replace('-cta-deeplink2-select', '').replace('-cta-deeplink-secondary-cta-0-select', '').replace('-cta-deeplink-secondary-cta-1-select2', ''), value: field} : undefined;
590
592
  }
@@ -594,9 +596,9 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
594
596
  }
595
597
  if (ios['cta-deeplink2'] && ios['cta-deeplink2'] !== "") {
596
598
  obj.versions.base.IOS.cta = {
597
- "type": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
598
- "actionLink": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? ios['cta-deeplink2-select'] : ios['cta-deeplink2-text'],
599
- "deepLinkName": ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? this.getLinkName(ios['cta-deeplink2-select']) : undefined,
599
+ type: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
600
+ actionLink: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? ios['cta-deeplink2-select'] : ios['cta-deeplink2-text'],
601
+ deepLinkName: ios['cta-deeplink2'] && ios['cta-deeplink2'].toLowerCase() === "deeplink" ? this.getLinkName(ios['cta-deeplink2-select']) : undefined,
600
602
  };
601
603
  if (this.props.location.query.type === 'embedded') {
602
604
  delete obj.versions.base.IOS.cta.deepLinkName;
@@ -627,10 +629,10 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
627
629
  obj.versions.base.ANDROID.expandableDetails.ctas = [];
628
630
  if (secondaryCta1) {
629
631
  const cta = {
630
- "actionText": android['secondary-cta-0-label'],
631
- "type": android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
632
- "actionLink": android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-0-select'] : android['cta-deeplink-secondary-cta-0-text'],
633
- "seccdeepLinkName": this.getLinkName(android['cta-deeplink-secondary-cta-0-select']),
632
+ actionText: android['secondary-cta-0-label'],
633
+ type: android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
634
+ actionLink: android['cta-deeplink-secondary-cta-0'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-0-select'] : android['cta-deeplink-secondary-cta-0-text'],
635
+ seccdeepLinkName: this.getLinkName(android['cta-deeplink-secondary-cta-0-select']),
634
636
  };
635
637
  if (this.props.location.query.type === 'embedded') {
636
638
  delete cta.seccdeepLinkName;
@@ -652,10 +654,10 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
652
654
  }
653
655
  if (secondaryCta2) {
654
656
  const cta = {
655
- "actionText": android['secondary-cta-1-label'],
656
- "type": android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
657
- "actionLink": android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-1-select'] : android['cta-deeplink-secondary-cta-1-text'],
658
- "seccdeepLinkName": this.getLinkName(android['cta-deeplink-secondary-cta-1-select']),
657
+ actionText: android['secondary-cta-1-label'],
658
+ type: android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL",
659
+ actionLink: android['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? android['cta-deeplink-secondary-cta-1-select'] : android['cta-deeplink-secondary-cta-1-text'],
660
+ seccdeepLinkName: this.getLinkName(android['cta-deeplink-secondary-cta-1-select']),
659
661
  };
660
662
  if (this.props.location.query.type === 'embedded') {
661
663
  delete cta.seccdeepLinkName;
@@ -700,13 +702,13 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
700
702
  if (secondaryCtaIos) {
701
703
  obj.versions.base.IOS.expandableDetails.ctas = [];
702
704
  const cta = {
703
- "actionText": ios['secondary-cta-1-label'],
704
- "actionLabel": ios['secondary-cta-1-action'],
705
- "actionLabel2": ios['secondary-cta-1-action2'],
706
- "type": ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
707
- "actionLink": ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? (ios['cta-deeplink-secondary-cta-1-select2'] || ios['cta-deeplink-secondary-cta-1-select']) : ios['cta-deeplink-secondary-cta-1-text']),
708
- "ioscdeepLinkName": this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
709
- 'templateCtaId': ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].ctaTemplateDetails[0].id : undefined,
705
+ actionText: ios['secondary-cta-1-label'],
706
+ actionLabel: ios['secondary-cta-1-action'],
707
+ actionLabel2: ios['secondary-cta-1-action2'],
708
+ type: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
709
+ actionLink: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? (ios['cta-deeplink-secondary-cta-1-select2'] || ios['cta-deeplink-secondary-cta-1-select']) : ios['cta-deeplink-secondary-cta-1-text']),
710
+ ioscdeepLinkName: this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
711
+ templateCtaId: ios['secondary-cta-1-table'] ? ios['secondary-cta-1-table'].ctaTemplateDetails[0].id : undefined,
710
712
  };
711
713
  if (this.props.location.query.type === 'embedded') {
712
714
  delete cta.ioscdeepLinkName;
@@ -827,7 +829,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
827
829
  return true;
828
830
  }
829
831
  if (temp.id === "discard-button") {
830
- temp.colStyle = {...temp.colStyle, 'display': 'none'};
832
+ temp.colStyle = {...temp.colStyle, display: 'none'};
831
833
  }
832
834
  if (temp.id === "cancel-button") {
833
835
  temp.offset = 11;
@@ -938,7 +940,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
938
940
  myField.value += myValue;
939
941
  }
940
942
  const event = new Event('input', { bubbles: true });
941
- myField.dispatchEvent(event);
943
+ callNativeEvent({field, value: myField.value, event});
942
944
  };
943
945
 
944
946
  startTemplateCreation = (data) => {