@capillarytech/creatives-library 7.17.33-alpha.6 → 7.17.33-alpha.7
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 +1 -1
- package/containers/App/constants.js +2 -1
- package/package.json +1 -1
- package/utils/tests/cdnTransformation.test.js +0 -1
- package/v2Components/CapTagList/index.js +6 -10
- package/v2Components/Ckeditor/index.js +1 -2
- package/v2Components/FormBuilder/index.js +9 -2
- package/v2Containers/App/constants.js +0 -1
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl =
|
|
16
|
+
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
|
|
17
17
|
const user = localStorage.getItem('user');
|
|
18
18
|
let locale = 'en';
|
|
19
19
|
if (user && JSON.parse(user).lang) {
|
|
@@ -43,4 +43,5 @@ export const HOSPITALITY_RELATED_TAGS = [
|
|
|
43
43
|
"resID_Source",
|
|
44
44
|
];
|
|
45
45
|
|
|
46
|
-
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
46
|
+
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
47
|
+
export const CUSTOMER_BAR_TAG = "customer_barcode";
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ 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,
|
|
20
|
+
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BAR_TAG } from '../../containers/App/constants';
|
|
21
21
|
import { hasCardBasedScope, hasCustomerBarcodeFeatureEnabled, hasHospitalityBasedScope } from '../../utils/common';
|
|
22
22
|
|
|
23
23
|
import {
|
|
@@ -176,7 +176,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
176
176
|
const { disableRelatedTags, childTagsToDisable, parentTagstoDisable, showCardsRelatedTags } = this?.props?.disableTagsDetails;
|
|
177
177
|
const { accessibleFeatures = [] } = this?.props?.currentOrgDetails || {};
|
|
178
178
|
const hideDateTagsForJpLocale = accessibleFeatures.includes(JP_LOCALE_HIDE_FEATURE);
|
|
179
|
-
// const enabledCustomerBarcode = accessibleFeatures.includes(ENABLE_CUSTOMER_BARCODE_TAG);
|
|
180
179
|
const list = [];
|
|
181
180
|
const loyaltyAttrDisableText = <FormattedMessage {...messages.loyaltyAttributeDisable} />;
|
|
182
181
|
const customerBarcodeDisableText = <FormattedMessage {...messages.customerBarcodeDisable} />;
|
|
@@ -184,10 +183,6 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
184
183
|
if (!hasCardBasedScope()) {
|
|
185
184
|
clonedTags = _.omit(clonedTags, CARD_RELATED_TAGS);
|
|
186
185
|
}
|
|
187
|
-
// code to remove until barcode tag is not supported by BE
|
|
188
|
-
// if (!hasCustomerBarcodeFeatureEnabled()) {
|
|
189
|
-
// clonedTags = _.omit(clonedTags, ENABLE_CUSTOMER_BARCODE_TAG);
|
|
190
|
-
// }
|
|
191
186
|
if (!hasHospitalityBasedScope()) {
|
|
192
187
|
//filtering HOSPITALITY_RELATED_TAGS if org does not have HOSPITALITY_BASED_SCOPE feature enabled
|
|
193
188
|
clonedTags = _.omit(clonedTags, HOSPITALITY_RELATED_TAGS);
|
|
@@ -214,13 +209,14 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
214
209
|
hidingDateTagsForJpLocale(hideDateTagsForJpLocale, val, list, tagValue);
|
|
215
210
|
} else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
|
|
216
211
|
let childDisabled = true;
|
|
217
|
-
if (key ===
|
|
212
|
+
if (key === CUSTOMER_BAR_TAG && !hasCustomerBarcodeFeatureEnabled()) {
|
|
218
213
|
childDisabled = true;
|
|
219
|
-
}
|
|
220
|
-
|
|
214
|
+
} else {
|
|
215
|
+
childDisabled = disableRelatedTags ? childTagsToDisable.includes(key) : false;
|
|
216
|
+
}
|
|
221
217
|
const tempNode = (
|
|
222
218
|
<CapTreeNode
|
|
223
|
-
title={childDisabled ? <CapTooltip title={key ===
|
|
219
|
+
title={childDisabled ? <CapTooltip title={key === CUSTOMER_BAR_TAG ? customerBarcodeDisableText : loyaltyAttrDisableText}>{val.desc || val.name}</CapTooltip> : (val.desc || val.name)}
|
|
224
220
|
tag={val}
|
|
225
221
|
isLeaf
|
|
226
222
|
key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}
|
|
@@ -13,8 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import _ from 'lodash';
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
|
-
const defaultScriptUrl =
|
|
17
|
-
//const defaultScriptUrl = 'https://nightly.intouch.capillarytech.com/arya/ui/library/ckeditor/ckeditor.js';
|
|
16
|
+
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
|
|
18
17
|
const user = localStorage.getItem('user');
|
|
19
18
|
let locale = 'en';
|
|
20
19
|
if (user && JSON.parse(user).lang) {
|
|
@@ -1136,9 +1136,13 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1136
1136
|
}
|
|
1137
1137
|
});
|
|
1138
1138
|
});
|
|
1139
|
-
const regex = /{{[(A-Z\w
|
|
1139
|
+
const regex = /{{[(A-Z\w\(\)@!#$%^&*~.,/\\]+}}/g;
|
|
1140
1140
|
let match = regex.exec(content);
|
|
1141
|
-
|
|
1141
|
+
const regexImgSrc=/<img[^>]*\bsrc\s*=\s*"[^"]*{{customer_barcode}}[^"]*"/;
|
|
1142
|
+
let matchImg = regexImgSrc.exec(content);
|
|
1143
|
+
const regexCustomerBarcode = /{{customer_barcode}}(?![^<]*>)/g;
|
|
1144
|
+
let matchCustomerBarcode = regexCustomerBarcode.exec(content);
|
|
1145
|
+
while (match !== null ) {
|
|
1142
1146
|
const tagValue = match[0].substring(this.indexOfEnd(match[0], '{{'), match[0].indexOf('}}'));
|
|
1143
1147
|
match = regex.exec(content);
|
|
1144
1148
|
let ifSupported = false;
|
|
@@ -1146,6 +1150,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1146
1150
|
if (tag.definition.value === tagValue) {
|
|
1147
1151
|
ifSupported = true;
|
|
1148
1152
|
}
|
|
1153
|
+
if(tagValue === "customer_barcode" && (matchImg === null || matchCustomerBarcode !== null)){
|
|
1154
|
+
ifSupported = false;
|
|
1155
|
+
}
|
|
1149
1156
|
});
|
|
1150
1157
|
const ifSkipped = this.skipTags(tagValue);
|
|
1151
1158
|
if (ifSkipped) {
|