@capillarytech/creatives-library 7.17.33-alpha.7 → 7.17.33
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
package/utils/common.js
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
CUSTOM_TAG,
|
|
13
13
|
REGISTRATION_CUSTOM_FIELD,
|
|
14
14
|
JP_LOCALE_HIDE_FEATURE,
|
|
15
|
-
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
16
15
|
} from '../containers/App/constants';
|
|
17
16
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
18
17
|
|
|
@@ -72,11 +71,6 @@ export const hasJPLocaleHideFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
|
72
71
|
JP_LOCALE_HIDE_FEATURE,
|
|
73
72
|
);
|
|
74
73
|
|
|
75
|
-
export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
76
|
-
null,
|
|
77
|
-
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
78
|
-
);
|
|
79
|
-
|
|
80
74
|
//filtering tags based on scope
|
|
81
75
|
export const filterTags = (tagsToFilter, tagsList) => tagsList?.filter(
|
|
82
76
|
(tag) => !tagsToFilter?.includes(tag?.definition?.value)
|
|
@@ -17,8 +17,8 @@ import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
|
|
17
17
|
import { createStructuredSelector } from 'reselect';
|
|
18
18
|
import messages from './messages';
|
|
19
19
|
import { makeSelectLoyaltyPromotionDisplay } from '../../v2Containers/Cap/selectors';
|
|
20
|
-
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS
|
|
21
|
-
import { hasCardBasedScope,
|
|
20
|
+
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS } from '../../containers/App/constants';
|
|
21
|
+
import { hasCardBasedScope, hasHospitalityBasedScope } from '../../utils/common';
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
GET_TRANSLATION_MAPPED,
|
|
@@ -178,7 +178,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
178
178
|
const hideDateTagsForJpLocale = accessibleFeatures.includes(JP_LOCALE_HIDE_FEATURE);
|
|
179
179
|
const list = [];
|
|
180
180
|
const loyaltyAttrDisableText = <FormattedMessage {...messages.loyaltyAttributeDisable} />;
|
|
181
|
-
const customerBarcodeDisableText = <FormattedMessage {...messages.customerBarcodeDisable} />;
|
|
182
181
|
let clonedTags = _.cloneDeep(tags);
|
|
183
182
|
if (!hasCardBasedScope()) {
|
|
184
183
|
clonedTags = _.omit(clonedTags, CARD_RELATED_TAGS);
|
|
@@ -208,15 +207,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
208
207
|
);
|
|
209
208
|
hidingDateTagsForJpLocale(hideDateTagsForJpLocale, val, list, tagValue);
|
|
210
209
|
} else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
|
|
211
|
-
|
|
212
|
-
if (key === CUSTOMER_BAR_TAG && !hasCustomerBarcodeFeatureEnabled()) {
|
|
213
|
-
childDisabled = true;
|
|
214
|
-
} else {
|
|
215
|
-
childDisabled = disableRelatedTags ? childTagsToDisable.includes(key) : false;
|
|
216
|
-
}
|
|
210
|
+
const childDisabled = disableRelatedTags ? childTagsToDisable.includes(key) : false;
|
|
217
211
|
const tempNode = (
|
|
218
212
|
<CapTreeNode
|
|
219
|
-
title={childDisabled ? <CapTooltip title={
|
|
213
|
+
title={childDisabled ? <CapTooltip title={loyaltyAttrDisableText}>{val.desc || val.name}</CapTooltip> : (val.desc || val.name)}
|
|
220
214
|
tag={val}
|
|
221
215
|
isLeaf
|
|
222
216
|
key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}
|
|
@@ -46,8 +46,4 @@ export default defineMessages({
|
|
|
46
46
|
id: `creatives.componentsV2.CapTagList.loyaltyAttributeDisable`,
|
|
47
47
|
defaultMessage: 'You won’t be able to add loyalty related attributes since the loyalty program/ card series is None.',
|
|
48
48
|
},
|
|
49
|
-
"customerBarcodeDisable": {
|
|
50
|
-
id: `creatives.componentsV2.CapTagList.customerBarcodeDisable`,
|
|
51
|
-
defaultMessage: 'This label is not enabled for your organization. Please connect with your Capillary POC',
|
|
52
|
-
},
|
|
53
49
|
});
|
|
@@ -1136,13 +1136,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
1138
|
});
|
|
1139
|
-
const regex = /{{[(A-Z\w\(\)@!#$%^&*~.,/\\]+}}/g;
|
|
1139
|
+
const regex = /{{[(A-Z\w+(\s\w+)*$\(\)@!#$%^&*~.,/\\]+}}/g;
|
|
1140
1140
|
let match = regex.exec(content);
|
|
1141
|
-
|
|
1142
|
-
let matchImg = regexImgSrc.exec(content);
|
|
1143
|
-
const regexCustomerBarcode = /{{customer_barcode}}(?![^<]*>)/g;
|
|
1144
|
-
let matchCustomerBarcode = regexCustomerBarcode.exec(content);
|
|
1145
|
-
while (match !== null ) {
|
|
1141
|
+
while (match !== null) {
|
|
1146
1142
|
const tagValue = match[0].substring(this.indexOfEnd(match[0], '{{'), match[0].indexOf('}}'));
|
|
1147
1143
|
match = regex.exec(content);
|
|
1148
1144
|
let ifSupported = false;
|
|
@@ -1150,9 +1146,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1150
1146
|
if (tag.definition.value === tagValue) {
|
|
1151
1147
|
ifSupported = true;
|
|
1152
1148
|
}
|
|
1153
|
-
if(tagValue === "customer_barcode" && (matchImg === null || matchCustomerBarcode !== null)){
|
|
1154
|
-
ifSupported = false;
|
|
1155
|
-
}
|
|
1156
1149
|
});
|
|
1157
1150
|
const ifSkipped = this.skipTags(tagValue);
|
|
1158
1151
|
if (ifSkipped) {
|
|
@@ -643,9 +643,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
643
643
|
} else if (data === "unsubscribe" && this.state.editorInstanse) {
|
|
644
644
|
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
645
645
|
this.state.editorInstanse.insertHtml(`${anchor}`);
|
|
646
|
-
} else if (
|
|
647
|
-
this.state.editorInstanse.insertHtml(`<img src="https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/8ebc8301-e262-45a6-bdab-ff0de91a.png?code={{${data}}}" />`);
|
|
648
|
-
} else if (this.state.editorInstanse){
|
|
646
|
+
} else if (this.state.editorInstanse) {
|
|
649
647
|
this.state.editorInstanse.insertHtml(`{{${data}}}`);
|
|
650
648
|
}
|
|
651
649
|
//this.resetCkEditorInstance(currentTab, formData, true, data);
|