@capillarytech/creatives-library 3.1.13 → 3.1.14
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/package.json +2 -2
- package/translations/en.json +6 -2
- package/translations/zh.json +4 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +6 -4
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +1 -2
- package/v2Containers/App/constants.js +11 -0
- package/v2Containers/Cap/messages.js +8 -0
- package/v2Containers/Cap/sagas.js +1 -8
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -1
- package/v2Containers/EmailWrapper/index.js +64 -44
- package/v2Containers/Templates/_templates.scss +0 -1
- package/v2Containers/Templates/index.js +3 -3
- package/v2Containers/WeChat/MapTemplates/index.js +1 -1
- package/v2Containers/WeChat/MapTemplates/messages.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +5 -2
- package/v2Containers/WeChat/RichmediaTemplates/Edit/reducer.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.14",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "LicenseRef-LICENSE",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@babel/node": "^7.8.
|
|
15
|
+
"@babel/node": "^7.8.4",
|
|
16
16
|
"@babel/polyfill": "7.4.3",
|
|
17
17
|
"babel-cli": "^6.26.0",
|
|
18
18
|
"chalk": "1.1.3",
|
package/translations/en.json
CHANGED
|
@@ -684,7 +684,7 @@
|
|
|
684
684
|
"creatives.containers.WeChat.template": "Template",
|
|
685
685
|
"creatives.containers.WeChat.templateMapping": "Template mapping",
|
|
686
686
|
"creatives.containers.WeChat.wechatCreateSuccess": "WeChat template mapped successfully",
|
|
687
|
-
"creatives.containers.WeChat.wechatEditSuccess": "WeChat template
|
|
687
|
+
"creatives.containers.WeChat.wechatEditSuccess": "WeChat template edited successfully",
|
|
688
688
|
"creatives.containersV2.Assets.Gallery.addImages": "Add images",
|
|
689
689
|
"creatives.containersV2.Assets.Gallery.alphabetically": "Alphabetically",
|
|
690
690
|
"creatives.containersV2.Assets.Gallery.assetDeleteFailed": "Image deletion failed.",
|
|
@@ -1350,10 +1350,14 @@
|
|
|
1350
1350
|
"creatives.containersV2.WeChat.template": "Template",
|
|
1351
1351
|
"creatives.containersV2.WeChat.templateMapping": "Template mapping",
|
|
1352
1352
|
"creatives.containersV2.WeChat.wechatCreateSuccess": "WeChat template mapped successfully",
|
|
1353
|
-
"creatives.containersV2.WeChat.wechatEditSuccess": "WeChat template
|
|
1353
|
+
"creatives.containersV2.WeChat.wechatEditSuccess": "WeChat template edited successfully",
|
|
1354
1354
|
"creatives.containersV2.appName": "App Name",
|
|
1355
|
+
"creatives.containersV2.audience": "Audience",
|
|
1356
|
+
"creatives.containersV2.campaigns": "Campaigns",
|
|
1355
1357
|
"creatives.containersV2.campaignsDashboard": "Campaigns",
|
|
1356
1358
|
"creatives.containersV2.campaignsHome": "Campaigns Home",
|
|
1359
|
+
"creatives.containersV2.creatives": "Creatives",
|
|
1360
|
+
"creatives.containersV2.incentive": "Incentive",
|
|
1357
1361
|
"customdatepicker.cancel": "Cancel",
|
|
1358
1362
|
"customdatepicker.done": "Done",
|
|
1359
1363
|
"reon.components.Cap.Workbench": "WorkBench",
|
package/translations/zh.json
CHANGED
|
@@ -1352,8 +1352,12 @@
|
|
|
1352
1352
|
"creatives.containersV2.WeChat.wechatCreateSuccess": "",
|
|
1353
1353
|
"creatives.containersV2.WeChat.wechatEditSuccess": "",
|
|
1354
1354
|
"creatives.containersV2.appName": "",
|
|
1355
|
+
"creatives.containersV2.audience": "",
|
|
1356
|
+
"creatives.containersV2.campaigns": "",
|
|
1355
1357
|
"creatives.containersV2.campaignsDashboard": "",
|
|
1356
1358
|
"creatives.containersV2.campaignsHome": "",
|
|
1359
|
+
"creatives.containersV2.creatives": "",
|
|
1360
|
+
"creatives.containersV2.incentive": "",
|
|
1357
1361
|
"customdatepicker.cancel": "",
|
|
1358
1362
|
"customdatepicker.done": "",
|
|
1359
1363
|
"reon.components.Cap.Workbench": "",
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
background: white;
|
|
8
8
|
width: 40%;
|
|
9
9
|
text-align: left;
|
|
10
|
-
height:
|
|
11
|
-
|
|
10
|
+
height: fit-content;
|
|
11
|
+
border-radius: $CAP_SPACE_04;
|
|
12
12
|
.richmedia-template {
|
|
13
|
-
.image-container {
|
|
13
|
+
.richmedia-image-container {
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: 102px;
|
|
16
16
|
position: relative;
|
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
justify-content: space-between;
|
|
40
40
|
margin: 8px;
|
|
41
41
|
padding-bottom: 8px;
|
|
42
|
-
border-bottom: 1px solid #dfe2e7;
|
|
43
42
|
img {
|
|
44
43
|
border-radius: 4px;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
46
|
+
.additional-richmedia-container:not(:last-child) {
|
|
47
|
+
border-bottom: 1px solid #dfe2e7;
|
|
48
|
+
}
|
|
47
49
|
div {
|
|
48
50
|
text-overflow: ellipsis;
|
|
49
51
|
overflow: hidden;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* WechatRichmediaTemplatePreview
|
|
@@ -23,7 +22,7 @@ class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-dis
|
|
|
23
22
|
const mediaListLength = content.length;
|
|
24
23
|
const contentData = content[0];
|
|
25
24
|
previewMsg.push(
|
|
26
|
-
<div className="image-container">
|
|
25
|
+
<div className="richmedia-image-container">
|
|
27
26
|
<img alt="default" width="100%" height="102px" src={contentData.image_url} />
|
|
28
27
|
{mediaListLength !== 1 && (
|
|
29
28
|
<div className="name-container">
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import globalMessages from '../Cap/messages';
|
|
4
|
+
|
|
1
5
|
export const GET_SIDEBAR_REQUEST = 'app/App/GET_SIDEBAR_REQUEST';
|
|
2
6
|
export const GET_SIDEBAR_SUCCESS = 'app/App/GET_SIDEBAR_SUCCESS';
|
|
3
7
|
export const GET_SIDEBAR_FAILURE = 'app/App/GET_SIDEBAR_FAILURE';
|
|
8
|
+
|
|
9
|
+
export const getTopbarMenuDataValue = () => ([
|
|
10
|
+
{ label: <FormattedMessage {...globalMessages.campaigns} />, link: '/campaigns/ui/list', key: 'campaigns' },
|
|
11
|
+
{ label: <FormattedMessage {...globalMessages.audience} />, link: '/audience-manager/list', key: 'audience' },
|
|
12
|
+
{ label: <FormattedMessage {...globalMessages.incentive} />, link: '/coupons/ui/', key: 'incentive' },
|
|
13
|
+
{ label: <FormattedMessage {...globalMessages.creatives} />, link: '/creatives/ui/v2', key: 'creatives' },
|
|
14
|
+
]);
|
|
@@ -64,4 +64,12 @@ export default defineMessages({
|
|
|
64
64
|
id: 'creatives.containersV2.appName',
|
|
65
65
|
defaultMessage: "App Name",
|
|
66
66
|
},
|
|
67
|
+
"audience": {
|
|
68
|
+
id: 'creatives.containersV2.audience',
|
|
69
|
+
defaultMessage: 'Audience',
|
|
70
|
+
},
|
|
71
|
+
"incentive": {
|
|
72
|
+
id: 'creatives.containersV2.incentive',
|
|
73
|
+
defaultMessage: 'Incentive',
|
|
74
|
+
},
|
|
67
75
|
});
|
|
@@ -6,6 +6,7 @@ import * as LocalStorage from '../../services/localStorageApi';
|
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
import config from '../../config/app';
|
|
8
8
|
import pathConfig from '../../config/path';
|
|
9
|
+
import { getTopbarMenuDataValue } from '../../v2Containers/App/constants';
|
|
9
10
|
// import {makeSelectOrgId} from './selectors';
|
|
10
11
|
|
|
11
12
|
function* authorize(user) {
|
|
@@ -157,11 +158,3 @@ export default [
|
|
|
157
158
|
watchGetTopbarMenuData,
|
|
158
159
|
];
|
|
159
160
|
|
|
160
|
-
function getTopbarMenuDataValue() {
|
|
161
|
-
return [
|
|
162
|
-
{ label: 'Campaigns', link: '/campaigns/ui/list', key: 'campaigns' },
|
|
163
|
-
{ label: 'Audience', link: '/audience-manager/list', key: 'audience' },
|
|
164
|
-
{ label: 'Incentive', link: '/coupons/ui/', key: 'incentive' },
|
|
165
|
-
{ label: 'Creatives', link: '/creatives/ui/v2', key: 'creatives' },
|
|
166
|
-
];
|
|
167
|
-
}
|
|
@@ -117,7 +117,7 @@ function SlideBoxContent(props) {
|
|
|
117
117
|
)}
|
|
118
118
|
{isPreview && (
|
|
119
119
|
<TemplatePreview
|
|
120
|
-
content={get(templateData, `versions.base['sms-editor']`)}
|
|
120
|
+
content={templateData.type.toUpperCase() === constants.SMS ? get(templateData, `versions.base['sms-editor']`) : get(templateData, `versions.base.content`)}
|
|
121
121
|
unicodeEnabled={get(templateData, `versions.base['unicode-validity']`)}
|
|
122
122
|
channel={templateData.type.toLowerCase()}
|
|
123
123
|
charCounterEnabled
|
|
@@ -11,10 +11,10 @@ import { createStructuredSelector } from 'reselect';
|
|
|
11
11
|
import { bindActionCreators } from 'redux';
|
|
12
12
|
import _ from 'lodash';
|
|
13
13
|
import styled from 'styled-components';
|
|
14
|
-
import { CapRadioCard, CapNotification, CapInput, CapUploader, CapSpin, CapButton} from '@capillarytech/cap-ui-library';
|
|
14
|
+
import { CapRadioCard, CapNotification, CapInput, CapUploader, CapSpin, CapButton } from '@capillarytech/cap-ui-library';
|
|
15
15
|
import ComponentWithLabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
16
16
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
17
|
-
import {selectEmailLayout, selectCmsTemplates, selectEdmEditor, uploadSelector} from '../Templates/selectors';
|
|
17
|
+
import { selectEmailLayout, selectCmsTemplates, selectEdmEditor, uploadSelector } from '../Templates/selectors';
|
|
18
18
|
import * as templatesActionsCreators from '../Templates/actions';
|
|
19
19
|
import Email from '../Email';
|
|
20
20
|
import CmsTemplatesComponent from '../../v2Components/CmsTemplatesComponent';
|
|
@@ -39,7 +39,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
39
39
|
templateName: '',
|
|
40
40
|
routeParams: {
|
|
41
41
|
pathname: `/email/create`,
|
|
42
|
-
query: { module: 'library', type: 'embedded'},
|
|
42
|
+
query: { module: 'library', type: 'embedded' },
|
|
43
43
|
},
|
|
44
44
|
modeContent: {
|
|
45
45
|
|
|
@@ -49,25 +49,25 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
49
49
|
};
|
|
50
50
|
this.modes = [
|
|
51
51
|
{
|
|
52
|
-
title: <FormattedMessage {...messages.zipUpload}/>,
|
|
53
|
-
content: <FormattedMessage {...messages.zipUploadDesc}/>,
|
|
52
|
+
title: <FormattedMessage {...messages.zipUpload} />,
|
|
53
|
+
content: <FormattedMessage {...messages.zipUploadDesc} />,
|
|
54
54
|
value: 'upload',
|
|
55
55
|
// onClick: () => {
|
|
56
56
|
// this.emailUploader.current.click();
|
|
57
57
|
// },
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
title: <FormattedMessage {...messages.useEditor}/>,
|
|
61
|
-
content: <FormattedMessage {...messages.useEditorDesc}/>,
|
|
60
|
+
title: <FormattedMessage {...messages.useEditor} />,
|
|
61
|
+
content: <FormattedMessage {...messages.useEditorDesc} />,
|
|
62
62
|
value: 'editor',
|
|
63
63
|
},
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
componentDidUpdate() {
|
|
68
|
-
const {modeContent} = this.state;
|
|
69
|
-
|
|
70
|
-
const {emailCreateMode, EmailLayout, CmsTemplates, step, SelectedEdmDefaultTemplate, templatesActions} = this.props;
|
|
68
|
+
const { modeContent } = this.state;
|
|
69
|
+
// const isValid = this.isValid();
|
|
70
|
+
const { emailCreateMode, EmailLayout, CmsTemplates, step, SelectedEdmDefaultTemplate, templatesActions } = this.props;
|
|
71
71
|
if (step === "modeSelection" && !this.state.selectedCreateMode && emailCreateMode === 'upload' && !EmailLayout) {
|
|
72
72
|
//document.getElementById('upload-email-template').click();
|
|
73
73
|
} else if (step === "templateSelection" && !this.state.selectedCreateMode) {
|
|
@@ -89,14 +89,14 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
89
89
|
this.props.templatesActions.resetTemplateData();
|
|
90
90
|
}
|
|
91
91
|
onTemplateNameChange = (ev) => {
|
|
92
|
-
this.setState({templateName: ev.target.value});
|
|
92
|
+
this.setState({ templateName: ev.target.value });
|
|
93
93
|
}
|
|
94
94
|
onChange = (e) => {
|
|
95
|
-
this.props.onEmailModeChange(
|
|
95
|
+
this.props.onEmailModeChange(e.target.value);
|
|
96
96
|
};
|
|
97
97
|
//isValid = () => !_.isEmpty(this.state.templateName)
|
|
98
98
|
setCreateMode = (emailCreateMode) => {
|
|
99
|
-
this.setState({selectedCreateMode: emailCreateMode});
|
|
99
|
+
this.setState({ selectedCreateMode: emailCreateMode });
|
|
100
100
|
}
|
|
101
101
|
handleZipUploadError = () => {
|
|
102
102
|
const message = {
|
|
@@ -115,13 +115,13 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
115
115
|
|
|
116
116
|
if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
|
|
117
117
|
templatesActions.handleZipUpload(file.originFileObj, () => { //handle upload success
|
|
118
|
-
this.setState({modeContent: { file}}, showNextStep);
|
|
118
|
+
this.setState({ modeContent: { file } }, showNextStep);
|
|
119
119
|
}, this.handleZipUploadError);
|
|
120
120
|
} else if (fileExtension === 'html' || fileExtension === 'htm') {
|
|
121
121
|
const reader = new FileReader();
|
|
122
122
|
reader.onload = () => {
|
|
123
123
|
const text = reader.result;
|
|
124
|
-
this.setState({modeContent: { file}}, () => {
|
|
124
|
+
this.setState({ modeContent: { file } }, () => {
|
|
125
125
|
templatesActions.handleHtmlUpload(text);
|
|
126
126
|
});
|
|
127
127
|
|
|
@@ -140,26 +140,44 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
handleEdmDefaultTemplateSelection = (id) => {
|
|
143
|
-
const {CmsTemplates, templatesActions } = this.props;
|
|
144
|
-
const data = _.find(CmsTemplates, {_id: id});
|
|
143
|
+
const { CmsTemplates, templatesActions } = this.props;
|
|
144
|
+
const data = _.find(CmsTemplates, { _id: id });
|
|
145
145
|
|
|
146
146
|
templatesActions.setEdmTemplate(data);
|
|
147
147
|
this.setState({
|
|
148
|
-
selectedCreateMode: 'editor'
|
|
148
|
+
selectedCreateMode: 'editor',
|
|
149
|
+
});
|
|
149
150
|
};
|
|
150
|
-
useFileUpload = ({file}) => {
|
|
151
|
-
this.setState({modeContent: {}}, () => {
|
|
151
|
+
useFileUpload = ({ file }) => {
|
|
152
|
+
this.setState({ modeContent: {} }, () => {
|
|
152
153
|
this.handleFileUpload(file);
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
156
|
useEditor = (id) => {
|
|
156
|
-
this.setState({modeContent: {id}}, this.props.showNextStep);
|
|
157
|
+
this.setState({ modeContent: { id } }, this.props.showNextStep);
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
isShowEmailCreate = () => !_.isEmpty(this.state.selectedCreateMode) && (!_.isEmpty(this.props.EmailLayout) || this.props.SelectedEdmDefaultTemplate)
|
|
160
161
|
render() {
|
|
161
|
-
const {
|
|
162
|
-
|
|
162
|
+
const {
|
|
163
|
+
showTemplateName,
|
|
164
|
+
emailCreateMode,
|
|
165
|
+
isGetFormData,
|
|
166
|
+
getFormdata,
|
|
167
|
+
type,
|
|
168
|
+
CmsTemplates,
|
|
169
|
+
step,
|
|
170
|
+
cap,
|
|
171
|
+
isFullMode,
|
|
172
|
+
EmailLayout,
|
|
173
|
+
setIsLoadingContent,
|
|
174
|
+
onValidationFail,
|
|
175
|
+
forwardedTags,
|
|
176
|
+
} = this.props;
|
|
177
|
+
const {
|
|
178
|
+
templateName,
|
|
179
|
+
modeContent,
|
|
180
|
+
} = this.state;
|
|
163
181
|
const isShowEmailCreate = this.isShowEmailCreate();
|
|
164
182
|
return (
|
|
165
183
|
<div>
|
|
@@ -167,12 +185,12 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
167
185
|
{step === "modeSelection" || (step === "templateSelection" && emailCreateMode === "upload") ?
|
|
168
186
|
<div>
|
|
169
187
|
{isFullMode &&
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
188
|
+
<CapInput
|
|
189
|
+
label={<FormattedMessage {...messages.creativeName} />}
|
|
190
|
+
onChange={this.onTemplateNameChange}
|
|
191
|
+
value={templateName}
|
|
192
|
+
labelPosition="top"
|
|
193
|
+
size="default"
|
|
176
194
|
/>
|
|
177
195
|
}
|
|
178
196
|
<CardContainer>
|
|
@@ -180,23 +198,23 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
180
198
|
panes={this.modes}
|
|
181
199
|
onChange={this.onChange}
|
|
182
200
|
selected={emailCreateMode}
|
|
183
|
-
label={<FormattedMessage {...messages.createMode}/>}
|
|
201
|
+
label={<FormattedMessage {...messages.createMode} />}
|
|
184
202
|
/>
|
|
185
203
|
</CardContainer>
|
|
186
204
|
<div>
|
|
187
205
|
{emailCreateMode === "upload" &&
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
206
|
+
<div style={{ marginLeft: '8px' }}>
|
|
207
|
+
<CapUploader onChange={this.useFileUpload} accept=".zip, .html, .htm" showUploadList={false}>
|
|
208
|
+
<CapButton>{this.props.intl.formatMessage(messages.upload)}</CapButton>
|
|
209
|
+
</CapUploader>
|
|
210
|
+
{!_.isEmpty(EmailLayout) &&
|
|
211
|
+
<div>{_.get(modeContent, "file.name")}</div>
|
|
212
|
+
}
|
|
213
|
+
</div>
|
|
214
|
+
}
|
|
197
215
|
</div>
|
|
198
216
|
</div>
|
|
199
|
-
|
|
217
|
+
:
|
|
200
218
|
<div>
|
|
201
219
|
{isShowEmailCreate && <Email
|
|
202
220
|
setIsLoadingContent={setIsLoadingContent}
|
|
@@ -209,14 +227,15 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
209
227
|
getFormSubscriptionData={getFormdata}
|
|
210
228
|
getDefaultTags={type}
|
|
211
229
|
isFullMode={isFullMode}
|
|
212
|
-
defaultData={{'template-name': templateName}}
|
|
230
|
+
defaultData={{ 'template-name': templateName }}
|
|
213
231
|
cap={cap}
|
|
214
232
|
showTemplateName={showTemplateName}
|
|
215
233
|
onValidationFail={onValidationFail}
|
|
216
|
-
|
|
217
|
-
|
|
234
|
+
forwardedTags={forwardedTags}
|
|
235
|
+
/>}
|
|
236
|
+
{CmsTemplates && !isShowEmailCreate && <CmsTemplatesComponent cmsTemplates={CmsTemplates} handleEdmDefaultTemplateSelection={this.useEditor} />}
|
|
218
237
|
</div>
|
|
219
|
-
|
|
238
|
+
}
|
|
220
239
|
</CapSpin>
|
|
221
240
|
</div>
|
|
222
241
|
);
|
|
@@ -243,6 +262,7 @@ EmailWrapper.propTypes = {
|
|
|
243
262
|
setIsLoadingContent: PropTypes.func,
|
|
244
263
|
showTemplateName: PropTypes.func,
|
|
245
264
|
onValidationFail: PropTypes.func,
|
|
265
|
+
forwardedTags: PropTypes.object,
|
|
246
266
|
};
|
|
247
267
|
|
|
248
268
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1542,7 +1542,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1542
1542
|
{ key: isMobilePushChannel ? account.id : account.uuid,
|
|
1543
1543
|
title: account.name,
|
|
1544
1544
|
value: account.name,
|
|
1545
|
-
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="
|
|
1545
|
+
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="auto" height="2rem"/>,
|
|
1546
1546
|
}
|
|
1547
1547
|
);
|
|
1548
1548
|
} else if (query.module && (isWechatChannel || isMobilePushChannel)) {
|
|
@@ -1551,7 +1551,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1551
1551
|
key: isMobilePushChannel ? account.id : account.uuid,
|
|
1552
1552
|
value: account.name,
|
|
1553
1553
|
title: account.name,
|
|
1554
|
-
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="
|
|
1554
|
+
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="auto" height="2rem"/>,
|
|
1555
1555
|
}
|
|
1556
1556
|
);
|
|
1557
1557
|
}
|
|
@@ -1561,7 +1561,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1561
1561
|
key: isMobilePushChannel ? account.id : account.uuid,
|
|
1562
1562
|
value: account.name,
|
|
1563
1563
|
title: account.name,
|
|
1564
|
-
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="
|
|
1564
|
+
icon: <CapIcon.CapIconAvatar text={account.name[0]} width="auto" height="2rem"/>,
|
|
1565
1565
|
}
|
|
1566
1566
|
);
|
|
1567
1567
|
}
|
|
@@ -442,7 +442,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
442
442
|
previewContent: stateFormData['sms-preview'],
|
|
443
443
|
BrandId: (selectedWeChatAccount.configs.brand_id ? selectedWeChatAccount.configs.brand_id : ''),
|
|
444
444
|
OriginalId: selectedWeChatAccount.sourceAccountIdentifier,
|
|
445
|
-
content: editTemplateData.versions.base.content,
|
|
445
|
+
content: encodeURIComponent(editTemplateData.versions.base.content),
|
|
446
446
|
isInternalUrl: this.state.formData['is-internal-url'],
|
|
447
447
|
creative_template_id: editTemplateData._id,
|
|
448
448
|
touser: "{{wechat_open_id}}",
|
|
@@ -60,7 +60,7 @@ export default defineMessages({
|
|
|
60
60
|
},
|
|
61
61
|
"wechatEditSuccess": {
|
|
62
62
|
id: 'creatives.containersV2.WeChat.wechatEditSuccess',
|
|
63
|
-
defaultMessage: "WeChat template
|
|
63
|
+
defaultMessage: "WeChat template edited successfully",
|
|
64
64
|
},
|
|
65
65
|
"wechatCreateSuccess": {
|
|
66
66
|
id: 'creatives.containersV2.WeChat.wechatCreateSuccess',
|
|
@@ -18,7 +18,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
18
18
|
import forEach from 'lodash/forEach';
|
|
19
19
|
import isEqual from 'lodash/isEqual';
|
|
20
20
|
import get from 'lodash/get';
|
|
21
|
-
import { CapRow, CapColumn, CapButton, CapCard, CapSpin, CapInput, CapHeading, CapDivider, CapIcon, CapLink } from '@capillarytech/cap-ui-library';
|
|
21
|
+
import { CapRow, CapColumn, CapButton, CapCard, CapSpin, CapInput, CapHeading, CapDivider, CapIcon, CapLink, CapNotification } from '@capillarytech/cap-ui-library';
|
|
22
22
|
import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
|
|
23
23
|
import * as actions from './actions';
|
|
24
24
|
import richmediaschema from './richmediaschema';
|
|
@@ -233,6 +233,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
233
233
|
msgcontent: "RICH_MEDIA_WECHAT",
|
|
234
234
|
},
|
|
235
235
|
};
|
|
236
|
+
message.mediaList = message.mediaList.map((media) => ({...media, content: encodeURIComponent(media.content)}));
|
|
236
237
|
const data = {
|
|
237
238
|
data: message,
|
|
238
239
|
accountId: get(templates, 'selectedWeChatAccount.id'),
|
|
@@ -546,7 +547,9 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
546
547
|
}
|
|
547
548
|
this.setState({loading: true});
|
|
548
549
|
this.props.actions.saveTemplate(saveObj, (response) => {
|
|
549
|
-
|
|
550
|
+
CapNotification.success({
|
|
551
|
+
message: this.props.intl.formatMessage(messages.saveSuccess),
|
|
552
|
+
});
|
|
550
553
|
if (getFormData) {
|
|
551
554
|
getFormData(this.getFormData({
|
|
552
555
|
mediaId: response.mediaId,
|