@capillarytech/creatives-library 6.6.1 → 6.7.0
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 +1 -1
- package/package.json +1 -1
- package/v2Containers/CreativesContainer/constants.js +0 -2
- package/v2Containers/Email/index.js +7 -2
- package/v2Containers/MobilePush/Create/index.js +2 -5
- package/v2Containers/MobilePush/Edit/index.js +2 -5
- package/v2Containers/Templates/index.js +8 -13
- package/v2Components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
|
@@ -577,7 +577,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
577
577
|
licenseCode: selectedWeChatAccount.sourceAccountIdentifier,
|
|
578
578
|
};
|
|
579
579
|
if (this.props.location.query && this.props.location.query.module !== 'dvs') {
|
|
580
|
-
obj.definition.mode = this
|
|
580
|
+
obj.definition.mode = _.get(this, 'props.Edit.templateDetails.mode', '');
|
|
581
581
|
}
|
|
582
582
|
const android = {};
|
|
583
583
|
Object.keys(formData[0]).forEach((data) => {
|
package/package.json
CHANGED
|
@@ -15,5 +15,3 @@ export const WECHAT = "WECHAT";
|
|
|
15
15
|
export const FACEBOOK = "FACEBOOK";
|
|
16
16
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
17
17
|
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|
|
18
|
-
export const ANDROID = "android";
|
|
19
|
-
export const IOS = "ios";
|
|
@@ -2578,8 +2578,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2578
2578
|
);
|
|
2579
2579
|
|
|
2580
2580
|
showTestAndPreviewIcons = (action) => {
|
|
2581
|
-
const
|
|
2582
|
-
const
|
|
2581
|
+
const { formData = [] } = this.state;
|
|
2582
|
+
const { selectedLanguages = [] } = formData && formData[0];
|
|
2583
|
+
const previewContent = formData[0] &&
|
|
2584
|
+
selectedLanguages &&
|
|
2585
|
+
formData[0][selectedLanguages[0]] &&
|
|
2586
|
+
formData[0][selectedLanguages[0]]['template-content'];
|
|
2587
|
+
const previewSubject = formData['template-subject'];
|
|
2583
2588
|
const testOrPreviewProps = {channel: EMAIL, content: previewContent, subject: previewSubject};
|
|
2584
2589
|
const { onPreviewContentClicked, onTestContentClicked } = this.props;
|
|
2585
2590
|
return (
|
|
@@ -27,7 +27,6 @@ import messages from './messages';
|
|
|
27
27
|
import getEventsMap from '../eventsMap';
|
|
28
28
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
29
29
|
import { TRACK_CREATE_MPUSH } from '../../App/constants';
|
|
30
|
-
import { ANDROID, IOS } from '../../CreativesContainer/constants';
|
|
31
30
|
|
|
32
31
|
const PrefixWrapper = styled.div`
|
|
33
32
|
margin-right: 16px;
|
|
@@ -104,10 +103,8 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
104
103
|
}
|
|
105
104
|
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && isEmpty(this.state.schema)) {
|
|
106
105
|
const schema = this.props.params.mode === "text" ? nextProps.metaEntities.layouts[0].definition.textSchema : nextProps.metaEntities.layouts[0].definition.imageSchema;
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const isAndroidSupported = commChannels.includes(ANDROID);
|
|
110
|
-
const isIosSupported = commChannels.includes(IOS);
|
|
106
|
+
const isAndroidSupported = get(this, "props.Templates.selectedWeChatAccount.configs.android") === '1';
|
|
107
|
+
const isIosSupported = get(this, "props.Templates.selectedWeChatAccount.configs.ios") === '1';
|
|
111
108
|
if (!isAndroidSupported) {
|
|
112
109
|
const androidField = get(schema, "containers[0].panes[0]");
|
|
113
110
|
androidField.isSupported = false;
|
|
@@ -31,7 +31,6 @@ import getEventsMap from '../eventsMap';
|
|
|
31
31
|
import {getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields} from '../commonMethods';
|
|
32
32
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
33
33
|
import { TRACK_EDIT_MPUSH } from '../../App/constants';
|
|
34
|
-
import { ANDROID, IOS } from '../../CreativesContainer/constants';
|
|
35
34
|
|
|
36
35
|
const PrefixWrapper = styled.div`
|
|
37
36
|
margin-right: 16px;
|
|
@@ -146,10 +145,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
146
145
|
this.props = nextProps;
|
|
147
146
|
const mode = nextProps.templateDetails.definition ? nextProps.templateDetails.definition.mode : nextProps.templateDetails.mode;
|
|
148
147
|
const schema = mode === "text" ? this.state.fullSchema.textSchema : this.state.fullSchema.imageSchema;
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
const isAndroidSupported = commChannels.includes(ANDROID);
|
|
152
|
-
const isIosSupported = commChannels.includes(IOS);
|
|
148
|
+
const isAndroidSupported = get(this, "props.Templates.selectedWeChatAccount.configs.android") === '1';
|
|
149
|
+
const isIosSupported = get(this, "props.Templates.selectedWeChatAccount.configs.ios") === '1';
|
|
153
150
|
if (!isAndroidSupported) {
|
|
154
151
|
const androidField = get(schema, "containers[0].panes[0]");
|
|
155
152
|
androidField.isSupported = false;
|
|
@@ -51,7 +51,7 @@ import EmailPreview from '../../v2Components/EmailPreview';
|
|
|
51
51
|
import CreativesContainer from '../CreativesContainer';
|
|
52
52
|
import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
53
53
|
import { CHANNEL_CREATE_TRACK_MAPPING, CHANNEL_EDIT_TRACK_MAPPING } from '../App/constants';
|
|
54
|
-
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE
|
|
54
|
+
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
|
|
55
55
|
import emailIllustration from '../Assets/images/emailIllustration.svg';
|
|
56
56
|
import smsIllustration from '../Assets/images/smsIllustration.svg';
|
|
57
57
|
import pushIllustration from '../Assets/images/pushIllustration.svg';
|
|
@@ -193,8 +193,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
193
193
|
queryParams.originalId = this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier;
|
|
194
194
|
}
|
|
195
195
|
if (this.state.channel.toLowerCase() === "mobilepush" && !isEmpty(this.props.Templates.selectedWeChatAccount)) {
|
|
196
|
+
const account = this.props.Templates.selectedWeChatAccount;
|
|
196
197
|
queryParams.accountId = account.id;
|
|
197
|
-
|
|
198
|
+
const isAndroidSupported = get(account, "configs.android") === '1';
|
|
199
|
+
const isIosSupported = get(account, "configs.ios") === '1';
|
|
200
|
+
if (!(isAndroidSupported || isIosSupported)) {
|
|
198
201
|
this.props.actions.resetAccount();
|
|
199
202
|
return;
|
|
200
203
|
}
|
|
@@ -419,9 +422,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
419
422
|
this.props.actions.setWeChatAccount(this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})]);
|
|
420
423
|
const account = this.props.Templates.weCrmAccounts[findIndex(this.props.Templates.weCrmAccounts, { name: value})];
|
|
421
424
|
params.accountId = account.id;
|
|
422
|
-
const
|
|
423
|
-
const
|
|
424
|
-
const isIosSupported = commChannels.includes(IOS);
|
|
425
|
+
const isAndroidSupported = get(account, "configs.android") === '1';
|
|
426
|
+
const isIosSupported = get(account, "configs.ios") === '1';
|
|
425
427
|
if (!(isAndroidSupported || isIosSupported)) {
|
|
426
428
|
this.setState({selectedAccountError: true});
|
|
427
429
|
this.props.actions.resetTemplate();
|
|
@@ -690,13 +692,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
690
692
|
|
|
691
693
|
</div>);
|
|
692
694
|
}
|
|
693
|
-
isAndroidOrIosSuppoerted = () => {
|
|
694
|
-
const account = this.props.Templates.selectedWeChatAccount || {};
|
|
695
|
-
const { commChannels = [] } = account;
|
|
696
|
-
const isAndroidSupported = commChannels.includes(ANDROID);
|
|
697
|
-
const isIosSupported = commChannels.includes(IOS);
|
|
698
|
-
return isAndroidSupported || isIosSupported;
|
|
699
|
-
}
|
|
700
695
|
filterLineTemplates = (templates) => {
|
|
701
696
|
const { lineFilter } = this.state;
|
|
702
697
|
if (LINE_FILTERS.ALL === lineFilter) {
|
|
@@ -1559,7 +1554,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1559
1554
|
return {};
|
|
1560
1555
|
}
|
|
1561
1556
|
}
|
|
1562
|
-
checkSearchDisabled = () => (this.props.route.name === "mobilepush" && !(this.props.Templates.selectedWeChatAccount && this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier && this.
|
|
1557
|
+
checkSearchDisabled = () => (this.props.route.name === "mobilepush" && !(this.props.Templates.selectedWeChatAccount && this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier && this.props.Templates.selectedWeChatAccount.configs && (this.props.Templates.selectedWeChatAccount.configs.ios === '1' || this.props.Templates.selectedWeChatAccount.configs.android === '1')))
|
|
1563
1558
|
renderEmailPreviewModal() {
|
|
1564
1559
|
const slideboxContent = (
|
|
1565
1560
|
<div style={{height: "75vh", width: '55vw'}}>
|
|
Binary file
|