@capillarytech/creatives-library 2.0.65 → 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.
|
@@ -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}
|
|
@@ -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) => {
|