@capillarytech/creatives-library 3.9.10 → 3.9.12
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/Ckeditor/index.js +1 -1
- package/components/TemplatePreview/_templatePreview.scss +8 -0
- package/components/TemplatePreview/index.js +1 -1
- package/package.json +1 -1
- package/v2Components/Ckeditor/index.js +1 -1
- package/v2Components/TemplatePreview/_templatePreview.scss +11 -0
- package/v2Components/TemplatePreview/index.js +1 -1
- package/v2Containers/CreativesContainer/index.js +2 -1
- package/v2Containers/Line/Create/index.js +13 -18
- package/v2Containers/WeChat/MapTemplates/index.js +1 -1
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.
|
|
16
|
+
const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.14.0/ckeditor.js";
|
|
17
17
|
const user = localStorage.getItem('user');
|
|
18
18
|
let locale = 'en';
|
|
19
19
|
if (user && JSON.parse(user).lang) {
|
|
@@ -292,7 +292,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
292
292
|
channel && channel.toLowerCase() === 'line' ? (
|
|
293
293
|
<div className="shell align-center" id="sms-preview">
|
|
294
294
|
<CapImage className="preview-image" src={wechatBody} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
295
|
-
<div className="msgContainer">
|
|
295
|
+
<div className="msgContainer line-preview">
|
|
296
296
|
<div className="sms-icon" style={{ width: '25px', height: '25px', background: '#2E89DF' }}></div>
|
|
297
297
|
<div className="message-pop align-left" style={{ background: '#ffffff', color: '#333333' }}>
|
|
298
298
|
{ (content && content.bodyImage) ? <CapImage src={content.bodyImage} alt="ddd" style={{maxWidth: '100%'}}/> : '' }
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.
|
|
16
|
+
const defaultScriptUrl = "https://ckeditor.com/assets/libs/ckeditor4/4.14.0/ckeditor.js";
|
|
17
17
|
const user = localStorage.getItem('user');
|
|
18
18
|
let locale = 'en';
|
|
19
19
|
if (user && JSON.parse(user).lang) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
1
3
|
.shell-v2 {
|
|
2
4
|
position: relative;
|
|
3
5
|
-webkit-transform: translate(-50%);
|
|
@@ -40,6 +42,15 @@
|
|
|
40
42
|
&.wechat{
|
|
41
43
|
width: 52%;
|
|
42
44
|
}
|
|
45
|
+
&.line-preview {
|
|
46
|
+
margin-left: $CAP_SPACE_16;
|
|
47
|
+
|
|
48
|
+
.message-pop {
|
|
49
|
+
width: 80%;
|
|
50
|
+
left: 36px;
|
|
51
|
+
margin-top: -6px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
43
54
|
|
|
44
55
|
.message-pop{
|
|
45
56
|
.unicode-disabled{
|
|
@@ -281,7 +281,7 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
281
281
|
channel && channel.toLowerCase() === 'line' ? (
|
|
282
282
|
<div className="shell-v2 align-center" id="sms-preview">
|
|
283
283
|
<CapImage className="preview-image" src={wechatBodyNew} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
284
|
-
<div className="msgContainer">
|
|
284
|
+
<div className="msgContainer line-preview">
|
|
285
285
|
<div className="sms-icon" style={{ left: 10, borderRadius: '50%', width: '20px', height: '20px', background: '#2E89DF' }}></div>
|
|
286
286
|
<div className="message-pop align-left" style={{ background: '#ffffff', color: '#333333' }}>
|
|
287
287
|
{
|
|
@@ -216,7 +216,7 @@ class Creatives extends React.Component {
|
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
218
218
|
case constants.LINE: {
|
|
219
|
-
const { messageBody } = templateData;
|
|
219
|
+
const { messageBody= '{}', isDefault } = templateData;
|
|
220
220
|
const {
|
|
221
221
|
messages,
|
|
222
222
|
to,
|
|
@@ -226,6 +226,7 @@ class Creatives extends React.Component {
|
|
|
226
226
|
} = JSON.parse(messageBody);
|
|
227
227
|
creativesTemplateData = {
|
|
228
228
|
type: constants.LINE,
|
|
229
|
+
isDefault,
|
|
229
230
|
edit: true,
|
|
230
231
|
definition: {
|
|
231
232
|
mode: type,
|
|
@@ -143,7 +143,7 @@ export class Line extends Component {
|
|
|
143
143
|
} = lineData;
|
|
144
144
|
selectedAccount = weCrmAccounts.filter((account) => account === selectedAccount);
|
|
145
145
|
}
|
|
146
|
-
getFormSubscriptionData({ ...this.getFormData(), accountDetails: selectedAccount});
|
|
146
|
+
getFormSubscriptionData({ ...this.getFormData(), accountDetails: selectedAccount, type: 'LINE' });
|
|
147
147
|
}
|
|
148
148
|
if (templateData && templateData.edit) {
|
|
149
149
|
this.setEditState(templateData);
|
|
@@ -168,7 +168,7 @@ export class Line extends Component {
|
|
|
168
168
|
type: 'TAG',
|
|
169
169
|
context:
|
|
170
170
|
this.props.location.query.type === 'embedded'
|
|
171
|
-
?
|
|
171
|
+
? 'outbound'
|
|
172
172
|
: 'default',
|
|
173
173
|
embedded:
|
|
174
174
|
this.props.location.query.type === 'embedded'
|
|
@@ -287,7 +287,7 @@ export class Line extends Component {
|
|
|
287
287
|
|
|
288
288
|
setEditState = (data) => {
|
|
289
289
|
const { formData: previousFormData } = this.state;
|
|
290
|
-
const { text, originalContentUrl, imagePreview, image } = get(data, "versions.base.content.messages[0]");
|
|
290
|
+
const { text, originalContentUrl, imagePreview, image } = get(data, "versions.base.content.messages[0]", {});
|
|
291
291
|
const retrievedData = {
|
|
292
292
|
...previousFormData[0],
|
|
293
293
|
};
|
|
@@ -873,17 +873,10 @@ export class Line extends Component {
|
|
|
873
873
|
this.props.globalActions.addMessageToQueue(message);
|
|
874
874
|
} else {
|
|
875
875
|
data.fileParams.isGeneratePreview = true;
|
|
876
|
-
const name = data.file.name.split('.');
|
|
877
|
-
const blob = data.file.slice(0, -1, 'image');
|
|
878
|
-
const newFile = new File(
|
|
879
|
-
[blob],
|
|
880
|
-
`${name[0]}${Date.now()}.${name[1]}`,
|
|
881
|
-
{ type: 'image' }
|
|
882
|
-
);
|
|
883
876
|
this.props.actions.uploadAsset(
|
|
884
|
-
|
|
877
|
+
data.file,
|
|
885
878
|
data.type,
|
|
886
|
-
data.fileParams
|
|
879
|
+
data.fileParams,
|
|
887
880
|
);
|
|
888
881
|
}
|
|
889
882
|
};
|
|
@@ -974,18 +967,20 @@ export class Line extends Component {
|
|
|
974
967
|
createTemplateInProgress,
|
|
975
968
|
assetUploading,
|
|
976
969
|
} = {},
|
|
977
|
-
templateData
|
|
978
|
-
edit,
|
|
979
|
-
mode,
|
|
980
|
-
orgId,
|
|
981
|
-
} = {},
|
|
970
|
+
templateData,
|
|
982
971
|
params: {
|
|
983
972
|
id,
|
|
984
973
|
} = {},
|
|
985
974
|
} = this.props;
|
|
975
|
+
const {
|
|
976
|
+
edit,
|
|
977
|
+
mode,
|
|
978
|
+
orgId,
|
|
979
|
+
isDefault,
|
|
980
|
+
} = templateData || {};
|
|
986
981
|
let loading = createTemplateInProgress || false;
|
|
987
982
|
loading = !!assetUploading;
|
|
988
|
-
if (edit || mode === 'edit' || (orgId && id)) {
|
|
983
|
+
if (!isDefault && (edit || mode === 'edit' || (orgId && id))) {
|
|
989
984
|
const {
|
|
990
985
|
base: {
|
|
991
986
|
'message-editor': msgEditor,
|
|
@@ -442,7 +442,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
442
442
|
data: {},
|
|
443
443
|
BrandId: (selectedWeChatAccount.configs.brand_id ? selectedWeChatAccount.configs.brand_id : ''),
|
|
444
444
|
OriginalId: selectedWeChatAccount.sourceAccountIdentifier,
|
|
445
|
-
content:
|
|
445
|
+
content: 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}}",
|