@capillarytech/creatives-library 7.17.95 → 7.17.96
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.
- package/containers/Ebill/index.js +0 -1
- package/containers/MobilePush/Edit/index.js +0 -1
- package/package.json +1 -1
- package/v2Components/FormBuilder/index.js +4 -3
- package/v2Containers/InApp/index.js +26 -33
- package/v2Containers/MobilePush/Edit/index.js +1 -3
- package/v2Containers/Templates/_templates.scss +6 -0
|
@@ -956,7 +956,6 @@ export class Ebill extends React.Component { // eslint-disable-line react/prefer
|
|
|
956
956
|
}
|
|
957
957
|
temp.injectedEvents = {};
|
|
958
958
|
_.forEach(col.supportedEvents, (event) => {
|
|
959
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
960
959
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
961
960
|
});
|
|
962
961
|
|
|
@@ -1779,7 +1779,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1779
1779
|
temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
|
|
1780
1780
|
}
|
|
1781
1781
|
_.forEach(col.supportedEvents, (event) => {
|
|
1782
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
1783
1782
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
1784
1783
|
});
|
|
1785
1784
|
return true;
|
package/package.json
CHANGED
|
@@ -214,9 +214,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
214
214
|
this.setState({usingTabContainer: true});
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
//In Context of MPUSH currentTab represents whether its Android or IOS tab , 1 for Android and 2 for IOS
|
|
218
|
+
if (nextProps.currentTab && _.get(this.props, 'schema.channel') === MOBILE_PUSH) {
|
|
219
|
+
this.setState({currentTab: nextProps.currentTab});
|
|
220
|
+
}
|
|
220
221
|
} else if (!_.isEmpty(nextProps.formData) &&
|
|
221
222
|
( !this.state.usingTabContainer || (this.state.usingTabContainer && nextProps.tabKey !== ''))
|
|
222
223
|
&& !_.isEqual(nextProps.formData, this.state.formData) &&
|
|
@@ -67,10 +67,7 @@ export const InApp = (props) => {
|
|
|
67
67
|
const { formatMessage } = intl;
|
|
68
68
|
const [titleAndroid, setTitleAndroid] = useState("");
|
|
69
69
|
const [titleIos, setTitleIos] = useState("");
|
|
70
|
-
const [
|
|
71
|
-
INAPP_MEDIA_TYPES.TEXT
|
|
72
|
-
);
|
|
73
|
-
const [templateMediaTypeIos, setTemplateMediaTypeIos] = useState(
|
|
70
|
+
const [templateMediaType, setTemplateMediaType] = useState(
|
|
74
71
|
INAPP_MEDIA_TYPES.TEXT
|
|
75
72
|
);
|
|
76
73
|
const [templateName, setTemplateName] = useState("");
|
|
@@ -106,7 +103,8 @@ export const InApp = (props) => {
|
|
|
106
103
|
INAPP_BUTTON_TYPES.NONE
|
|
107
104
|
);
|
|
108
105
|
const [buttonTypeIos, setButtonTypeIos] = useState(INAPP_BUTTON_TYPES.NONE);
|
|
109
|
-
const
|
|
106
|
+
const isBtnTypeCtaAndroid = buttonTypeAndroid === INAPP_BUTTON_TYPES.CTA;
|
|
107
|
+
const isBtnTypeCTaIos = buttonTypeIos === INAPP_BUTTON_TYPES.CTA;
|
|
110
108
|
|
|
111
109
|
//gets account details
|
|
112
110
|
useEffect(() => {
|
|
@@ -165,7 +163,7 @@ export const InApp = (props) => {
|
|
|
165
163
|
} = androidContent;
|
|
166
164
|
setTitleAndroid(androidTitle);
|
|
167
165
|
setTemplateMessageAndroid(androidMessage);
|
|
168
|
-
|
|
166
|
+
setTemplateMediaType(
|
|
169
167
|
androidExpandableDetails?.style === BIG_TEXT
|
|
170
168
|
? INAPP_MEDIA_TYPES.TEXT
|
|
171
169
|
: INAPP_MEDIA_TYPES.IMAGE
|
|
@@ -200,7 +198,7 @@ export const InApp = (props) => {
|
|
|
200
198
|
} = iosContent;
|
|
201
199
|
setTitleIos(iosTitle);
|
|
202
200
|
setTemplateMessageIos(iosMessage);
|
|
203
|
-
|
|
201
|
+
setTemplateMediaType(iosExpandableDetails?.style === BIG_TEXT ? INAPP_MEDIA_TYPES.TEXT : INAPP_MEDIA_TYPES.IMAGE);
|
|
204
202
|
setInAppImageSrcIos(iosExpandableDetails?.image);
|
|
205
203
|
setButtonTypeIos(iosExpandableDetails?.ctas?.length ? INAPP_BUTTON_TYPES.CTA : INAPP_BUTTON_TYPES.NONE);
|
|
206
204
|
setAddActionLinkIos(!isEmpty(iosCta) && true);
|
|
@@ -312,7 +310,6 @@ export const InApp = (props) => {
|
|
|
312
310
|
}
|
|
313
311
|
}
|
|
314
312
|
};
|
|
315
|
-
|
|
316
313
|
// tag Code end
|
|
317
314
|
|
|
318
315
|
const onTemplateNameChange = ({ target: { value } }) => {
|
|
@@ -333,7 +330,6 @@ export const InApp = (props) => {
|
|
|
333
330
|
}
|
|
334
331
|
};
|
|
335
332
|
|
|
336
|
-
|
|
337
333
|
const PANES = [
|
|
338
334
|
{
|
|
339
335
|
content: (
|
|
@@ -355,8 +351,8 @@ export const InApp = (props) => {
|
|
|
355
351
|
setButtonType={setButtonTypeAndroid}
|
|
356
352
|
accountId={accountId}
|
|
357
353
|
accessToken={accessToken}
|
|
358
|
-
templateMediaType={
|
|
359
|
-
setTemplateMediaType={
|
|
354
|
+
templateMediaType={templateMediaType}
|
|
355
|
+
setTemplateMediaType={setTemplateMediaType}
|
|
360
356
|
title={titleAndroid}
|
|
361
357
|
setTitle={setTitleAndroid}
|
|
362
358
|
templateMessageError={templateMessageErrorAndroid}
|
|
@@ -398,8 +394,8 @@ export const InApp = (props) => {
|
|
|
398
394
|
setButtonType={setButtonTypeIos}
|
|
399
395
|
accountId={accountId}
|
|
400
396
|
accessToken={accessToken}
|
|
401
|
-
templateMediaType={
|
|
402
|
-
setTemplateMediaType={
|
|
397
|
+
templateMediaType={templateMediaType}
|
|
398
|
+
setTemplateMediaType={setTemplateMediaType}
|
|
403
399
|
title={titleIos}
|
|
404
400
|
setTitle={setTitleIos}
|
|
405
401
|
templateMessageError={templateMessageErrorIos}
|
|
@@ -466,7 +462,7 @@ export const InApp = (props) => {
|
|
|
466
462
|
let ctaData = {};
|
|
467
463
|
if (panes === ANDROID) {
|
|
468
464
|
ctaData = ctaDataAndroid;
|
|
469
|
-
switch (
|
|
465
|
+
switch (templateMediaType) {
|
|
470
466
|
case INAPP_MEDIA_TYPES.IMAGE:
|
|
471
467
|
mediaPreview.inAppImageSrcAndroid = inAppImageSrcAndroid;
|
|
472
468
|
break;
|
|
@@ -475,7 +471,7 @@ export const InApp = (props) => {
|
|
|
475
471
|
}
|
|
476
472
|
} else {
|
|
477
473
|
ctaData = ctaDataIos;
|
|
478
|
-
switch (
|
|
474
|
+
switch (templateMediaType) {
|
|
479
475
|
case INAPP_MEDIA_TYPES.IMAGE:
|
|
480
476
|
mediaPreview.inAppImageSrcIos = inAppImageSrcIos;
|
|
481
477
|
break;
|
|
@@ -491,7 +487,7 @@ export const InApp = (props) => {
|
|
|
491
487
|
mediaPreview,
|
|
492
488
|
templateTitle,
|
|
493
489
|
templateMsg,
|
|
494
|
-
...(
|
|
490
|
+
...((isBtnTypeCtaAndroid || isBtnTypeCTaIos) && {
|
|
495
491
|
ctaData,
|
|
496
492
|
}),
|
|
497
493
|
},
|
|
@@ -517,20 +513,24 @@ export const InApp = (props) => {
|
|
|
517
513
|
return true;
|
|
518
514
|
}//for ios
|
|
519
515
|
//if media type is image and the mediaType file is not uploaded
|
|
520
|
-
if (panes === ANDROID && !(
|
|
516
|
+
if (panes === ANDROID && !(templateMediaType === INAPP_MEDIA_TYPES.TEXT) && inAppImageSrcAndroid === '') {
|
|
521
517
|
return true;
|
|
522
518
|
}
|
|
523
|
-
if (panes === IOS && !(
|
|
519
|
+
if (panes === IOS && !(templateMediaType === INAPP_MEDIA_TYPES.TEXT) && inAppImageSrcIos === '') {
|
|
524
520
|
return true;
|
|
525
521
|
}
|
|
526
522
|
//cta
|
|
527
|
-
if (
|
|
528
|
-
if (
|
|
523
|
+
if (isBtnTypeCtaAndroid) {
|
|
524
|
+
if (ctaDataAndroid[0]?.isSaved) {
|
|
529
525
|
//if button type is cta and 1st button is saved
|
|
530
526
|
return false;
|
|
531
527
|
}
|
|
532
|
-
if
|
|
533
|
-
|
|
528
|
+
//if button type is cta and there are no buttons saved
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
if (isBtnTypeCTaIos) {
|
|
532
|
+
if (ctaDataIos[0]?.isSaved) {
|
|
533
|
+
//if button type is cta and 1st button is saved
|
|
534
534
|
return false;
|
|
535
535
|
}
|
|
536
536
|
//if button type is cta and there are no buttons saved
|
|
@@ -557,18 +557,12 @@ export const InApp = (props) => {
|
|
|
557
557
|
cuid: "{{cuid}}",
|
|
558
558
|
communicationId: "{{communicationId}}",
|
|
559
559
|
};
|
|
560
|
-
switch (
|
|
560
|
+
switch (templateMediaType) {
|
|
561
561
|
case INAPP_MEDIA_TYPES.IMAGE:
|
|
562
562
|
androidMediaParams = {
|
|
563
563
|
image: getCdnUrl({url: inAppImageSrcAndroid, channelName: INAPP }),
|
|
564
564
|
style: BIG_PICTURE,
|
|
565
565
|
};
|
|
566
|
-
break;
|
|
567
|
-
default:
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
switch (templateMediaTypeIos) {
|
|
571
|
-
case INAPP_MEDIA_TYPES.IMAGE:
|
|
572
566
|
iosMediaParams = {
|
|
573
567
|
image: getCdnUrl({url: inAppImageSrcIos, channelName: INAPP }),
|
|
574
568
|
style: BIG_PICTURE,
|
|
@@ -596,7 +590,7 @@ export const InApp = (props) => {
|
|
|
596
590
|
style: BIG_TEXT,
|
|
597
591
|
message: templateMessageAndroid,
|
|
598
592
|
...androidMediaParams,
|
|
599
|
-
...(
|
|
593
|
+
...(isBtnTypeCtaAndroid && {
|
|
600
594
|
ctas: getCtaPayload(ANDROID),
|
|
601
595
|
}),
|
|
602
596
|
},
|
|
@@ -612,7 +606,7 @@ export const InApp = (props) => {
|
|
|
612
606
|
style: BIG_TEXT,
|
|
613
607
|
message: templateMessageIos,
|
|
614
608
|
...iosMediaParams,
|
|
615
|
-
...(
|
|
609
|
+
...(isBtnTypeCTaIos && {
|
|
616
610
|
ctas: getCtaPayload(IOS),
|
|
617
611
|
}),
|
|
618
612
|
},
|
|
@@ -626,7 +620,7 @@ export const InApp = (props) => {
|
|
|
626
620
|
definition: {
|
|
627
621
|
accountId: id,
|
|
628
622
|
licenseCode: sourceAccountIdentifier,
|
|
629
|
-
mode:
|
|
623
|
+
mode: templateMediaType,
|
|
630
624
|
},
|
|
631
625
|
};
|
|
632
626
|
return data;
|
|
@@ -679,7 +673,6 @@ export const InApp = (props) => {
|
|
|
679
673
|
);
|
|
680
674
|
};
|
|
681
675
|
|
|
682
|
-
|
|
683
676
|
const onDoneCallback = () => {
|
|
684
677
|
if (isFullMode) {
|
|
685
678
|
if (isEditFlow) {
|
|
@@ -768,10 +768,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
768
768
|
formData[0].base = true;
|
|
769
769
|
// formData[0].tabKey = '1';
|
|
770
770
|
// formData[1].tabKey = '2';
|
|
771
|
-
|
|
772
771
|
this.setState({templateCta}, () => {
|
|
773
772
|
this.getSchemaForFormData(formData, schema);
|
|
774
|
-
this.setState({tabCount, formData, editData: data
|
|
773
|
+
this.setState({tabCount, formData, editData: data}, () => {
|
|
775
774
|
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
776
775
|
});
|
|
777
776
|
});
|
|
@@ -1469,7 +1468,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1469
1468
|
temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
|
|
1470
1469
|
}
|
|
1471
1470
|
_.forEach(col.supportedEvents, (event) => {
|
|
1472
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
1473
1471
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
1474
1472
|
});
|
|
1475
1473
|
return true;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
.creatives-templates-list.full-mode{
|
|
12
12
|
.pagination-container {
|
|
13
13
|
.cap-custom-card-list-row {
|
|
14
|
+
padding-bottom: 10rem;
|
|
14
15
|
.cap-custom-card-list-col{
|
|
15
16
|
&:nth-child(3n+3) { //every 4th child
|
|
16
17
|
margin-right: unset;
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
.creatives-templates-list.full-mode{
|
|
26
27
|
.pagination-container {
|
|
27
28
|
.cap-custom-card-list-row {
|
|
29
|
+
padding-bottom: 10rem;
|
|
28
30
|
.cap-custom-card-list-col{
|
|
29
31
|
&:nth-child(4n+4) { //every 4th child
|
|
30
32
|
margin-right: unset;
|
|
@@ -56,6 +58,9 @@
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
.pagination-container {
|
|
61
|
+
.cap-custom-card-list-row {
|
|
62
|
+
padding-bottom: 10rem;
|
|
63
|
+
}
|
|
59
64
|
.FACEBOOK {
|
|
60
65
|
.ant-card-body {
|
|
61
66
|
background-color: $CAP_G09;
|
|
@@ -523,6 +528,7 @@
|
|
|
523
528
|
.message-container{
|
|
524
529
|
border-bottom: solid 0.5px #D6D6D6;
|
|
525
530
|
}
|
|
531
|
+
|
|
526
532
|
.main-content{
|
|
527
533
|
overflow: hidden;
|
|
528
534
|
}
|