@capillarytech/creatives-library 2.0.64 → 2.0.66
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/components/FormBuilder/index.js +3 -3
- package/containers/CreativesContainer/SlideBoxContent.js +7 -1
- package/containers/MobilePush/Create/index.js +4 -1
- package/containers/MobilePush/Edit/index.js +3 -1
- package/containers/MobilePush/initialSchema.js +4 -4
- package/containers/MobilepushWrapper/index.js +6 -5
- package/containers/Templates/index.js +2 -0
- package/package.json +1 -1
|
@@ -2673,21 +2673,21 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2673
2673
|
ifError = this.state.checkValidation && (isVersionEnable ? this.state.errorData[`${this.state.currentTab - 1}`][val.id] : this.state.errorData[val.id]);
|
|
2674
2674
|
const ImageComponent = (props) => (
|
|
2675
2675
|
<div>
|
|
2676
|
-
<div className={`image-container ${ifError ? 'error' : ''}`}>
|
|
2676
|
+
<div className={`image-container ${props.ifError ? 'error' : ''}`}>
|
|
2677
2677
|
{self.state && !!self.state.formData[`${self.state.currentTab - 1}`].image ?
|
|
2678
2678
|
<img src={self.state.formData[`${self.state.currentTab - 1}`].image} alt={props.alt} style={props.style}/>
|
|
2679
2679
|
:
|
|
2680
2680
|
<div style={{width: "100%", textAlign: "center"}}><span className="image-placeholder">{props.placeholder}</span></div>
|
|
2681
2681
|
}
|
|
2682
2682
|
</div>
|
|
2683
|
-
{ifError && <div><span className="error">{props.errorMessage}</span></div>}
|
|
2684
2683
|
|
|
2685
2684
|
</div>
|
|
2686
2685
|
);
|
|
2687
2686
|
const WithLabel = LabelHOC(ImageComponent);
|
|
2687
|
+
const {errorMessage, ...rest} = val.previewProps;
|
|
2688
2688
|
columns.push(
|
|
2689
2689
|
<CapColumn span={val.width} offset={val.offset} style={val.style}>
|
|
2690
|
-
{val.showPreview && <WithLabel {
|
|
2690
|
+
{val.showPreview && <WithLabel key={`${val.id}-with-label`} {...rest} errorMessage={ifError && errorMessage}/>}
|
|
2691
2691
|
<form encType="multipart/form-data" id={val.id}>
|
|
2692
2692
|
<input key={val.id} style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files}, val)} accept="image/*" />
|
|
2693
2693
|
<CapButton disabled={val.disabled ? val.disabled : false} type="secondary" onClick={(e) => this.openFileDialog(e)} style={{float: 'right', marginTop: '-68px'}}>
|
|
@@ -9,6 +9,7 @@ import Email from '../Email';
|
|
|
9
9
|
import EmailWrapper from '../EmailWrapper';
|
|
10
10
|
import MobilepusWrapper from '../MobilepushWrapper';
|
|
11
11
|
import EmailPreviewV2 from '../../components/EmailPreviewV2';
|
|
12
|
+
import MobilePushPreview from '../../components/MobilePushPreviewV2';
|
|
12
13
|
import CallTask from '../CallTask';
|
|
13
14
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
14
15
|
import * as constants from './constants';
|
|
@@ -60,6 +61,7 @@ function SlideBoxContent(props) {
|
|
|
60
61
|
let isEmailEditWithContent = false;
|
|
61
62
|
let isPreview = false;
|
|
62
63
|
let isEmailPreview = false;
|
|
64
|
+
let isMpushPreview = false;
|
|
63
65
|
let isEditCallTask = false;
|
|
64
66
|
let isEditMPush = false;
|
|
65
67
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
|
|
@@ -70,8 +72,9 @@ function SlideBoxContent(props) {
|
|
|
70
72
|
isEditMPush = slidBoxContent === 'editTemplate' && channel === constants.MOBILE_PUSH;
|
|
71
73
|
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
72
74
|
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
73
|
-
isPreview = slidBoxContent === 'preview' && channel
|
|
75
|
+
isPreview = slidBoxContent === 'preview' && channel === constants.SMS;
|
|
74
76
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
77
|
+
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
return (
|
|
@@ -103,6 +106,9 @@ function SlideBoxContent(props) {
|
|
|
103
106
|
/>
|
|
104
107
|
)
|
|
105
108
|
}
|
|
109
|
+
{isMpushPreview &&
|
|
110
|
+
<MobilePushPreview templateData={templateData} channel={channel}/>
|
|
111
|
+
}
|
|
106
112
|
{isEditSms && (
|
|
107
113
|
<SmsEdit
|
|
108
114
|
setIsLoadingContent={setIsLoadingContent}
|
|
@@ -420,6 +420,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
420
420
|
return undefined;
|
|
421
421
|
}).filter((custom) => custom),
|
|
422
422
|
};
|
|
423
|
+
obj.name = isEmpty(obj.name) ? android['message-title'] : obj.name;
|
|
423
424
|
}
|
|
424
425
|
if (android['cta-deeplink'] && android['cta-deeplink'] !== "") {
|
|
425
426
|
obj.versions.base.ANDROID.cta = {
|
|
@@ -452,6 +453,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
452
453
|
return undefined;
|
|
453
454
|
}).filter((custom) => custom),
|
|
454
455
|
};
|
|
456
|
+
obj.name = isEmpty(obj.name) ? ios['message-title2'] : obj.name;
|
|
455
457
|
}
|
|
456
458
|
if (ios['cta-deeplink2'] && ios['cta-deeplink2'] !== "") {
|
|
457
459
|
obj.versions.base.IOS.cta = {
|
|
@@ -560,6 +562,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
560
562
|
}
|
|
561
563
|
if (secondaryCtaIos) {
|
|
562
564
|
obj.versions.base.IOS.expandableDetails.ctas = [];
|
|
565
|
+
const templateCtaId = get(this.state, "templateCta.ctaTemplateDetails[0].id");
|
|
563
566
|
const cta = {
|
|
564
567
|
actionText: ios['secondary-cta-1-label'],
|
|
565
568
|
actionLabel: ios['secondary-cta-1-action'],
|
|
@@ -567,7 +570,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
567
570
|
type: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
|
|
568
571
|
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']),
|
|
569
572
|
ioscdeepLinkName: this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
|
|
570
|
-
templateCtaId
|
|
573
|
+
templateCtaId,
|
|
571
574
|
};
|
|
572
575
|
if (this.props.location.query.type === 'embedded') {
|
|
573
576
|
delete cta.ioscdeepLinkName;
|
|
@@ -547,6 +547,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
547
547
|
|
|
548
548
|
if (secondaryCtaIos) {
|
|
549
549
|
obj.versions.base.IOS.expandableDetails.ctas = [];
|
|
550
|
+
const templateCtaId = get(this.state, "templateCta.ctaTemplateDetails[0].id");
|
|
551
|
+
|
|
550
552
|
const cta = {
|
|
551
553
|
actionText: ios['secondary-cta-1-label'],
|
|
552
554
|
actionLabel: ios['secondary-cta-1-action'],
|
|
@@ -554,7 +556,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
554
556
|
type: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
|
|
555
557
|
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']),
|
|
556
558
|
ioscdeepLinkName: this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
|
|
557
|
-
templateCtaId
|
|
559
|
+
templateCtaId,
|
|
558
560
|
};
|
|
559
561
|
if (this.props.location.query.type === 'embedded') {
|
|
560
562
|
delete cta.ioscdeepLinkName;
|
|
@@ -1216,12 +1216,12 @@ export const response = {
|
|
|
1216
1216
|
showPreview: true,
|
|
1217
1217
|
previewProps: {
|
|
1218
1218
|
label: "Cover Image",
|
|
1219
|
-
inductiveText: "Maximum file size acceptable is 5
|
|
1219
|
+
inductiveText: "Maximum file size acceptable is 5 MB",
|
|
1220
1220
|
// placeholder: "Max file size acceptable is 5mb",
|
|
1221
1221
|
errorMessage: "Please upload Image",
|
|
1222
1222
|
|
|
1223
1223
|
},
|
|
1224
|
-
width:
|
|
1224
|
+
width: 22,
|
|
1225
1225
|
metaType: "text",
|
|
1226
1226
|
datatype: "string",
|
|
1227
1227
|
required: true,
|
|
@@ -1594,13 +1594,13 @@ export const response = {
|
|
|
1594
1594
|
showPreview: true,
|
|
1595
1595
|
previewProps: {
|
|
1596
1596
|
label: "Cover Image",
|
|
1597
|
-
inductiveText: "Maximum file size acceptable is 5
|
|
1597
|
+
inductiveText: "Maximum file size acceptable is 5 MB",
|
|
1598
1598
|
// placeholder: "Max file size acceptable is 5mb",
|
|
1599
1599
|
errorMessage: "Please upload Image",
|
|
1600
1600
|
|
|
1601
1601
|
},
|
|
1602
1602
|
type: "upload",
|
|
1603
|
-
width:
|
|
1603
|
+
width: 22,
|
|
1604
1604
|
metaType: "text",
|
|
1605
1605
|
datatype: "string",
|
|
1606
1606
|
required: true,
|
|
@@ -18,6 +18,12 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
18
18
|
constructor(props) {
|
|
19
19
|
super(props);
|
|
20
20
|
this.modes = [
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
title: <FormattedMessage {...messages.image}/>,
|
|
24
|
+
content: <WithImage height="248px" width={"248px"}/>,
|
|
25
|
+
value: 'image',
|
|
26
|
+
},
|
|
21
27
|
{
|
|
22
28
|
title: <FormattedMessage {...messages.text}/>,
|
|
23
29
|
content: <WithNoImage height="124px" width={"248px"}/>,
|
|
@@ -26,11 +32,6 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
26
32
|
// this.emailUploader.current.click();
|
|
27
33
|
// },
|
|
28
34
|
},
|
|
29
|
-
{
|
|
30
|
-
title: <FormattedMessage {...messages.image}/>,
|
|
31
|
-
content: <WithImage height="248px" width={"248px"}/>,
|
|
32
|
-
value: 'image',
|
|
33
|
-
},
|
|
34
35
|
];
|
|
35
36
|
}
|
|
36
37
|
onChange = (e) => {
|
|
@@ -470,6 +470,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
470
470
|
templateData.content = template.versions.base['sms-editor'];
|
|
471
471
|
} else if (currentChannel === "EMAIL") {
|
|
472
472
|
templateData.url = template.versions.base.preview_http_url;
|
|
473
|
+
} else if (currentChannel === "MOBILEPUSH" && template.type === "MOBILEPUSH") {
|
|
474
|
+
templateData.content = template;
|
|
473
475
|
}
|
|
474
476
|
return templateData;
|
|
475
477
|
});
|