@capillarytech/creatives-library 7.9.17 → 7.9.18
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/package.json
CHANGED
|
@@ -142,6 +142,7 @@ function SlideBoxContent(props) {
|
|
|
142
142
|
fbAdManager,
|
|
143
143
|
showDisabledFBInfo,
|
|
144
144
|
orgUnitId,
|
|
145
|
+
smsRegister,
|
|
145
146
|
} = props;
|
|
146
147
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
147
148
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -207,6 +208,7 @@ function SlideBoxContent(props) {
|
|
|
207
208
|
} else {
|
|
208
209
|
return templateDataObject.versions.base['updated-sms-editor']?.join('');
|
|
209
210
|
}
|
|
211
|
+
return get(templateDataObject, `versions.base['sms-editor']`);
|
|
210
212
|
case constants.LINE: {
|
|
211
213
|
const lineContents = get(templateDataObject, `versions.base.content.messages`, [{}]);
|
|
212
214
|
const previewContent = [];
|
|
@@ -347,6 +349,7 @@ function SlideBoxContent(props) {
|
|
|
347
349
|
messageStrategy={messageStrategy}
|
|
348
350
|
showDisabledFBInfo={showDisabledFBInfo}
|
|
349
351
|
orgUnitId={orgUnitId}
|
|
352
|
+
smsRegister={smsRegister}
|
|
350
353
|
/>
|
|
351
354
|
)}
|
|
352
355
|
{isPreview && (
|
|
@@ -416,6 +419,7 @@ function SlideBoxContent(props) {
|
|
|
416
419
|
onTestContentClicked={onTestContentClicked}
|
|
417
420
|
handleClose={handleClose}
|
|
418
421
|
onCreateComplete={onCreateComplete}
|
|
422
|
+
smsRegister={smsRegister}
|
|
419
423
|
/>
|
|
420
424
|
)}
|
|
421
425
|
{isEditFTP && (
|
|
@@ -463,6 +467,7 @@ function SlideBoxContent(props) {
|
|
|
463
467
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
464
468
|
onTestContentClicked={onTestContentClicked}
|
|
465
469
|
onCreateComplete={onCreateComplete}
|
|
470
|
+
smsRegister={smsRegister}
|
|
466
471
|
/>
|
|
467
472
|
)}
|
|
468
473
|
|
|
@@ -286,14 +286,14 @@ class Creatives extends React.Component {
|
|
|
286
286
|
type: constants.FACEBOOK,
|
|
287
287
|
edit: true,
|
|
288
288
|
selectedFacebookAccount,
|
|
289
|
-
fbContentType
|
|
289
|
+
fbContentType,
|
|
290
290
|
};
|
|
291
291
|
} else {
|
|
292
292
|
creativesTemplateData = {
|
|
293
293
|
selectedMarketingObjective: templateData.selectedMarketingObjective,
|
|
294
294
|
edit: true,
|
|
295
295
|
type: channel,
|
|
296
|
-
fbContentType: templateData.fbContentType
|
|
296
|
+
fbContentType: templateData.fbContentType,
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
break;
|
|
@@ -771,7 +771,7 @@ class Creatives extends React.Component {
|
|
|
771
771
|
}
|
|
772
772
|
render() {
|
|
773
773
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
774
|
-
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor} = this.props;
|
|
774
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData, editor, smsRegister} = this.props;
|
|
775
775
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
776
776
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
777
777
|
return (
|
|
@@ -848,6 +848,7 @@ class Creatives extends React.Component {
|
|
|
848
848
|
handleClose={this.handleCloseSlideBox}
|
|
849
849
|
onFTPSubmit={getCreativesData}
|
|
850
850
|
editor={editor}
|
|
851
|
+
smsRegister={smsRegister}
|
|
851
852
|
messageStrategy={this.props.strategy}
|
|
852
853
|
orgUnitId={this.props.orgUnitId}
|
|
853
854
|
/>
|
|
@@ -26,7 +26,8 @@ const SmsWrapper = (props) => {
|
|
|
26
26
|
onPreviewContentClicked,
|
|
27
27
|
onTestContentClicked,
|
|
28
28
|
onCreateComplete,
|
|
29
|
-
handleClose
|
|
29
|
+
handleClose,
|
|
30
|
+
smsRegister,
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
const smsProps = {
|
|
@@ -43,7 +44,9 @@ const SmsWrapper = (props) => {
|
|
|
43
44
|
onPreviewContentClicked,
|
|
44
45
|
onTestContentClicked,
|
|
45
46
|
};
|
|
46
|
-
const
|
|
47
|
+
const isTraiDltFeatureForOrg = hasTraiDltFeature();
|
|
48
|
+
const isTariEnableforLib = (!isFullMode && smsRegister === "DLT" ) || isFullMode;
|
|
49
|
+
const isTraiDltFeature = isTraiDltFeatureForOrg && isTariEnableforLib;
|
|
47
50
|
return <>
|
|
48
51
|
{
|
|
49
52
|
isCreateSms && (isTraiDltFeature ?
|
|
@@ -63,10 +66,10 @@ const SmsWrapper = (props) => {
|
|
|
63
66
|
params={{id: templateData._id}}
|
|
64
67
|
templateData={templateData}
|
|
65
68
|
handleClose={handleClose}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
/> : <SmsEdit
|
|
70
|
+
{...smsProps}
|
|
71
|
+
params={{id: templateData._id}}
|
|
72
|
+
templateData={templateData}
|
|
70
73
|
/>
|
|
71
74
|
)}
|
|
72
75
|
</>;
|
|
@@ -155,7 +155,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
155
155
|
this.prepareMobilePushPreviewData = this.prepareMobilePushPreviewData.bind(this);
|
|
156
156
|
this.menuOnClickEvent = this.menuOnClickEvent.bind(this);
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
componentWillMount() {
|
|
160
160
|
if (this.state.channel === '') {
|
|
161
161
|
let channel = '';
|
|
@@ -207,7 +207,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
checkDLTfeatureEnable = () => {
|
|
211
|
+
const isTraiDltFeatureForOrg = commonUtil.hasTraiDltFeature();
|
|
212
|
+
const {smsRegister, isFullMode} = this.props;
|
|
213
|
+
const isTariEnableforLib = (!isFullMode && smsRegister === "DLT" ) || isFullMode;
|
|
214
|
+
const isTraiDltFeature = isTraiDltFeatureForOrg && isTariEnableforLib;
|
|
215
|
+
return isTraiDltFeature;
|
|
216
|
+
}
|
|
211
217
|
componentDidMount() {
|
|
212
218
|
if (this.props.location.query.type === 'embedded' && this.isEnabledInLibraryModule("setLocale")) {
|
|
213
219
|
this.setLocale();
|
|
@@ -223,7 +229,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
223
229
|
queryParams.page = this.state.page;
|
|
224
230
|
queryParams.perPage = this.state.perPageLimit;
|
|
225
231
|
const channel = this.state.channel;
|
|
226
|
-
const isTraiDltFeature =
|
|
232
|
+
const isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
227
233
|
if ((this.state.channel || '').toLowerCase() === "sms" && isTraiDltFeature) {
|
|
228
234
|
queryParams.traiEnable = true;
|
|
229
235
|
}
|
|
@@ -586,7 +592,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
586
592
|
if (activeMode === ACCOUNT_SELECTION_MODE) {
|
|
587
593
|
this.setTemplatesMode();
|
|
588
594
|
}
|
|
589
|
-
const isTraiDltFeature =
|
|
595
|
+
const isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
590
596
|
if ((this.state.channel || '').toLowerCase() === "sms" && isTraiDltFeature) {
|
|
591
597
|
queryParams.traiEnable = true;
|
|
592
598
|
}
|
|
@@ -628,7 +634,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
628
634
|
}
|
|
629
635
|
}
|
|
630
636
|
}
|
|
631
|
-
|
|
637
|
+
|
|
632
638
|
this.setState({page, templatesCount}, () => {
|
|
633
639
|
queryParams.page = page;
|
|
634
640
|
queryParams.perPage = this.state.perPageLimit;
|
|
@@ -670,7 +676,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
670
676
|
}
|
|
671
677
|
if (currentChannel === SMS) {
|
|
672
678
|
filteredTemplates = this.filterSMSTemplates(templates);
|
|
673
|
-
isTraiDltFeature =
|
|
679
|
+
isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
674
680
|
}
|
|
675
681
|
const cardDataList = filteredTemplates && filteredTemplates.length ? map(filteredTemplates, (template) => {
|
|
676
682
|
const templateData =
|
|
@@ -2054,7 +2060,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2054
2060
|
const isfilterContentVisisble = true;
|
|
2055
2061
|
const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
|
|
2056
2062
|
const channelLowerCase = (channel || '').toLowerCase();
|
|
2057
|
-
const isTraiDltFeature =
|
|
2063
|
+
const isTraiDltFeature = this.checkDLTfeatureEnable();
|
|
2058
2064
|
const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH].includes(this.state.channel.toUpperCase())) && <div className="action-container">
|
|
2059
2065
|
{isfilterContentVisisble && <CapInput.Search
|
|
2060
2066
|
className="search-text"
|
|
@@ -199,7 +199,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
199
199
|
getTemplatesComponent(channel) {
|
|
200
200
|
// const templates = this.props.Templates[`${channel}Templates`];
|
|
201
201
|
let query = {};
|
|
202
|
-
const {isFullMode, messageStrategy} = this.props;
|
|
202
|
+
const {isFullMode, messageStrategy, smsRegister} = this.props;
|
|
203
203
|
if (!isFullMode) {
|
|
204
204
|
query = {type: 'embedded', module: 'library'};
|
|
205
205
|
switch (channel) {
|
|
@@ -232,6 +232,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
232
232
|
renderNewCardGrid={this.getTemplateDataForGrid}
|
|
233
233
|
handlePeviewTemplate={this.props.handlePeviewTemplate}
|
|
234
234
|
messageStrategy={this.props.messageStrategy}
|
|
235
|
+
smsRegister={smsRegister}
|
|
235
236
|
/>);
|
|
236
237
|
}
|
|
237
238
|
}
|