@capillarytech/creatives-library 7.7.22 → 7.7.24
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/MobilePush/Edit/index.js +2 -2
- package/containers/WeChat/MapTemplates/index.js +12 -2
- package/package.json +1 -1
- package/v2Components/CapImageUpload/index.js +14 -8
- package/v2Components/FormBuilder/index.js +10 -1
- package/v2Containers/CreativesContainer/index.js +1 -1
- package/v2Containers/MobilePush/Edit/index.js +2 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -1
- package/v2Containers/WeChat/MapTemplates/index.js +12 -2
|
@@ -558,7 +558,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
558
558
|
});
|
|
559
559
|
} else {
|
|
560
560
|
selectedAccount = accounts[0];
|
|
561
|
-
formData['mobilepush-accounts'] =
|
|
561
|
+
formData['mobilepush-accounts'] = selectedAccount?.id;
|
|
562
562
|
}
|
|
563
563
|
this.props.actions.setWeChatAccount(selectedAccount);
|
|
564
564
|
this.setState({formData, accountsOptions: accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id}))});
|
|
@@ -573,7 +573,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
573
573
|
obj.type = 'MOBILEPUSH';
|
|
574
574
|
obj.name = formData['template-name'];
|
|
575
575
|
obj.definition = {
|
|
576
|
-
accountId: selectedWeChatAccount
|
|
576
|
+
accountId: selectedWeChatAccount?.id,
|
|
577
577
|
licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
|
|
578
578
|
};
|
|
579
579
|
if (this.props.location.query && this.props.location.query.module !== 'dvs') {
|
|
@@ -780,7 +780,16 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
780
780
|
type: "radioGroup",
|
|
781
781
|
metaType: "text",
|
|
782
782
|
datatype: "string",
|
|
783
|
-
options: [
|
|
783
|
+
options: [
|
|
784
|
+
{
|
|
785
|
+
value: URL,
|
|
786
|
+
label: formatMessage(messages.redirectOptionURL)
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
value: MINI_PROGRAM,
|
|
790
|
+
label: formatMessage(messages.redirectOptionMiniProgram)
|
|
791
|
+
}
|
|
792
|
+
],
|
|
784
793
|
errorMessage: formatMessage(messages.redirectionOptionError),
|
|
785
794
|
required: true,
|
|
786
795
|
fluid: true,
|
|
@@ -871,7 +880,8 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
871
880
|
if (!_.isEmpty(weCrmAccounts)) {
|
|
872
881
|
_.forEach(weCrmAccounts, (account) => {
|
|
873
882
|
if (account.configs && account.configs.is_wecrm_enabled) {
|
|
874
|
-
schema
|
|
883
|
+
const options = schema?.standalone?.sections[0]?.childSections[1]?.childSections[0]?.childSections[0]?.inputFields[0]?.options;
|
|
884
|
+
options && options.push({
|
|
875
885
|
key: account.uuid,
|
|
876
886
|
label: account.name,
|
|
877
887
|
value: account.name,
|
package/package.json
CHANGED
|
@@ -85,6 +85,12 @@ function CapImageUpload(props) {
|
|
|
85
85
|
};
|
|
86
86
|
submitAction({file, type: 'image', fileParams}, incorrectFile);
|
|
87
87
|
};
|
|
88
|
+
img.onerror = () => {
|
|
89
|
+
const fileParams = {
|
|
90
|
+
error: true,
|
|
91
|
+
};
|
|
92
|
+
submitAction({fileParams}, incorrectFile);
|
|
93
|
+
}
|
|
88
94
|
if (e) {
|
|
89
95
|
const event = e;
|
|
90
96
|
event.target.value = null;
|
|
@@ -93,13 +99,12 @@ function CapImageUpload(props) {
|
|
|
93
99
|
|
|
94
100
|
const submitAction = useCallback((data, incorrectFile) => {
|
|
95
101
|
const {
|
|
96
|
-
file
|
|
97
|
-
fileParams
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth) {
|
|
102
|
+
file,
|
|
103
|
+
fileParams
|
|
104
|
+
} = data || {};
|
|
105
|
+
const { size } = file || {};
|
|
106
|
+
const { height, width, error } = fileParams || {};
|
|
107
|
+
if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth || error) {
|
|
103
108
|
updateImageErrorMessage(formatMessage(messages.imageIncorrectSize));
|
|
104
109
|
} else {
|
|
105
110
|
updateImageErrorMessage('');
|
|
@@ -166,6 +171,7 @@ function CapImageUpload(props) {
|
|
|
166
171
|
<CapUploader.CapDragger
|
|
167
172
|
customRequest={capUploaderCustomRequest}
|
|
168
173
|
className="form-builder-dragger"
|
|
174
|
+
showUploadList={!isImageError}
|
|
169
175
|
>
|
|
170
176
|
<CapHeading className="dragger-title" type="h7">
|
|
171
177
|
<FormattedMessage {...messages.dragAndDrop} />
|
|
@@ -198,7 +204,7 @@ function CapImageUpload(props) {
|
|
|
198
204
|
<FormattedMessage {...messages.imageReUpload} />
|
|
199
205
|
</CapButton>
|
|
200
206
|
);
|
|
201
|
-
}, []);
|
|
207
|
+
}, [isImageError]);
|
|
202
208
|
|
|
203
209
|
return (
|
|
204
210
|
<div style={style} className="cap-custom-image-upload">
|
|
@@ -2854,7 +2854,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2854
2854
|
name={val.name ? val.name : `${val.id}-name`}
|
|
2855
2855
|
disabled={val.disabled}
|
|
2856
2856
|
>
|
|
2857
|
-
{val.options.map((option, index) =>
|
|
2857
|
+
{val.options.map((option, index) => {
|
|
2858
|
+
const isMappedTemplateWechat = val.id === "template-redirect-options-radio";
|
|
2859
|
+
return (
|
|
2860
|
+
<CapRadio
|
|
2861
|
+
value={ isMappedTemplateWechat ? option.value : option }
|
|
2862
|
+
inductiveText={val.inductiveText && val.inductiveText[index]}>{ isMappedTemplateWechat ? option.label : option }
|
|
2863
|
+
</CapRadio>
|
|
2864
|
+
)
|
|
2865
|
+
}
|
|
2866
|
+
)}
|
|
2858
2867
|
|
|
2859
2868
|
</CapRadioGroup>
|
|
2860
2869
|
{/*{ifError ?*/}
|
|
@@ -91,7 +91,7 @@ class Creatives extends React.Component {
|
|
|
91
91
|
this.setState({ slidBoxContent: 'preview', templateData });
|
|
92
92
|
};
|
|
93
93
|
onEditTemplate = () => {
|
|
94
|
-
this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true });
|
|
94
|
+
this.setState({ slidBoxContent: 'editTemplate', showSlideBox: true, templateNameExists: true });
|
|
95
95
|
};
|
|
96
96
|
onCreateNew = (fbAdManager) => {
|
|
97
97
|
const data = { slidBoxContent: 'createTemplate', showSlideBox: true };
|
|
@@ -346,7 +346,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
346
346
|
});
|
|
347
347
|
} else {
|
|
348
348
|
selectedAccount = accounts[0];
|
|
349
|
-
formData['mobilepush-accounts'] =
|
|
349
|
+
formData['mobilepush-accounts'] = selectedAccount?.id;
|
|
350
350
|
}
|
|
351
351
|
this.props.actions.setWeChatAccount(selectedAccount);
|
|
352
352
|
this.setState({formData, accountsOptions: accounts.map((acc) => ({key: acc.id, label: acc.name, value: acc.id}))});
|
|
@@ -361,7 +361,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
361
361
|
obj.type = 'MOBILEPUSH';
|
|
362
362
|
obj.name = formData['template-name'];
|
|
363
363
|
obj.definition = {
|
|
364
|
-
accountId: selectedWeChatAccount
|
|
364
|
+
accountId: selectedWeChatAccount?.id,
|
|
365
365
|
licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
|
|
366
366
|
};
|
|
367
367
|
if (this.props.location.query && this.props.location.query.module !== 'dvs') {
|
|
@@ -45,7 +45,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
title: <FormattedMessage {...messages.text}/>,
|
|
48
|
-
content: <WithNoImage height="
|
|
48
|
+
content: <WithNoImage height="216px" width={"224px"}/>,
|
|
49
49
|
value: 'text',
|
|
50
50
|
// onClick: () => {
|
|
51
51
|
// this.emailUploader.current.click();
|
|
@@ -666,7 +666,16 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
666
666
|
type: "radioGroup",
|
|
667
667
|
metaType: "text",
|
|
668
668
|
datatype: "string",
|
|
669
|
-
options: [
|
|
669
|
+
options: [
|
|
670
|
+
{
|
|
671
|
+
value: URL,
|
|
672
|
+
label: intl.formatMessage(messages.redirectOptionURL)
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
value: MINI_PROGRAM,
|
|
676
|
+
label: intl.formatMessage(messages.redirectOptionMiniProgram)
|
|
677
|
+
}
|
|
678
|
+
],
|
|
670
679
|
errorMessage: intl.formatMessage(messages.redirectionOptionError),
|
|
671
680
|
required: true,
|
|
672
681
|
fluid: true,
|
|
@@ -764,7 +773,8 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
764
773
|
if (!isEmpty(weCrmAccounts)) {
|
|
765
774
|
forEach(weCrmAccounts, (account) => {
|
|
766
775
|
if (account.configs && account.configs.is_wecrm_enabled) {
|
|
767
|
-
schema
|
|
776
|
+
const options = schema?.standalone?.sections[0]?.childSections[1]?.childSections[0]?.childSections[0]?.inputFields[0]?.options;
|
|
777
|
+
options && options.push({
|
|
768
778
|
key: account.uuid,
|
|
769
779
|
label: account.name,
|
|
770
780
|
value: account.name,
|