@capillarytech/creatives-library 3.1.5 → 3.1.7
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/Line/Create/messages.js +1 -1
- package/package.json +1 -1
- package/services/api.js +1 -8
- package/translations/en.json +419 -0
- package/translations/zh.json +419 -0
- package/v2Components/EmailPreviewV2/messages.js +4 -4
- package/v2Components/FormBuilder/messages.js +1 -1
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +43 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +56 -47
- package/v2Components/TopBar/messages.js +1 -1
- package/v2Containers/CreativesContainer/messages.js +3 -3
- package/v2Containers/Email/index.js +5 -5
- package/v2Containers/Line/Create/messages.js +1 -1
- package/v2Containers/MobilePush/Create/messages.js +1 -1
- package/v2Containers/MobilePush/Edit/messages.js +1 -1
- package/v2Containers/MobilepushWrapper/messages.js +1 -1
- package/v2Containers/Templates/messages.js +2 -2
- package/v2Containers/WeChat/MapTemplates/index.js +6 -6
- package/v2Containers/WeChat/MapTemplates/messages.js +4 -4
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import {
|
|
10
|
+
// import { connect } from 'react-redux';
|
|
11
|
+
import { CapRow, CapColumn, CapButton } from '@capillarytech/cap-react-ui-library/';
|
|
12
|
+
import { CapHeading } from '@capillarytech/cap-ui-library/';
|
|
11
13
|
import { FormattedMessage } from 'react-intl';
|
|
12
14
|
import _ from 'lodash';
|
|
13
15
|
import './_wechatRichmediaTemplatePrev.scss';
|
|
@@ -16,39 +18,43 @@ const wechatBody = require('./../assets/images/WECHAT_5x.png');
|
|
|
16
18
|
|
|
17
19
|
class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
|
|
18
20
|
preparePreviewData = (mediaList) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<CapRow style={{ height: 32 }}>
|
|
31
|
-
{contentData.digest ? contentData.digest : ""}
|
|
32
|
-
</CapRow>
|
|
33
|
-
:
|
|
34
|
-
""
|
|
35
|
-
}
|
|
21
|
+
const previewMsg = [];
|
|
22
|
+
const content = JSON.parse(JSON.stringify(mediaList));
|
|
23
|
+
const mediaListLength = content.length;
|
|
24
|
+
const contentData = content[0];
|
|
25
|
+
console.log("archita medialist: ", mediaList, content, mediaListLength);
|
|
26
|
+
previewMsg.push(
|
|
27
|
+
<div className="image-container">
|
|
28
|
+
<img alt="default" width="100%" height="102px" src={contentData.image_url} />
|
|
29
|
+
{mediaListLength !== 1 && (
|
|
30
|
+
<div className="name-container">
|
|
31
|
+
<CapHeading type="h4" style={{color: "white"}}>{contentData.title}</CapHeading>
|
|
36
32
|
</div>
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
if (mediaListLength === 1) {
|
|
37
|
+
previewMsg.push(
|
|
38
|
+
<div className="name-container-with-abstract">
|
|
39
|
+
<CapHeading type="h4">{contentData.title}</CapHeading>
|
|
40
|
+
<CapHeading type="label7">{contentData.digest}</CapHeading>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
content.splice(1, 2).forEach((data) => {
|
|
45
|
+
previewMsg.push(
|
|
46
|
+
<div className="additional-richmedia-container">
|
|
47
|
+
<div><CapHeading type="label7" style={{width: '170px', top: '12px', position: 'relative'}}>{data.title}</CapHeading></div>
|
|
48
|
+
<img alt="default" width="40px" height="40px" src={data.image_url} />
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
50
51
|
});
|
|
51
|
-
return
|
|
52
|
+
console.log("archita return obj: ", previewMsg);
|
|
53
|
+
return (
|
|
54
|
+
<div className="richmedia-template">
|
|
55
|
+
{previewMsg}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
52
58
|
}
|
|
53
59
|
prepareCardLayoutPreviewData = (mediaList) => {
|
|
54
60
|
const returnObj = [];
|
|
@@ -90,27 +96,29 @@ class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-dis
|
|
|
90
96
|
}
|
|
91
97
|
render() {
|
|
92
98
|
return (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<div className=
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
<div className={this.props.type === 'embedded' ? "
|
|
99
|
-
{this.
|
|
99
|
+
<div>
|
|
100
|
+
{this.props.contentForSlideBox ?
|
|
101
|
+
<div className={`preview-container ${this.props.type === 'embedded' ? 'embedded-preview' : ''}`}>
|
|
102
|
+
<div className="shell align-center" id="sms-preview">
|
|
103
|
+
<img className="preview-image" src={wechatBody} alt="Preview is being generated"/>
|
|
104
|
+
<div className={this.props.type === 'embedded' ? "wechatMsgContainerOutbound" : "wechatMsgContainer"}>
|
|
105
|
+
<div className={this.props.type === 'embedded' ? "overflow-handle-preview-outbound" : "overflow-handle-preview"}>
|
|
106
|
+
{this.preparePreviewData(this.props.content)}
|
|
107
|
+
</div>
|
|
100
108
|
</div>
|
|
101
109
|
</div>
|
|
110
|
+
{this.props.showEdit ? <CapButton onClick={(e) => this.goToEdit(e, this.props.path)} className="preview-buttons" type="primary">{this.props.type === 'embedded' ? <FormattedMessage {...messages.select} /> : <FormattedMessage {...messages.edit} /> }</CapButton> : ""}
|
|
102
111
|
</div>
|
|
103
|
-
{this.props.showEdit ? <CapButton onClick={(e) => this.goToEdit(e, this.props.path)} className="preview-buttons" type="primary">{this.props.type === 'embedded' ? <FormattedMessage {...messages.select} /> : <FormattedMessage {...messages.edit} /> }</CapButton> : ""}
|
|
104
|
-
</div>
|
|
105
112
|
:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
<div className={`preview-container ${this.props.type === 'embedded' ? 'embedded-preview' : ''}`}>
|
|
114
|
+
<div className="shell align-center" id="sms-preview">
|
|
115
|
+
<div className="wechatMsgContainerCardLayout">
|
|
116
|
+
<div>{this.prepareCardLayoutPreviewData(this.props.content)}
|
|
117
|
+
</div>
|
|
110
118
|
</div>
|
|
111
119
|
</div>
|
|
112
|
-
</div>
|
|
113
|
-
|
|
120
|
+
</div>}
|
|
121
|
+
</div>
|
|
114
122
|
);
|
|
115
123
|
}
|
|
116
124
|
}
|
|
@@ -127,3 +135,4 @@ WechatRichmediaTemplatePreview.propTypes = {
|
|
|
127
135
|
};
|
|
128
136
|
|
|
129
137
|
export default WechatRichmediaTemplatePreview;
|
|
138
|
+
// export default connect(null, null)(WechatRichmediaTemplatePreview);
|
|
@@ -259,7 +259,7 @@ export default defineMessages({
|
|
|
259
259
|
defaultMessage: `Edit message content`,
|
|
260
260
|
},
|
|
261
261
|
"createMessageContent": {
|
|
262
|
-
id: `${scope}.
|
|
262
|
+
id: `${scope}.createMessageContent`,
|
|
263
263
|
defaultMessage: `New {channel} message`,
|
|
264
264
|
},
|
|
265
265
|
"creativeTemplatesDesc": {
|
|
@@ -283,11 +283,11 @@ export default defineMessages({
|
|
|
283
283
|
defaultMessage: `Discard`,
|
|
284
284
|
},
|
|
285
285
|
"creativesTemplatesEdit": {
|
|
286
|
-
id: `${scope}.
|
|
286
|
+
id: `${scope}.creativesTemplatesEdit`,
|
|
287
287
|
defaultMessage: `Edit`,
|
|
288
288
|
},
|
|
289
289
|
"creativesTemplatesEditName": {
|
|
290
|
-
id: `${scope}.
|
|
290
|
+
id: `${scope}.creativesTemplatesEditName`,
|
|
291
291
|
defaultMessage: `Edit name`,
|
|
292
292
|
},
|
|
293
293
|
"wechatAccountNotConfigured": {
|
|
@@ -58,7 +58,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
58
58
|
showImageSelectionBox: false,
|
|
59
59
|
isDragDrop: false,
|
|
60
60
|
showConfirmationModal: false,
|
|
61
|
-
modalContent: {title: this.props.intl.formatMessage(messages.
|
|
61
|
+
modalContent: {title: this.props.intl.formatMessage(messages.alert), body: this.props.intl.formatMessage(messages.deleteLanguageConfirmation), type: 'confirm', id: 'email-language-delete-modal'},
|
|
62
62
|
showModal: false,
|
|
63
63
|
page: 1,
|
|
64
64
|
perPageLimit: 25,
|
|
@@ -906,14 +906,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
906
906
|
let modalContent = {};
|
|
907
907
|
if (type === 'delete-version') {
|
|
908
908
|
modalContent = {
|
|
909
|
-
title: this.props.intl.formatMessage(messages.
|
|
909
|
+
title: this.props.intl.formatMessage(messages.alert),
|
|
910
910
|
body: this.props.intl.formatMessage(messages.deleteVersionConfirmation),
|
|
911
911
|
type: 'confirm',
|
|
912
912
|
id: 'email-version-delete-modal',
|
|
913
913
|
};
|
|
914
914
|
} else if (type === 'delete-language') {
|
|
915
915
|
modalContent = {
|
|
916
|
-
title: this.props.intl.formatMessage(messages.
|
|
916
|
+
title: this.props.intl.formatMessage(messages.alert),
|
|
917
917
|
body: this.props.intl.formatMessage(messages.deleteLanguageConfirmation),
|
|
918
918
|
type: 'confirm',
|
|
919
919
|
id: 'email-language-delete-modal',
|
|
@@ -1001,7 +1001,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1001
1001
|
showImageSelectionBox: false,
|
|
1002
1002
|
isDragDrop: false,
|
|
1003
1003
|
showConfirmationModal: false,
|
|
1004
|
-
modalContent: {title: this.props.intl.formatMessage(messages.
|
|
1004
|
+
modalContent: {title: this.props.intl.formatMessage(messages.alert), body: this.props.intl.formatMessage(messages.deleteLanguageConfirmation), type: 'confirm', id: 'email-language-delete-modal'},
|
|
1005
1005
|
showModal: false,
|
|
1006
1006
|
page: 1,
|
|
1007
1007
|
perPageLimit: 25,
|
|
@@ -1823,7 +1823,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1823
1823
|
|
|
1824
1824
|
moveToTemplates = () => {
|
|
1825
1825
|
const modalContent = {
|
|
1826
|
-
title: this.props.intl.formatMessage(messages.
|
|
1826
|
+
title: this.props.intl.formatMessage(messages.alert),
|
|
1827
1827
|
body: this.props.intl.formatMessage(messages.goBackTemporaryChangesLost),
|
|
1828
1828
|
type: 'confirm',
|
|
1829
1829
|
id: 'template-back-confirm-modal',
|
|
@@ -167,7 +167,7 @@ export default defineMessages({
|
|
|
167
167
|
defaultMessage: 'Please upload an image to proceed',
|
|
168
168
|
},
|
|
169
169
|
"Maximum characters length exceeds": {
|
|
170
|
-
id: 'creatives.containersV2.Line.Create.
|
|
170
|
+
id: 'creatives.containersV2.Line.Create.maximumCharacterLengthExceeds',
|
|
171
171
|
defaultMessage: 'Maximum characters length exceeds',
|
|
172
172
|
},
|
|
173
173
|
"alertMessage": {
|
|
@@ -231,7 +231,7 @@ export default defineMessages({
|
|
|
231
231
|
defaultMessage: 'Mobile Push',
|
|
232
232
|
},
|
|
233
233
|
"selectActionButton": {
|
|
234
|
-
id: 'creatives.containersV2.MobilePush.Create.
|
|
234
|
+
id: 'creatives.containersV2.MobilePush.Create.selectActionButton',
|
|
235
235
|
defaultMessage: 'Select action buttons',
|
|
236
236
|
},
|
|
237
237
|
"uploadImageSizeErrorTitle": {
|
|
@@ -247,7 +247,7 @@ export default defineMessages({
|
|
|
247
247
|
defaultMessage: 'IOS template is not configured, save without IOS template',
|
|
248
248
|
},
|
|
249
249
|
"selectActionButton": {
|
|
250
|
-
id: 'creatives.containersV2.MobilePush.Edit.
|
|
250
|
+
id: 'creatives.containersV2.MobilePush.Edit.selectActionButton',
|
|
251
251
|
defaultMessage: 'Select action buttons',
|
|
252
252
|
},
|
|
253
253
|
"validationError": {
|
|
@@ -23,7 +23,7 @@ export default defineMessages({
|
|
|
23
23
|
defaultMessage: 'Which type of content you want to create?',
|
|
24
24
|
},
|
|
25
25
|
creativeName: {
|
|
26
|
-
id: 'creatives.containersV2.MobilepushWrapper.
|
|
26
|
+
id: 'creatives.containersV2.MobilepushWrapper.creativeName',
|
|
27
27
|
defaultMessage: 'Creative name',
|
|
28
28
|
},
|
|
29
29
|
});
|
|
@@ -255,7 +255,7 @@ export default defineMessages({
|
|
|
255
255
|
defaultMessage: `Edit message content`,
|
|
256
256
|
},
|
|
257
257
|
"createMessageContent": {
|
|
258
|
-
id: `${scope}.
|
|
258
|
+
id: `${scope}.createMessageContent`,
|
|
259
259
|
defaultMessage: `New message`,
|
|
260
260
|
},
|
|
261
261
|
"creativeTemplatesDesc": {
|
|
@@ -267,7 +267,7 @@ export default defineMessages({
|
|
|
267
267
|
defaultMessage: `Done`,
|
|
268
268
|
},
|
|
269
269
|
"creativesTemplatesEdit": {
|
|
270
|
-
id: `${scope}.
|
|
270
|
+
id: `${scope}.creativesTemplatesEdit`,
|
|
271
271
|
defaultMessage: `Edit`,
|
|
272
272
|
},
|
|
273
273
|
"continue": {
|
|
@@ -553,7 +553,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
553
553
|
cols: [{
|
|
554
554
|
width: 23,
|
|
555
555
|
id: `tagList-${title}`,
|
|
556
|
-
label:
|
|
556
|
+
label: "Tags",
|
|
557
557
|
type: "tag-list", //Resembles component to be used
|
|
558
558
|
metaType: "List",
|
|
559
559
|
datatype: "select",
|
|
@@ -589,7 +589,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
589
589
|
type: "input", //Resembles component to be used
|
|
590
590
|
metaType: "text",
|
|
591
591
|
datatype: "string",
|
|
592
|
-
errorMessage:
|
|
592
|
+
errorMessage: "Invalid content",
|
|
593
593
|
required: true,
|
|
594
594
|
fluid: true,
|
|
595
595
|
disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
|
|
@@ -625,12 +625,12 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
625
625
|
cols: [
|
|
626
626
|
{
|
|
627
627
|
id: 'template-link',
|
|
628
|
-
placeholder:
|
|
629
|
-
label:
|
|
628
|
+
placeholder: 'Link',
|
|
629
|
+
label: 'Link',
|
|
630
630
|
type: "input", //Resembles component to be used
|
|
631
631
|
metaType: "text",
|
|
632
632
|
datatype: "string",
|
|
633
|
-
errorMessage:
|
|
633
|
+
errorMessage: 'Link cannot be empty.',
|
|
634
634
|
required: true,
|
|
635
635
|
fluid: true,
|
|
636
636
|
disabled: (this.props.location.query.type === 'embedded' && this.state.isEdit),
|
|
@@ -655,7 +655,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
655
655
|
cols: [
|
|
656
656
|
{
|
|
657
657
|
id: "is-internal-url",
|
|
658
|
-
label: this
|
|
658
|
+
label: 'Is this internal url',
|
|
659
659
|
standalone: true,
|
|
660
660
|
labelStyle: {
|
|
661
661
|
backgroundColor: "white",
|
|
@@ -46,7 +46,7 @@ export default defineMessages({
|
|
|
46
46
|
id: 'creatives.containersV2.WeChat.link',
|
|
47
47
|
defaultMessage: 'Link',
|
|
48
48
|
},
|
|
49
|
-
'
|
|
49
|
+
'Is this internal url': {
|
|
50
50
|
id: 'creatives.containersV2.WeChat.isInternalUrl',
|
|
51
51
|
defaultMessage: 'Is this internal url',
|
|
52
52
|
},
|
|
@@ -94,12 +94,12 @@ export default defineMessages({
|
|
|
94
94
|
id: 'creatives.containers.WeChat.newWechat',
|
|
95
95
|
defaultMessage: 'New wechat',
|
|
96
96
|
},
|
|
97
|
-
"
|
|
97
|
+
"Link cannot be empty.": {
|
|
98
98
|
id: 'creatives.containers.WeChat.linkErrorMessage',
|
|
99
99
|
defaultMessage: 'Link cannot be empty.',
|
|
100
100
|
},
|
|
101
|
-
"
|
|
101
|
+
"Invalid content": {
|
|
102
102
|
id: 'creatives.containers.WeChat.hasInvalidContent',
|
|
103
|
-
defaultMessage: '
|
|
103
|
+
defaultMessage: 'Invalid content.',
|
|
104
104
|
},
|
|
105
105
|
});
|