@capillarytech/creatives-library 7.17.33-alpha.5 → 7.17.33-alpha.6

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.
@@ -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 = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
16
+ const defaultScriptUrl = `${window.location.origin}/arya/ui/library/ckeditor/ckeditor.js`;
17
17
  const user = localStorage.getItem('user');
18
18
  let locale = 'en';
19
19
  if (user && JSON.parse(user).lang) {
@@ -42,3 +42,5 @@ export const HOSPITALITY_RELATED_TAGS = [
42
42
  "email",
43
43
  "resID_Source",
44
44
  ];
45
+
46
+ export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.33-alpha.5",
4
+ "version": "7.17.33-alpha.6",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/utils/common.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  CUSTOM_TAG,
13
13
  REGISTRATION_CUSTOM_FIELD,
14
14
  JP_LOCALE_HIDE_FEATURE,
15
+ ENABLE_CUSTOMER_BARCODE_TAG,
15
16
  } from '../containers/App/constants';
16
17
  import { apiMessageFormatHandler } from './commonUtils';
17
18
 
@@ -71,10 +72,10 @@ export const hasJPLocaleHideFeatureEnabled = Auth.hasFeatureAccess.bind(
71
72
  JP_LOCALE_HIDE_FEATURE,
72
73
  );
73
74
 
74
- // export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
75
- // null,
76
- // ENABLE_CUSTOMER_BARCODE_TAG,
77
- // );
75
+ export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
76
+ null,
77
+ ENABLE_CUSTOMER_BARCODE_TAG,
78
+ );
78
79
 
79
80
  //filtering tags based on scope
80
81
  export const filterTags = (tagsToFilter, tagsList) => tagsList?.filter(
@@ -6,6 +6,7 @@ import * as cdnTransformationHandler from './cdnTransformation.handler.mockdata'
6
6
 
7
7
  var bugsnagSpy;
8
8
  var localStorageMock;
9
+ jest.setTimeout(10000);
9
10
  beforeEach(() => {
10
11
  localStorageMock = (function () {
11
12
  var store = {
@@ -17,15 +17,15 @@ 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 } from '../../containers/App/constants';
21
- import { hasCardBasedScope, hasHospitalityBasedScope } from '../../utils/common';
20
+ import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, ENABLE_CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
21
+ import { hasCardBasedScope, hasCustomerBarcodeFeatureEnabled, hasHospitalityBasedScope } from '../../utils/common';
22
22
 
23
23
  import {
24
24
  GET_TRANSLATION_MAPPED,
25
25
  JAPANESE_HELP_TEXT,
26
26
  TAG_TRANSLATION_DOC,
27
27
  } from "../../containers/TagList/constants";
28
- import { ENABLE_CUSTOMER_BARCODE_TAG, JP_LOCALE_HIDE_FEATURE } from '../../v2Containers/App/constants';
28
+ import { JP_LOCALE_HIDE_FEATURE } from '../../v2Containers/App/constants';
29
29
  import { hidingDateTagsForJpLocale } from '../../v2Containers/TagList/utils';
30
30
 
31
31
 
@@ -176,8 +176,7 @@ 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
- console.log("enabled-->", accessibleFeatures, enabledCustomerBarcode);
179
+ // const enabledCustomerBarcode = accessibleFeatures.includes(ENABLE_CUSTOMER_BARCODE_TAG);
181
180
  const list = [];
182
181
  const loyaltyAttrDisableText = <FormattedMessage {...messages.loyaltyAttributeDisable} />;
183
182
  const customerBarcodeDisableText = <FormattedMessage {...messages.customerBarcodeDisable} />;
@@ -215,11 +214,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
215
214
  hidingDateTagsForJpLocale(hideDateTagsForJpLocale, val, list, tagValue);
216
215
  } else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
217
216
  let childDisabled = true;
218
- if (key === "customer_barcode" && !enabledCustomerBarcode) {
217
+ if (key === "customer_barcode" && !hasCustomerBarcodeFeatureEnabled) {
219
218
  childDisabled = true;
220
219
  }
221
220
  else childDisabled = disableRelatedTags ? childTagsToDisable.includes(key) : false;
222
- console.log("child", childDisabled);
223
221
  const tempNode = (
224
222
  <CapTreeNode
225
223
  title={childDisabled ? <CapTooltip title={key === "customer_barcode" ? customerBarcodeDisableText : loyaltyAttrDisableText}>{val.desc || val.name}</CapTooltip> : (val.desc || val.name)} //need to add key name to get tooltip
@@ -13,7 +13,8 @@ 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 = "https://storage.crm.n.content-cdn.io/ckeditor_full/ckeditor/ckeditor.js";
16
+ const defaultScriptUrl = `${window.location.origin}/arya/ui/library/ckeditor/ckeditor.js`;
17
+ //const defaultScriptUrl = 'https://nightly.intouch.capillarytech.com/arya/ui/library/ckeditor/ckeditor.js';
17
18
  const user = localStorage.getItem('user');
18
19
  let locale = 'en';
19
20
  if (user && JSON.parse(user).lang) {