@capillarytech/creatives-library 2.0.66 → 2.0.69
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 +30 -3
- package/components/FormBuilder/index.js +50 -27
- package/components/FormBuilder/test +1845 -0
- package/components/Header/index.js +7 -4
- package/components/Header/messages.js +12 -0
- package/components/Sidebar/index.js +0 -27
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +104 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -0
- package/containers/Cap/actions.js +6 -0
- package/containers/Cap/constants.js +2 -0
- package/containers/Cap/index.js +1 -22
- package/containers/Cap/reducer.js +4 -2
- package/containers/Cap/selectors.js +13 -0
- package/containers/CreativesContainer/SlideBoxContent.js +2 -1
- package/containers/Ebill/index.js +4 -21
- package/containers/Email/index.js +9 -24
- package/containers/Line/Create/index.js +5 -17
- package/containers/Line/Edit/index.js +5 -25
- package/containers/MobilePush/Create/index.js +5 -22
- package/containers/MobilePush/Create/selectors.js +1 -1
- package/containers/MobilePush/Edit/index.js +9 -30
- package/containers/MobilePush/Edit/selectors.js +2 -2
- package/containers/MobilePush/initialSchema.js +0 -12
- package/containers/MobilepushWrapper/index.js +3 -2
- package/containers/Sms/Create/index.js +17 -31
- package/containers/Sms/Edit/index.js +6 -20
- package/containers/Templates/index.js +60 -67
- package/containers/Templates/reducer.js +3 -3
- package/containers/WeChat/MapTemplates/index.js +6 -22
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +46 -2
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +4 -3
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +1 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +525 -165
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +125 -1
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +15 -4
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +7 -3
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +5 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +24 -8
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +6 -1
- package/initialState.js +1 -0
- package/package.json +2 -2
- package/routes.js +22 -4
|
@@ -13,8 +13,8 @@ import { createStructuredSelector } from 'reselect';
|
|
|
13
13
|
import moment from "moment";
|
|
14
14
|
import _ from 'lodash';
|
|
15
15
|
import { bindActionCreators } from 'redux';
|
|
16
|
-
import {
|
|
17
|
-
import {CapButton, CapInput, CapIcon, CapSelect, CapPopover, CapSpin, CapCustomCard, CapRow
|
|
16
|
+
import { Dropdown, Menu, Modal} from 'antd';
|
|
17
|
+
import {CapButton, CapInput, CapIcon, CapSelect, CapPopover, CapSpin, CapCustomCard, CapRow} from '@capillarytech/cap-ui-library';
|
|
18
18
|
import { makeSelectTemplates, makeSelectTemplatesResponse } from './selectors';
|
|
19
19
|
import { makeSelectCreate as makeSelectCreateSms} from '../Sms/Create/selectors';
|
|
20
20
|
import { makeSelectCreate as makeSelectCreateMobilePush } from '../MobilePush/Create/selectors';
|
|
@@ -43,6 +43,7 @@ import SlideBox from '../../components/SlideBox';
|
|
|
43
43
|
import Pagination from '../../components/Pagination';
|
|
44
44
|
import EmailPreview from '../../components/EmailPreview';
|
|
45
45
|
import CreativesContainer from '../CreativesContainer';
|
|
46
|
+
import WechatRichmediaTemplatePreview from '../../components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
46
47
|
const MenuItem = Menu.Item;
|
|
47
48
|
const {CapCustomCardList} = CapCustomCard;
|
|
48
49
|
|
|
@@ -86,7 +87,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
86
87
|
this.startTemplateCreation = this.startTemplateCreation.bind(this);
|
|
87
88
|
this.startLoading = this.startLoading.bind(this);
|
|
88
89
|
this.prepareWeChatPreviewData = this.prepareWeChatPreviewData.bind(this);
|
|
89
|
-
this.prepareWeChatRichmediaPreviewData = this.prepareWeChatRichmediaPreviewData.bind(this);
|
|
90
90
|
this.prepareWeChatMappedPreviewData = this.prepareWeChatMappedPreviewData.bind(this);
|
|
91
91
|
this.onAccountSelect = this.onAccountSelect.bind(this);
|
|
92
92
|
this.prepareMobilePushPreviewData = this.prepareMobilePushPreviewData.bind(this);
|
|
@@ -478,9 +478,12 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
478
478
|
return (<div>
|
|
479
479
|
{filterContent}
|
|
480
480
|
<CapSpin spinning={isLoading} tip={loadingTip}>
|
|
481
|
-
<div className="pagination-container">
|
|
481
|
+
{!_.isEmpty(templates) && <div className="pagination-container">
|
|
482
482
|
<CapCustomCardList key={`${currentChannel}-card-list`} cardList={cardDataList} type={currentChannel} />
|
|
483
|
-
</div>
|
|
483
|
+
</div>}
|
|
484
|
+
{(this.state.selectedAccount === '' && _.isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") && <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
485
|
+
<span style={{ fontFamily: 'open-sans', fontSize: '24px', color: '#B5B5B5'}}>{this.props.intl.formatMessage(messages.noAccountMessage)}</span>
|
|
486
|
+
</div>}
|
|
484
487
|
</CapSpin>
|
|
485
488
|
|
|
486
489
|
</div>);
|
|
@@ -506,10 +509,17 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
506
509
|
query: type === 'embedded' ? {type: 'embedded', module, account_id: e.account_id} : {},
|
|
507
510
|
};
|
|
508
511
|
} else if (this.state.channel.toLowerCase() === 'wechat') {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
512
|
+
if (e.template_type && e.template_type === 'RICHMEDIA_WECHAT_TEMPLATE') {
|
|
513
|
+
this.props.router.push({
|
|
514
|
+
pathname: `/wechat/richmedia/edit/${e.template_id}`,
|
|
515
|
+
query: type === 'embedded' ? {type: 'embedded', module, source_account_id: e.source_account_id} : {},
|
|
516
|
+
});
|
|
517
|
+
} else {
|
|
518
|
+
this.props.router.push({
|
|
519
|
+
pathname: `/wechat/edit/${e.template_id}`,
|
|
520
|
+
query: type === 'embedded' ? {type: 'embedded', module, source_account_id: e.source_account_id} : {},
|
|
521
|
+
});
|
|
522
|
+
}
|
|
513
523
|
} else if (this.state.channel.toLowerCase() === 'line') {
|
|
514
524
|
routeParams = {
|
|
515
525
|
pathname: `/line/view/${e.msg_type}/`,
|
|
@@ -590,7 +600,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
590
600
|
prepareWeChatPreviewData(template) {
|
|
591
601
|
if (template && template.versions && template.versions.base && !_.isEmpty(template.versions.base)) {
|
|
592
602
|
if (template.definition && template.definition.msgcontent && template.definition.msgcontent === "RICH_MEDIA_WECHAT") {
|
|
593
|
-
return
|
|
603
|
+
return template.versions.base.mediaList;
|
|
594
604
|
}
|
|
595
605
|
return this.prepareWeChatMappedPreviewData(template.versions.base.content, template.versions.base.Tag, template.versions.base.data);
|
|
596
606
|
}
|
|
@@ -607,38 +617,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
607
617
|
return formattedContent;
|
|
608
618
|
}
|
|
609
619
|
|
|
610
|
-
prepareWeChatRichmediaPreviewData(content) {
|
|
611
|
-
const returnObj = [];
|
|
612
|
-
if (content.mediaList) {
|
|
613
|
-
_.forEach(content.mediaList, (mediaData, mediaIndex) => {
|
|
614
|
-
if (mediaIndex === 0) {
|
|
615
|
-
returnObj.push(
|
|
616
|
-
<div style={{ width: 272, height: 160 }}>
|
|
617
|
-
<CapRow style={{ height: 110 }}>
|
|
618
|
-
<img alt="default" width="272px" height="110px" src={mediaData.image_url} />
|
|
619
|
-
</CapRow>
|
|
620
|
-
<CapRow style={{ height: 32 }}>
|
|
621
|
-
{mediaData.digest ? mediaData.digest : ""}
|
|
622
|
-
</CapRow>
|
|
623
|
-
</div>
|
|
624
|
-
);
|
|
625
|
-
} else {
|
|
626
|
-
returnObj.push(
|
|
627
|
-
<CapRow style={{ width: 272, height: 86 }}>
|
|
628
|
-
<CapColumn span={18}>
|
|
629
|
-
{mediaData.title}
|
|
630
|
-
</CapColumn>
|
|
631
|
-
<CapColumn span={6}>
|
|
632
|
-
<img alt="default" width="60px" height="60px" src={mediaData.image_url} />
|
|
633
|
-
</CapColumn>
|
|
634
|
-
</CapRow>
|
|
635
|
-
);
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
return returnObj;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
620
|
prepareMobilePushPreviewData(content) {
|
|
643
621
|
let result;
|
|
644
622
|
if (content.ANDROID) {
|
|
@@ -1121,10 +1099,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1121
1099
|
if (template && template.versions && template.versions.base && !_.isEmpty(template.versions.base)) {
|
|
1122
1100
|
if (template.definition && template.definition.msgcontent && template.definition.msgcontent === "RICH_MEDIA_WECHAT") {
|
|
1123
1101
|
path = `/wechat/richmedia/edit/${template._id}`;
|
|
1102
|
+
content = <WechatRichmediaTemplatePreview type={this.props.location && this.props.location.query.type ? this.props.location.query.type : ''} content={template.versions.base.mediaList}/>;
|
|
1124
1103
|
} else {
|
|
1125
1104
|
path = `/wechat/edit/${template._id}`;
|
|
1105
|
+
content = this.prepareWeChatPreviewData(template);
|
|
1126
1106
|
}
|
|
1127
|
-
content = this.prepareWeChatPreviewData(template);
|
|
1128
1107
|
temp.content = (
|
|
1129
1108
|
<div
|
|
1130
1109
|
className="sms-template-content">
|
|
@@ -1505,7 +1484,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1505
1484
|
{(this.props.location.query.type === 'embedded' ) ? pageHeaderDvs : pageHeader}
|
|
1506
1485
|
<CapButton
|
|
1507
1486
|
type={this.props.isFullMode ? "primary" : "secondary"}
|
|
1508
|
-
disabled={isLoading}
|
|
1487
|
+
disabled={isLoading || _.isEmpty(this.props.Templates.selectedWeChatAccount)}
|
|
1509
1488
|
style={{marginLeft: '8px'}}
|
|
1510
1489
|
onClick={(ev) => this.props.isFullMode ? this.createTemplate(ev) : this.handleBlankTemplateAction()} >
|
|
1511
1490
|
{ this.props.intl.formatMessage(messages.createNewActionButton) }
|
|
@@ -1532,13 +1511,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1532
1511
|
<input type="file" id="filename" style={{ display: 'none'}} accept=".zip, .html, .htm" onChange={(event) => this.handleFileUpload(event, {files: event.target.files})} />
|
|
1533
1512
|
|
|
1534
1513
|
|
|
1535
|
-
<
|
|
1536
|
-
{ templateList && templateList.length > 0 &&
|
|
1514
|
+
<CapRow>
|
|
1537
1515
|
<Pagination onPageChange={this.onPaginationChange} paginationSelector="pagination-container">
|
|
1538
1516
|
{this.getTemplateDataForGrid({isLoading, loadingTip, channel: this.state.channel, templates: this.props.TemplatesList, filterContent, handlers: {handlePreviewClick: this.handlePreviewClick, handleEditClick: this.handleEditClick}})}
|
|
1539
1517
|
</Pagination>
|
|
1540
|
-
|
|
1541
|
-
{!this.props.renderNewCardGrid && ((templateList && templateList.length > 0) || isSearch) &&
|
|
1518
|
+
{!this.props.renderNewCardGrid && ((templateList && templateList.length > 0) || isSearch) && // old UI GRID
|
|
1542
1519
|
<Pagination onPageChange={this.onPaginationChange} paginationSelector="pagination-container">
|
|
1543
1520
|
<CardGrid
|
|
1544
1521
|
className={this.state.channel.toLowerCase() === "mobilepush" ? "mobilepush-templates" : ""}
|
|
@@ -1552,14 +1529,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1552
1529
|
>
|
|
1553
1530
|
</CardGrid>
|
|
1554
1531
|
</Pagination>}
|
|
1555
|
-
{(this.state.selectedAccount === '' && _.isEmpty(this.props.Templates.selectedWeChatAccount)) && (this.state.channel.toLowerCase() === 'wechat' || this.state.channel.toLowerCase() === "mobilepush") && <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
1556
|
-
<span style={{ fontFamily: 'open-sans', fontSize: '24px', color: '#B5B5B5'}}>{this.props.intl.formatMessage(messages.noAccountMessage)}</span>
|
|
1557
|
-
</div>}
|
|
1558
1532
|
{(((this.state.selectedAccount !== '' && !_.isEmpty(this.props.Templates.selectedWeChatAccount) && this.state.channel.toLowerCase() === 'wechat') || this.state.channel.toLowerCase() !== 'wechat') && _.isEmpty(this.props.TemplatesList)) && !this.props.Templates.getAllTemplatesInProgress && <div style={{ height: '65vh', textAlign: 'center', lineHeight: '65vh'}}>
|
|
1559
1533
|
<span style={{ fontFamily: 'open-sans', fontSize: '24px', color: '#B5B5B5'}}>{this.props.intl.formatMessage(messages.noTemplatesMessage)}</span>
|
|
1560
1534
|
</div>}
|
|
1561
|
-
</
|
|
1562
|
-
<
|
|
1535
|
+
</CapRow>
|
|
1536
|
+
<CapRow>
|
|
1563
1537
|
{!_.isEmpty(creativesParams.mode) && isFullMode && //creatives container for fullmode
|
|
1564
1538
|
<CreativesContainer
|
|
1565
1539
|
key={creativesParams.mode}
|
|
@@ -1571,18 +1545,37 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1571
1545
|
getCreativesData={this.onCreateComplete}
|
|
1572
1546
|
channel={route.name.toUpperCase()}
|
|
1573
1547
|
handleCloseCreatives={this.onCreateComplete}/>
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1548
|
+
}
|
|
1549
|
+
</CapRow>
|
|
1550
|
+
<CapRow>
|
|
1551
|
+
{this.state.channel.toLowerCase() === 'wechat' && this.state.previewTemplate && this.state.previewTemplate.definition && this.state.previewTemplate.definition.msgcontent && this.state.previewTemplate.definition.msgcontent === 'RICH_MEDIA_WECHAT' ?
|
|
1552
|
+
<WechatRichmediaTemplatePreview
|
|
1553
|
+
show={this.state.previewOpen}
|
|
1554
|
+
closeSlideBox={this.togglePreview}
|
|
1555
|
+
header={this.state.previewTemplate.name}
|
|
1556
|
+
width={30}
|
|
1557
|
+
showSlidebox
|
|
1558
|
+
const type={this.props.location && this.props.location.query.type ? this.props.location.query.type : ''}
|
|
1559
|
+
content={this.state.previewTemplate.versions.base.mediaList}
|
|
1560
|
+
onEditClick={this.handleEditClick}
|
|
1561
|
+
showEdit
|
|
1562
|
+
templateId={this.state.previewTemplate._id}
|
|
1563
|
+
path={`/wechat/richmedia/edit/${this.state.previewTemplate._id}`}
|
|
1564
|
+
/>
|
|
1565
|
+
:
|
|
1566
|
+
<PreviewSideBar
|
|
1567
|
+
showPreview={this.state.previewOpen}
|
|
1568
|
+
templateData={this.state.previewTemplate}
|
|
1569
|
+
channel={this.state.channel}
|
|
1570
|
+
handleClose={this.togglePreview}
|
|
1571
|
+
onEditClick={this.handleEditClick}
|
|
1572
|
+
embedded={this.props.location.query.type === 'embedded'}
|
|
1573
|
+
onDuplicateClick={this.duplicateTemplate}
|
|
1574
|
+
location={this.props.location}
|
|
1575
|
+
>
|
|
1576
|
+
</PreviewSideBar>
|
|
1577
|
+
|
|
1578
|
+
}
|
|
1586
1579
|
{(this.state.channel.toLowerCase() === 'ebill' || this.state.channel.toLowerCase() === 'email') && htmlPreviewContent && <EmailPreview
|
|
1587
1580
|
header={previewHeader}
|
|
1588
1581
|
content={htmlPreviewContent}
|
|
@@ -1592,7 +1585,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1592
1585
|
changePreviewDevice={this.changePreviewDevice}
|
|
1593
1586
|
lastModified={this.state.previewTemplate ? this.state.previewTemplate.updatedAt : ''}
|
|
1594
1587
|
updatedByName={commonUtil.getUserNameById(parseInt(this.state.previewTemplate.updatedBy, 10), commonUtil.getMergedUserList(this.props.Templates.userList))}
|
|
1595
|
-
|
|
1588
|
+
/>}
|
|
1596
1589
|
<SlideBox
|
|
1597
1590
|
header={(<h3>{this.props.intl.formatMessage(messages.layoutSelection)}</h3>)}
|
|
1598
1591
|
width={60}
|
|
@@ -1603,7 +1596,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1603
1596
|
isLoading={this.props.Templates.getCmsTemplatesInProgress}
|
|
1604
1597
|
/>
|
|
1605
1598
|
{this.renderDeleteConfirmationModal()}
|
|
1606
|
-
</
|
|
1599
|
+
</CapRow>
|
|
1607
1600
|
|
|
1608
1601
|
</div>
|
|
1609
1602
|
);
|
|
@@ -78,7 +78,7 @@ function templatesReducer(state = initialState, action) {
|
|
|
78
78
|
return state
|
|
79
79
|
.set('weCRMtemplates', fromJS([]))
|
|
80
80
|
.set('weChatDefaultTemplate', fromJS([]))
|
|
81
|
-
.set('templates',
|
|
81
|
+
.set('templates', []);
|
|
82
82
|
case types.SET_SELECTED_LAYOUT:
|
|
83
83
|
return state
|
|
84
84
|
.set('selectedEmailLayout', fromJS(action.selectedTemplate))
|
|
@@ -106,7 +106,7 @@ function templatesReducer(state = initialState, action) {
|
|
|
106
106
|
return state.set('getCmsTemplatesInProgress', true);
|
|
107
107
|
case types.GET_EDM_DEAFULT_TEMPLATES_SUCCESS:
|
|
108
108
|
return state.set('getCmsTemplatesInProgress', false)
|
|
109
|
-
.set('cmsTemplates', action.data ? fromJS(action.data.templates) :
|
|
109
|
+
.set('cmsTemplates', action.data ? fromJS(action.data.templates) : []);
|
|
110
110
|
case types.GET_EDM_DEAFULT_TEMPLATES_FAILURE:
|
|
111
111
|
return state.set('getCmsTemplatesInProgress', false);
|
|
112
112
|
case types.SET_EDM_TEMPLATE:
|
|
@@ -132,7 +132,7 @@ function templatesReducer(state = initialState, action) {
|
|
|
132
132
|
.set('templateDetails', fromJS({}));
|
|
133
133
|
case types.CLEAR_TEMPLATE_STORE_DATA:
|
|
134
134
|
return state
|
|
135
|
-
.set('templates',
|
|
135
|
+
.set('templates', [])
|
|
136
136
|
.set('weCRMtemplates', fromJS({}));
|
|
137
137
|
default:
|
|
138
138
|
return state;
|
|
@@ -15,7 +15,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
15
15
|
import { Row, Col, Spin } from 'antd';
|
|
16
16
|
import _ from 'lodash';
|
|
17
17
|
import { makeSelectTemplates } from '../../Templates/selectors';
|
|
18
|
-
import { makeSelectMetaEntities, makeSelectFetchingSchema } from '../../Cap/selectors';
|
|
18
|
+
import { makeSelectMetaEntities, makeSelectFetchingSchema, setInjectedTags } from '../../Cap/selectors';
|
|
19
19
|
import makeSelectWeChat from './selectors';
|
|
20
20
|
import messages from './messages';
|
|
21
21
|
import * as actions from './actions';
|
|
@@ -304,25 +304,6 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && this.props.metaEntities.tags !== nextProps.metaEntities.tags) {
|
|
308
|
-
let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
309
|
-
delete injectedTags["Registration custom fields"];
|
|
310
|
-
delete injectedTags["Store custom fields"];
|
|
311
|
-
delete injectedTags["Transaction custom fields"];
|
|
312
|
-
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
313
|
-
console.log('new injected tags', nextProps.metaEntities.tags.custom);
|
|
314
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
315
|
-
delete injectedTags["Registration custom fields"];
|
|
316
|
-
}
|
|
317
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
318
|
-
delete injectedTags["Store custom fields"];
|
|
319
|
-
}
|
|
320
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
321
|
-
delete injectedTags["Transaction custom fields"];
|
|
322
|
-
}
|
|
323
|
-
this.setState({injectedTags});
|
|
324
|
-
}
|
|
325
|
-
|
|
326
307
|
// if (this.props.location.query.type.type === 'embedded' && this.props.location.query.module === 'loyalty' && this.state.formData['wechat-template'] !== '') {
|
|
327
308
|
// }
|
|
328
309
|
if (!nextProps.WeChat.fetchingDefaultTemplates && nextProps.location.query.module === 'outbound' && nextProps.params.id !== undefined) {
|
|
@@ -600,8 +581,9 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
600
581
|
|
|
601
582
|
setSelectedTemplateData(weChatData) {
|
|
602
583
|
let schema = _.cloneDeep(this.state.baseSchema);
|
|
584
|
+
schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
|
|
603
585
|
if (_.isEmpty(weChatData)) {
|
|
604
|
-
schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
|
|
586
|
+
// schema.standalone.sections[0].childSections[1].childSections[0].childSections[1].inputFields = [];
|
|
605
587
|
const formData=_.cloneDeep(this.state.formData);
|
|
606
588
|
formData['wechat-template']="";
|
|
607
589
|
this.setState({schema,formData});
|
|
@@ -1350,7 +1332,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
|
|
|
1350
1332
|
location= {this.props.location}
|
|
1351
1333
|
tags={tags}
|
|
1352
1334
|
tagModule={this.props.getDefaultTags}
|
|
1353
|
-
injectedTags={this.
|
|
1335
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
1354
1336
|
isEdit={this.state.isEdit}
|
|
1355
1337
|
usingTabContainer={false}
|
|
1356
1338
|
router={this.props.router}
|
|
@@ -1381,6 +1363,7 @@ MapTemplates.propTypes = {
|
|
|
1381
1363
|
getDefaultTags: PropTypes.string,
|
|
1382
1364
|
templateData: PropTypes.object,
|
|
1383
1365
|
templateActions: PropTypes.object,
|
|
1366
|
+
injectedTags: PropTypes.object,
|
|
1384
1367
|
};
|
|
1385
1368
|
|
|
1386
1369
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1388,6 +1371,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1388
1371
|
Templates: makeSelectTemplates(),
|
|
1389
1372
|
metaEntities: makeSelectMetaEntities(),
|
|
1390
1373
|
fetchingSchema: makeSelectFetchingSchema(),
|
|
1374
|
+
injectedTags: setInjectedTags(),
|
|
1391
1375
|
});
|
|
1392
1376
|
|
|
1393
1377
|
function mapDispatchToProps(dispatch) {
|
|
@@ -1,5 +1,41 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.hover-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.richmedia-icons {
|
|
5
|
+
display: none;
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 50%;
|
|
8
|
+
}
|
|
9
|
+
.hover-container:hover {
|
|
10
|
+
.richmedia-card {
|
|
11
|
+
opacity: 0.2;
|
|
12
|
+
border: 2px solid #1D5B96!important;
|
|
13
|
+
}
|
|
14
|
+
.richmedia-card-rectangle {
|
|
15
|
+
opacity: 0.2;
|
|
16
|
+
border: 2px solid #1D5B96!important;
|
|
17
|
+
}
|
|
18
|
+
.richmedia-icons {
|
|
19
|
+
opacity: 1 !important;
|
|
20
|
+
display: inline-flex!important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
.richmedia-card-clicked {
|
|
25
|
+
border: 2px solid #1D5B96!important;
|
|
26
|
+
}
|
|
27
|
+
.richmedia-card-rectangle-clicked {
|
|
28
|
+
border: 2px solid #1D5B96!important;
|
|
29
|
+
}
|
|
30
|
+
.hover-container .richmedia-card, .hover-container .richmedia-card-rectangle {
|
|
31
|
+
border: 1px solid #707070;
|
|
32
|
+
}
|
|
33
|
+
.hover-icons {
|
|
34
|
+
font-size: 20px;
|
|
35
|
+
}
|
|
36
|
+
.richmedia-container {
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow-y: auto;
|
|
3
39
|
}
|
|
4
40
|
.template-form-header {
|
|
5
41
|
margin-bottom: 2.5rem;
|
|
@@ -10,4 +46,12 @@
|
|
|
10
46
|
.wechat-richmedia-row {
|
|
11
47
|
margin-bottom: 1.5rem;
|
|
12
48
|
width: 50rem;
|
|
49
|
+
}
|
|
50
|
+
.overflow-wrap-fields {
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
overflow-wrap: break-word;
|
|
54
|
+
display: -webkit-box !important;
|
|
55
|
+
-webkit-box-orient: vertical;
|
|
56
|
+
-webkit-line-clamp: 2;
|
|
13
57
|
}
|
|
@@ -10,7 +10,7 @@ export function defaultAction() {
|
|
|
10
10
|
type: types.DEFAULT_ACTION,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
export function uploadAsset(file, assetType, fileParams, mode, wechatParams, contentId) {
|
|
13
|
+
export function uploadAsset(file, assetType, fileParams, mode, wechatParams, contentId, uploadId) {
|
|
14
14
|
return {
|
|
15
15
|
type: types.UPLOAD_ASSET_REQUEST,
|
|
16
16
|
file,
|
|
@@ -19,6 +19,7 @@ export function uploadAsset(file, assetType, fileParams, mode, wechatParams, con
|
|
|
19
19
|
mode,
|
|
20
20
|
wechatParams,
|
|
21
21
|
contentId,
|
|
22
|
+
uploadId,
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
export function saveTemplate(template) {
|
|
@@ -27,9 +28,9 @@ export function saveTemplate(template) {
|
|
|
27
28
|
template,
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
export function
|
|
31
|
+
export function clearContentImageStore() {
|
|
31
32
|
return {
|
|
32
|
-
type: types.
|
|
33
|
+
type: types.CLEAR_CONTENT_ASSET,
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -12,3 +12,4 @@ export const CLEAR_ASSET = 'app/containers/Wechat/RichmediaTemplates/Create/CLEA
|
|
|
12
12
|
export const SAVE_TEMPLATE_REQUEST = 'app/containers/Wechat/RichmediaTemplates/Create/SAVE_TEMPLATE_REQUEST';
|
|
13
13
|
export const SAVE_TEMPLATE_SUCCESS = 'app/containers/Wechat/RichmediaTemplates/Create/SAVE_TEMPLATE_SUCCESS';
|
|
14
14
|
export const SAVE_TEMPLATE_FAILURE = 'app/containers/Wechat/RichmediaTemplates/Create/SAVE_TEMPLATE_FAILURE';
|
|
15
|
+
export const CLEAR_CONTENT_ASSET = 'app/containers/Wechat/RichmediaTemplates/Create/CLEAR_CONTENT_ASSET';
|