@capillarytech/creatives-library 3.1.41 → 3.1.42
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/Templates/index.js +1 -1
- package/containers/Templates/messages.js +0 -4
- package/package.json +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -0
- package/v2Containers/CreativesContainer/index.js +1 -0
- package/v2Containers/Email/index.js +3 -0
- package/v2Containers/EmailWrapper/index.js +3 -0
- package/v2Containers/TagList/index.js +15 -5
|
@@ -1344,7 +1344,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1344
1344
|
className="search-text"
|
|
1345
1345
|
style={{width: '210px'}}
|
|
1346
1346
|
placeholder={this.props.intl.formatMessage(messages.searchText)}
|
|
1347
|
-
prefix={<i className="material-icons" style={{ margin: '0', fontSize: '16px'}}>
|
|
1347
|
+
prefix={<i className="material-icons" style={{ margin: '0', fontSize: '16px'}}>search</i>}
|
|
1348
1348
|
value={this.state.searchText}
|
|
1349
1349
|
onChange={(e) => this.searchTemplate(e.target.value)}
|
|
1350
1350
|
/>
|
|
@@ -118,10 +118,6 @@ export default defineMessages({
|
|
|
118
118
|
id: 'creatives.containers.Templates.useEditor',
|
|
119
119
|
defaultMessage: "Use Editor",
|
|
120
120
|
},
|
|
121
|
-
"search": {
|
|
122
|
-
id: 'creatives.containers.Templates.search',
|
|
123
|
-
defaultMessage: "Search",
|
|
124
|
-
},
|
|
125
121
|
"blankTemplate": {
|
|
126
122
|
id: 'creatives.containers.Templates.blankTemplate',
|
|
127
123
|
defaultMessage: "Blank template",
|
package/package.json
CHANGED
|
@@ -230,6 +230,7 @@ function SlideBoxContent(props) {
|
|
|
230
230
|
showTemplateName={showTemplateName}
|
|
231
231
|
onValidationFail={onValidationFail}
|
|
232
232
|
forwardedTags={forwardedTags}
|
|
233
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
233
234
|
/>
|
|
234
235
|
)}
|
|
235
236
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
@@ -252,6 +253,7 @@ function SlideBoxContent(props) {
|
|
|
252
253
|
showTemplateName={showTemplateName}
|
|
253
254
|
onValidationFail={onValidationFail}
|
|
254
255
|
forwardedTags={forwardedTags}
|
|
256
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
255
257
|
/>
|
|
256
258
|
)}
|
|
257
259
|
{isEditMPush &&
|
|
@@ -467,6 +467,7 @@ class Creatives extends React.Component {
|
|
|
467
467
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
468
468
|
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails} = this.props;
|
|
469
469
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
470
|
+
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
470
471
|
return (
|
|
471
472
|
<SlideBoxWrapper className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'} ${mapTemplateCreate ? 'map-template-create' : ''}`)}>
|
|
472
473
|
<CapSlideBox
|
|
@@ -2562,6 +2562,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2562
2562
|
const previewHeader = (<h3>Email Preview</h3>);
|
|
2563
2563
|
const imagePreviewHeader = (<h3>Image Selection</h3>);
|
|
2564
2564
|
const imagePreviewContent = this.getImagePreviewContent();
|
|
2565
|
+
const { selectedOfferDetails } = this.props;
|
|
2565
2566
|
if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
|
|
2566
2567
|
return (<div>Loading...</div>);
|
|
2567
2568
|
}
|
|
@@ -2617,6 +2618,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2617
2618
|
getValidationData={this.saveValidationData}
|
|
2618
2619
|
saveForm={this.state.saveForm}
|
|
2619
2620
|
stopValidation={this.stopValidation}
|
|
2621
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
2620
2622
|
/> : ''}
|
|
2621
2623
|
</Col>
|
|
2622
2624
|
</Row>
|
|
@@ -2669,6 +2671,7 @@ Email.propTypes = {
|
|
|
2669
2671
|
defaultData: PropTypes.object,
|
|
2670
2672
|
showTemplateName: PropTypes.func,
|
|
2671
2673
|
onValidationFail: PropTypes.func,
|
|
2674
|
+
selectedOfferDetails: PropTypes.array,
|
|
2672
2675
|
};
|
|
2673
2676
|
|
|
2674
2677
|
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
@@ -173,6 +173,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
173
173
|
setIsLoadingContent,
|
|
174
174
|
onValidationFail,
|
|
175
175
|
forwardedTags,
|
|
176
|
+
selectedOfferDetails,
|
|
176
177
|
} = this.props;
|
|
177
178
|
const {
|
|
178
179
|
templateName,
|
|
@@ -232,6 +233,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
232
233
|
showTemplateName={showTemplateName}
|
|
233
234
|
onValidationFail={onValidationFail}
|
|
234
235
|
forwardedTags={forwardedTags}
|
|
236
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
235
237
|
/>}
|
|
236
238
|
{CmsTemplates && !isShowEmailCreate && <CmsTemplatesComponent cmsTemplates={CmsTemplates} handleEdmDefaultTemplateSelection={this.useEditor} />}
|
|
237
239
|
</div>
|
|
@@ -263,6 +265,7 @@ EmailWrapper.propTypes = {
|
|
|
263
265
|
showTemplateName: PropTypes.func,
|
|
264
266
|
onValidationFail: PropTypes.func,
|
|
265
267
|
forwardedTags: PropTypes.object,
|
|
268
|
+
selectedOfferDetails: PropTypes.array,
|
|
266
269
|
};
|
|
267
270
|
|
|
268
271
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -141,15 +141,25 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
141
141
|
|
|
142
142
|
transformCouponTags(offerDetails, allTags) {
|
|
143
143
|
const couponTags = {};
|
|
144
|
+
const couponTagsKeys = Object.keys(_.get(allTags, 'coupon.subtags', []));
|
|
145
|
+
const withCouponId = (obj, id) => {
|
|
146
|
+
const tempObj = {};
|
|
147
|
+
if (obj.subtags) {
|
|
148
|
+
tempObj.subtags = _.mapValues(obj.subtags, (tag) => ({
|
|
149
|
+
...withCouponId(tag, id),
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
...obj,
|
|
154
|
+
...tempObj,
|
|
155
|
+
couponSeriesId: id,
|
|
156
|
+
};
|
|
157
|
+
};
|
|
144
158
|
offerDetails.forEach((offer) => {
|
|
145
159
|
const { id, couponName } = offer;
|
|
146
|
-
const couponTagsKeys = (allTags.coupon && allTags.coupon.subtags && Object.keys(allTags.coupon.subtags)) || [];
|
|
147
160
|
const couponSubTags = {};
|
|
148
161
|
couponTagsKeys.forEach((couponTagKey) => {
|
|
149
|
-
const couponSubTagsObj =
|
|
150
|
-
...allTags.coupon.subtags[couponTagKey],
|
|
151
|
-
couponSeriesId: id,
|
|
152
|
-
};
|
|
162
|
+
const couponSubTagsObj = withCouponId(allTags.coupon.subtags[couponTagKey], id);
|
|
153
163
|
couponSubTags[couponTagKey] = couponSubTagsObj;
|
|
154
164
|
});
|
|
155
165
|
const key = couponName || id;
|