@capillarytech/creatives-library 7.17.33-alpha.9 → 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/components/Ckeditor/index.js +1 -2
- package/containers/App/constants.js +0 -3
- package/package.json +1 -1
- package/utils/common.js +0 -6
- package/v2Components/CapTagList/index.js +4 -10
- package/v2Components/CapTagList/messages.js +0 -4
- package/v2Components/Ckeditor/index.js +1 -4
- package/v2Components/FormBuilder/index.js +1 -8
- package/v2Containers/Email/index.js +1 -3
|
@@ -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
|
-
|
|
17
|
-
const defaultScriptUrl = `${window.location.origin}/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) {
|
|
@@ -11,7 +11,6 @@ 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";
|
|
15
14
|
|
|
16
15
|
export const CARD_RELATED_TAGS = [
|
|
17
16
|
'card_series',
|
|
@@ -43,5 +42,3 @@ export const HOSPITALITY_RELATED_TAGS = [
|
|
|
43
42
|
"email",
|
|
44
43
|
"resID_Source",
|
|
45
44
|
];
|
|
46
|
-
|
|
47
|
-
export const CUSTOMER_BAR_TAG = "customer_barcode";
|
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
|
});
|
|
@@ -13,10 +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';
|
|
18
|
-
**Uncomment the above line to use CKEDITOR in local
|
|
19
|
-
*/
|
|
16
|
+
const defaultScriptUrl = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
|
|
20
17
|
const user = localStorage.getItem('user');
|
|
21
18
|
let locale = 'en';
|
|
22
19
|
if (user && JSON.parse(user).lang) {
|
|
@@ -1138,11 +1138,7 @@ 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
|
-
|
|
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);
|