@capillarytech/creatives-library 2.0.23 → 2.0.24
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.
|
@@ -42,11 +42,13 @@ function SlideBoxContent(props) {
|
|
|
42
42
|
let isEmailEditWithContent = false;
|
|
43
43
|
let isPreview = false;
|
|
44
44
|
let isEmailPreview = false;
|
|
45
|
+
//let isEmailCreate = false;
|
|
45
46
|
let channel = currentChannel;//for create mode
|
|
46
47
|
if (templateData && channel) {
|
|
47
48
|
channel = templateData.type;// for edit mode with template data
|
|
48
49
|
isEditSms = slidBoxContent === 'editTemplate' && channel === constants.SMS;
|
|
49
50
|
isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
51
|
+
//isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL;
|
|
50
52
|
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
51
53
|
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
52
54
|
isPreview = slidBoxContent === 'preview' && channel !== constants.EMAIL;
|
|
@@ -76,7 +78,7 @@ function SlideBoxContent(props) {
|
|
|
76
78
|
{isEmailPreview && (
|
|
77
79
|
<EmailPreviewV2
|
|
78
80
|
templateData={templateData}
|
|
79
|
-
|
|
81
|
+
/>
|
|
80
82
|
)
|
|
81
83
|
}
|
|
82
84
|
{isEditSms && (
|
|
@@ -99,7 +101,7 @@ function SlideBoxContent(props) {
|
|
|
99
101
|
getDefaultTags={type}
|
|
100
102
|
/>
|
|
101
103
|
)}
|
|
102
|
-
{isEditEmailWithId && (
|
|
104
|
+
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
103
105
|
<Email
|
|
104
106
|
location={{
|
|
105
107
|
pathname: `/email`,
|
|
@@ -114,21 +116,6 @@ function SlideBoxContent(props) {
|
|
|
114
116
|
getDefaultTags={type}
|
|
115
117
|
/>
|
|
116
118
|
)}
|
|
117
|
-
{isEmailEditWithContent && (
|
|
118
|
-
<Email
|
|
119
|
-
location={{
|
|
120
|
-
pathname: `/email`,
|
|
121
|
-
query,
|
|
122
|
-
}}
|
|
123
|
-
route={{ name: 'email' }}
|
|
124
|
-
isGetFormData={isGetFormData}
|
|
125
|
-
getFormdata={getFormData}
|
|
126
|
-
params={{ id: templateData._id }}
|
|
127
|
-
templateData={templateData}
|
|
128
|
-
getFormSubscriptionData={getFormData}
|
|
129
|
-
getDefaultTags={type}
|
|
130
|
-
/>
|
|
131
|
-
)}
|
|
132
119
|
</CreativesWrapper>
|
|
133
120
|
);
|
|
134
121
|
}
|
|
@@ -1005,21 +1005,23 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1005
1005
|
|
|
1006
1006
|
if (nextProps.metaEntities && nextProps.metaEntities.tags && nextProps.metaEntities.tags.custom && !_.isEqual(this.props.metaEntities.tags, nextProps.metaEntities.tags)) {
|
|
1007
1007
|
let injectedTags = _.cloneDeep(this.state.injectedTags);
|
|
1008
|
-
|
|
1009
|
-
delete injectedTags["Store custom fields"];
|
|
1010
|
-
delete injectedTags["Transaction custom fields"];
|
|
1011
|
-
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
1012
|
-
console.log('new injected tags', nextProps.metaEntities.tags.custom);
|
|
1013
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
1008
|
+
if (!_.isEmpty(injectedTags)) {
|
|
1014
1009
|
delete injectedTags["Registration custom fields"];
|
|
1015
|
-
}
|
|
1016
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
1017
1010
|
delete injectedTags["Store custom fields"];
|
|
1018
|
-
}
|
|
1019
|
-
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
1020
1011
|
delete injectedTags["Transaction custom fields"];
|
|
1012
|
+
injectedTags = _.merge({}, injectedTags, nextProps.metaEntities.tags.custom);
|
|
1013
|
+
console.log('new injected tags', nextProps.metaEntities.tags.custom);
|
|
1014
|
+
if (!_.has(nextProps.metaEntities.tags.custom, "Registration custom fields")) {
|
|
1015
|
+
delete injectedTags["Registration custom fields"];
|
|
1016
|
+
}
|
|
1017
|
+
if (!_.has(nextProps.metaEntities.tags.custom, "Store custom fields")) {
|
|
1018
|
+
delete injectedTags["Store custom fields"];
|
|
1019
|
+
}
|
|
1020
|
+
if (!_.has(nextProps.metaEntities.tags.custom, "Transaction custom fields")) {
|
|
1021
|
+
delete injectedTags["Transaction custom fields"];
|
|
1022
|
+
}
|
|
1023
|
+
this.setState({injectedTags});
|
|
1021
1024
|
}
|
|
1022
|
-
this.setState({injectedTags});
|
|
1023
1025
|
}
|
|
1024
1026
|
|
|
1025
1027
|
if ( !_.isEqual(nextProps.Email.uploadAssetSuccess, this.props.Email.uploadAssetSuccess) && nextProps.Email.uploadAssetSuccess) {
|
|
@@ -38,7 +38,9 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
componentWillReceiveProps(nextProps) {
|
|
41
|
-
|
|
41
|
+
if (_.isEmpty(this.props.injectedTags) && _.isEmpty(this.props.tags)) {
|
|
42
|
+
this.setState({loading: true});
|
|
43
|
+
}
|
|
42
44
|
if (!_.isEqual(nextProps.injectedTags, this.props.injectedTags)) {
|
|
43
45
|
console.log('received new tags', nextProps);
|
|
44
46
|
this.setState({loading: false});
|
|
@@ -177,7 +179,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
render() {
|
|
180
|
-
console.log('tags props 2', this.props);
|
|
181
182
|
let tags = {};
|
|
182
183
|
let injectedTags = {};
|
|
183
184
|
if (this.props.injectedTags && !_.isEmpty(this.props.injectedTags)) {
|
|
@@ -190,7 +191,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
190
191
|
}
|
|
191
192
|
tags = _.merge( {}, tags, injectedTags);
|
|
192
193
|
console.log('merged tags', tags);
|
|
193
|
-
// console.log('tag list', this.renderTags(tags));
|
|
194
194
|
return (
|
|
195
195
|
<div className={this.props.className ? this.props.className : ''}>
|
|
196
196
|
<CapTagList
|