@capillarytech/creatives-library 2.0.66 → 2.0.68
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/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/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/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
|
@@ -17,7 +17,7 @@ import _, {get, findIndex, set, forEach, cloneDeep} from 'lodash';
|
|
|
17
17
|
import { CapSlideBox, CapHeader, CapTable, CapLink, CapRow, CapColumn, CapIcons} from '@capillarytech/cap-ui-library';
|
|
18
18
|
import styled from 'styled-components';
|
|
19
19
|
import {makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse, makeSelectIosCta} from "./selectors";
|
|
20
|
-
import {makeSelectMetaEntities} from "../../Cap/selectors";
|
|
20
|
+
import {makeSelectMetaEntities, setInjectedTags, isLoadingMetaEntities} from "../../Cap/selectors";
|
|
21
21
|
import {getMessageObject} from "../../../utils/messageUtils";
|
|
22
22
|
import FormBuilder from '../../../components/FormBuilder';
|
|
23
23
|
import * as globalActions from "../../Cap/actions";
|
|
@@ -186,29 +186,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
186
186
|
const message = getMessageObject('error', (nextProps.Edit.editTemplateErrorMessage && nextProps.Edit.editTemplateErrorMessage !== '') ? nextProps.Edit.editTemplateErrorMessage : this.props.intl.formatMessage(messages.somethingWentWrong), true);
|
|
187
187
|
this.props.globalActions.addMessageToQueue(message);
|
|
188
188
|
}
|
|
189
|
-
// if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && this.props.metaEntities.tags !== nextProps.metaEntities.tags) {
|
|
190
|
-
// let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
191
|
-
// injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
192
|
-
// this.setState({injectedTags});
|
|
193
|
-
// }
|
|
194
|
-
if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && !_.isEqual(this.props.metaEntities.tags, nextProps.metaEntities.tags)) {
|
|
195
|
-
let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
196
|
-
delete injectedTags["Registration custom fields"];
|
|
197
|
-
delete injectedTags["Store custom fields"];
|
|
198
|
-
delete injectedTags["Transaction custom fields"];
|
|
199
|
-
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
200
|
-
console.log('new injected tags', nextProps.metaEntities.tags.custom);
|
|
201
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
202
|
-
delete injectedTags["Registration custom fields"];
|
|
203
|
-
}
|
|
204
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
205
|
-
delete injectedTags["Store custom fields"];
|
|
206
|
-
}
|
|
207
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
208
|
-
delete injectedTags["Transaction custom fields"];
|
|
209
|
-
}
|
|
210
|
-
this.setState({injectedTags});
|
|
211
|
-
}
|
|
212
189
|
}
|
|
213
190
|
componentWillUnmount() {
|
|
214
191
|
this.props.actions.clearData();
|
|
@@ -1691,7 +1668,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1691
1668
|
let tipText = this.props.Edit && ("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) ? 'Getting template details...' : '';
|
|
1692
1669
|
tipText = this.props.Edit && ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress) ? 'Saving Template...' : '';
|
|
1693
1670
|
const loadingContentEdit = this.state.loadingContentEdit || (this.props.location.query.module === 'dvs' && _.isEmpty(this.state.schema));
|
|
1694
|
-
const spinning = loadingContentEdit || this.props.Edit.fetchingDefaultTemplates || this.props.Edit.assetUploading || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
|
|
1671
|
+
const spinning = this.props.isLoadingMetaEntities || loadingContentEdit || this.props.Edit.fetchingDefaultTemplates || this.props.Edit.assetUploading || this.state.loading || (this.props.Edit && (("getTemplateDetailsInProgress" in this.props.Edit && this.props.Edit.getTemplateDetailsInProgress) || ("editTemplateInProgress" in this.props.Edit && this.props.Edit.editTemplateInProgress)));
|
|
1695
1672
|
let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
|
|
1696
1673
|
if (this.props.supportedTags) {
|
|
1697
1674
|
tags = this.props.supportedTags;
|
|
@@ -1712,7 +1689,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1712
1689
|
</Row>}
|
|
1713
1690
|
<Row>
|
|
1714
1691
|
<Col>
|
|
1715
|
-
<FormBuilder
|
|
1692
|
+
{!this.props.isLoadingMetaEntities && <FormBuilder
|
|
1716
1693
|
schema={schema}
|
|
1717
1694
|
onSubmit={this.saveFormData}
|
|
1718
1695
|
onChange={this.onFormDataChange}
|
|
@@ -1724,7 +1701,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1724
1701
|
tabCount={2}
|
|
1725
1702
|
iosCtasData={this.state.iosCtasData}
|
|
1726
1703
|
tags={tags}
|
|
1727
|
-
injectedTags={this.
|
|
1704
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
1728
1705
|
onFormValidityChange={this.setFormValidity}
|
|
1729
1706
|
usingTabContainer
|
|
1730
1707
|
checkValidation={this.state.checkValidation}
|
|
@@ -1736,7 +1713,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1736
1713
|
handleCancelModal={this.handleCancelModal}
|
|
1737
1714
|
modal={this.state.modalContent}
|
|
1738
1715
|
setModalContent={this.setModalContent}
|
|
1739
|
-
/>
|
|
1716
|
+
/>}
|
|
1740
1717
|
</Col>
|
|
1741
1718
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
1742
1719
|
<CapSlideBox
|
|
@@ -1820,7 +1797,8 @@ Edit.propTypes = {
|
|
|
1820
1797
|
templateData: PropTypes.object,
|
|
1821
1798
|
isFullMode: PropTypes.bool,
|
|
1822
1799
|
iosCtasData: PropTypes.array,
|
|
1823
|
-
|
|
1800
|
+
isLoadingMetaEntities: PropTypes.bool,
|
|
1801
|
+
injectedTags: PropTypes.object,
|
|
1824
1802
|
};
|
|
1825
1803
|
|
|
1826
1804
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1831,7 +1809,8 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1831
1809
|
metaEntities: makeSelectMetaEntities(),
|
|
1832
1810
|
Templates: makeSelectTemplates(),
|
|
1833
1811
|
iosCtasData: makeSelectIosCta(),
|
|
1834
|
-
|
|
1812
|
+
isLoadingMetaEntities: isLoadingMetaEntities(),
|
|
1813
|
+
injectedTags: setInjectedTags(),
|
|
1835
1814
|
});
|
|
1836
1815
|
|
|
1837
1816
|
function mapDispatchToProps(dispatch) {
|
|
@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
|
|
|
3
3
|
/**
|
|
4
4
|
* Direct selector to the create state domain
|
|
5
5
|
*/
|
|
6
|
-
const selectMobilePushEditDomain = () => (state
|
|
6
|
+
const selectMobilePushEditDomain = () => (state) => state.get('mobileEdit'); // reducer injected as mobileEdit in library mode.
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -23,7 +23,7 @@ const makeSelectEditResponse = () => createSelector(
|
|
|
23
23
|
selectMobilePushEditDomain(), (dimensionState) => dimensionState.get('editResponse')
|
|
24
24
|
);
|
|
25
25
|
const makeSelectTemplateDetailsResponse = () => createSelector(
|
|
26
|
-
|
|
26
|
+
makeSelectEdit(), (dimensionState) => dimensionState.templateDetails
|
|
27
27
|
);
|
|
28
28
|
const makeSelectIosCta = () => createSelector(makeSelectEdit(), (create) => create.getIosCtasSucccess && create.iosCtasData );
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
38
38
|
this.props.onMobilepushModeChange( e.target.value );
|
|
39
39
|
};
|
|
40
40
|
render() {
|
|
41
|
-
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query} = this.props;
|
|
41
|
+
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode} = this.props;
|
|
42
42
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
43
43
|
return (
|
|
44
44
|
<div className="mobilepush-wrapper">
|
|
@@ -62,7 +62,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
62
62
|
query,
|
|
63
63
|
}}
|
|
64
64
|
params={{mode: mobilePushCreateMode}}
|
|
65
|
-
isFullMode={
|
|
65
|
+
isFullMode={isFullMode}
|
|
66
66
|
isGetFormData={isGetFormData}
|
|
67
67
|
route={{ name: 'mobilepush' }}
|
|
68
68
|
/>
|
|
@@ -84,6 +84,7 @@ MobilepushWrapper.propTypes = {
|
|
|
84
84
|
setIsLoadingContent: PropTypes.func,
|
|
85
85
|
isGetFormData: PropTypes.bool,
|
|
86
86
|
query: PropTypes.object,
|
|
87
|
+
isFullMode: PropTypes.bool,
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
|
|
@@ -14,13 +14,14 @@ import { createStructuredSelector } from 'reselect';
|
|
|
14
14
|
import _ from 'lodash';
|
|
15
15
|
import { bindActionCreators } from 'redux';
|
|
16
16
|
import { makeSelectCreate, makeSelectCreateResponse } from './selectors';
|
|
17
|
-
import { makeSelectMetaEntities, isLoadingMetaEntities } from '../../Cap/selectors';
|
|
17
|
+
import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
18
18
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
19
19
|
import './_smsCreate.scss';
|
|
20
20
|
import FormBuilder from '../../../components/FormBuilder';
|
|
21
21
|
import * as actions from './actions';
|
|
22
22
|
import messages from './messages';
|
|
23
23
|
import * as charCount from '../../../utils/smsCharCount';
|
|
24
|
+
import {checkUnicode} from '../../../utils/smsCharCountV2';
|
|
24
25
|
import * as globalActions from '../../../containers/Cap/actions';
|
|
25
26
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
26
27
|
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
@@ -150,28 +151,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && this.props.metaEntities.tags && this.props.metaEntities.tags.standard && (this.props.metaEntities.tags !== nextProps.metaEntities.tags)) {
|
|
154
|
-
let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
155
|
-
delete injectedTags["Registration custom fields"];
|
|
156
|
-
delete injectedTags["Store custom fields"];
|
|
157
|
-
delete injectedTags["Transaction custom fields"];
|
|
158
|
-
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
159
|
-
|
|
160
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
161
|
-
delete injectedTags["Registration custom fields"];
|
|
162
|
-
}
|
|
163
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
164
|
-
delete injectedTags["Store custom fields"];
|
|
165
|
-
}
|
|
166
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
167
|
-
delete injectedTags["Transaction custom fields"];
|
|
168
|
-
}
|
|
169
|
-
this.setState({injectedTags, loadingStatus: this.state.loadingStatus + 1});
|
|
170
|
-
}
|
|
171
|
-
// if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.length > 0 && _.isEmpty(this.state.schema)) {
|
|
172
|
-
//
|
|
173
|
-
// this.injectEvents(nextProps.metaEntities.layouts[0].definition);
|
|
174
|
-
// }
|
|
175
154
|
}
|
|
176
155
|
|
|
177
156
|
componentWillUnmount() {
|
|
@@ -757,9 +736,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
757
736
|
}
|
|
758
737
|
|
|
759
738
|
startTemplateCreation(data) {
|
|
739
|
+
console.log("reached here", data);
|
|
760
740
|
if (data.edit) {
|
|
761
|
-
|
|
762
|
-
|
|
741
|
+
console.log('in if startTemplateCreation', data.tags);
|
|
742
|
+
const ifUnicode = checkUnicode(data.content ? data.content : '');
|
|
743
|
+
console.log('smsDetails', ifUnicode, data.content);
|
|
763
744
|
const content = data.content;
|
|
764
745
|
const id = _.uniqueId();
|
|
765
746
|
const tempData = {
|
|
@@ -775,8 +756,10 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
775
756
|
this.setState({tabKey: ''});
|
|
776
757
|
});
|
|
777
758
|
} else {
|
|
759
|
+
console.log("in else startTemplateCreation: ", data.tags);
|
|
778
760
|
this.setState({injectedTags: data.tags});
|
|
779
761
|
}
|
|
762
|
+
this.props.globalActions.setInjectedTags(data.tags);
|
|
780
763
|
}
|
|
781
764
|
|
|
782
765
|
startLoading(ifEdit) {
|
|
@@ -932,9 +915,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
932
915
|
return isLoading;
|
|
933
916
|
}
|
|
934
917
|
render() {
|
|
918
|
+
console.log("this.props sms create: ", this.props);
|
|
935
919
|
const schema = this.state.schema;
|
|
936
920
|
const spinning = this.isSmsLoading();
|
|
937
|
-
let tags = this.props.metaEntities && this.props.metaEntities.tags ? this.props.metaEntities.tags.standard : [];
|
|
921
|
+
let tags = this.props.metaEntities && this.props.metaEntities.tags && this.props.metaEntities.tags.standard ? this.props.metaEntities.tags.standard : [];
|
|
922
|
+
|
|
938
923
|
if (this.props.location.query.type === 'embedded' && this.props.location.query.module === 'library' && !this.props.getDefaultTags) {
|
|
939
924
|
tags = this.props.supportedTags; // if get default tags is not present and supported tags is present use that inlbrary mode
|
|
940
925
|
}
|
|
@@ -967,7 +952,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
967
952
|
tabKey={this.state.tabKey}
|
|
968
953
|
tags={tags}
|
|
969
954
|
tagModule={this.props.getDefaultTags}
|
|
970
|
-
injectedTags={this.
|
|
955
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
971
956
|
onFormValidityChange={this.setFormValidity}
|
|
972
957
|
usingTabContainer
|
|
973
958
|
checkValidation={this.state.checkValidation}
|
|
@@ -994,11 +979,11 @@ Create.propTypes = {
|
|
|
994
979
|
intl: intlShape.isRequired,
|
|
995
980
|
supportedTags: PropTypes.array,
|
|
996
981
|
getDefaultTags: PropTypes.string,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
getFormSubscriptionData: PropTypes.func,
|
|
982
|
+
injectedTags: PropTypes.object,
|
|
983
|
+
setIsLoadingContent: PropTypes.bool,
|
|
1000
984
|
isFullMode: PropTypes.bool,
|
|
1001
|
-
|
|
985
|
+
getFormSubscriptionData: PropTypes.func,
|
|
986
|
+
isLoadingMetaEntities: PropTypes.bool,
|
|
1002
987
|
};
|
|
1003
988
|
|
|
1004
989
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1006,6 +991,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1006
991
|
createResponse: makeSelectCreateResponse(),
|
|
1007
992
|
metaEntities: makeSelectMetaEntities(),
|
|
1008
993
|
isLoadingMetaEntities: isLoadingMetaEntities(),
|
|
994
|
+
injectedTags: setInjectedTags(),
|
|
1009
995
|
});
|
|
1010
996
|
|
|
1011
997
|
function mapDispatchToProps(dispatch) {
|
|
@@ -15,7 +15,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
15
15
|
import _ from 'lodash';
|
|
16
16
|
import { bindActionCreators } from 'redux';
|
|
17
17
|
import { makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
|
|
18
|
-
import { makeSelectMetaEntities, isLoadingMetaEntities } from '../../Cap/selectors';
|
|
18
|
+
import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
19
19
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
20
20
|
import FormBuilder from '../../../components/FormBuilder';
|
|
21
21
|
import * as actions from './actions';
|
|
@@ -170,24 +170,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
170
170
|
const message = getMessageObject('error', (nextProps.Edit.editTemplateErrorMessage && nextProps.Edit.editTemplateErrorMessage !== '') ? nextProps.Edit.editTemplateErrorMessage : this.props.intl.formatMessage(messages.somethingWentWrong), true);
|
|
171
171
|
this.props.globalActions.addMessageToQueue(message);
|
|
172
172
|
}
|
|
173
|
-
if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && this.props.metaEntities.tags && this.props.metaEntities.tags.standard && (this.props.metaEntities.tags !== nextProps.metaEntities.tags)) {
|
|
174
|
-
let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
175
|
-
delete injectedTags["Registration custom fields"];
|
|
176
|
-
delete injectedTags["Store custom fields"];
|
|
177
|
-
delete injectedTags["Transaction custom fields"];
|
|
178
|
-
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
179
|
-
|
|
180
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
181
|
-
delete injectedTags["Registration custom fields"];
|
|
182
|
-
}
|
|
183
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
184
|
-
delete injectedTags["Store custom fields"];
|
|
185
|
-
}
|
|
186
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
187
|
-
delete injectedTags["Transaction custom fields"];
|
|
188
|
-
}
|
|
189
|
-
this.setState({injectedTags});
|
|
190
|
-
}
|
|
191
173
|
}
|
|
192
174
|
|
|
193
175
|
componentWillUnmount() {
|
|
@@ -425,6 +407,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
425
407
|
} else {
|
|
426
408
|
this.setState({injectedTags: data.tags});
|
|
427
409
|
}
|
|
410
|
+
this.props.globalActions.setInjectedTags(data.tags);
|
|
428
411
|
}
|
|
429
412
|
|
|
430
413
|
startLoading(ifEdit) {
|
|
@@ -972,7 +955,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
972
955
|
modal={this.state.modalContent}
|
|
973
956
|
tags={tags}
|
|
974
957
|
tagModule={this.props.getDefaultTags}
|
|
975
|
-
injectedTags={this.
|
|
958
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
976
959
|
onFormValidityChange={this.setFormValidity}
|
|
977
960
|
usingTabContainer
|
|
978
961
|
checkValidation={this.state.checkValidation}
|
|
@@ -1005,6 +988,8 @@ Edit.propTypes = {
|
|
|
1005
988
|
isFullMode: PropTypes.bool,
|
|
1006
989
|
getFormSubscriptionData: PropTypes.func,
|
|
1007
990
|
setIsLoadingContent: PropTypes.func,
|
|
991
|
+
// route: PropTypes.object,
|
|
992
|
+
injectedTags: PropTypes.object,
|
|
1008
993
|
};
|
|
1009
994
|
|
|
1010
995
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1012,6 +997,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
1012
997
|
editResponse: makeSelectEditResponse(),
|
|
1013
998
|
templateDetails: makeSelectTemplateDetailsResponse(),
|
|
1014
999
|
metaEntities: makeSelectMetaEntities(),
|
|
1000
|
+
injectedTags: setInjectedTags(),
|
|
1015
1001
|
isLoadingMetaEntities: isLoadingMetaEntities(),
|
|
1016
1002
|
});
|
|
1017
1003
|
|
|
@@ -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) {
|