@capillarytech/creatives-library 7.17.33-alpha.6 → 7.17.33-alpha.9
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 -0
- 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 +3 -1
- package/v2Components/FormBuilder/index.js +8 -1
- package/v2Containers/App/constants.js +0 -1
|
@@ -13,6 +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
|
+
// fetching ckeditor from s3 by rerouting through arya whitelisted services
|
|
16
17
|
const defaultScriptUrl = `${window.location.origin}/arya/ui/library/ckeditor/ckeditor.js`;
|
|
17
18
|
const user = localStorage.getItem('user');
|
|
18
19
|
let locale = 'en';
|
|
@@ -11,6 +11,7 @@ export const CUSTOM_TAG = 'CustomTagMessage';
|
|
|
11
11
|
export const CUSTOMER_EXTENDED_FIELD = 'Customer extended fields';
|
|
12
12
|
export const EXTENDED_TAG = 'ExtendedTagMessage';
|
|
13
13
|
export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
|
|
14
|
+
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
14
15
|
|
|
15
16
|
export const CARD_RELATED_TAGS = [
|
|
16
17
|
'card_series',
|
|
@@ -43,4 +44,4 @@ export const HOSPITALITY_RELATED_TAGS = [
|
|
|
43
44
|
"resID_Source",
|
|
44
45
|
];
|
|
45
46
|
|
|
46
|
-
export const
|
|
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}`}
|
|
@@ -14,7 +14,9 @@ import _ from 'lodash';
|
|
|
14
14
|
// import messages from './messages';
|
|
15
15
|
const loadScript = require('load-script');
|
|
16
16
|
const defaultScriptUrl = `${window.location.origin}/arya/ui/library/ckeditor/ckeditor.js`;
|
|
17
|
-
|
|
17
|
+
/*const defaultScriptUrl = 'https://nightly.intouch.capillarytech.com/arya/ui/library/ckeditor/ckeditor.js';
|
|
18
|
+
**Uncomment the above line to use CKEDITOR in local
|
|
19
|
+
*/
|
|
18
20
|
const user = localStorage.getItem('user');
|
|
19
21
|
let locale = 'en';
|
|
20
22
|
if (user && JSON.parse(user).lang) {
|
|
@@ -1138,7 +1138,11 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1138
1138
|
});
|
|
1139
1139
|
const regex = /{{[(A-Z\w+(\s\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) {
|