@capillarytech/creatives-library 7.17.33-alpha.2 → 7.17.33-alpha.4

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.
@@ -43,4 +43,4 @@ export const HOSPITALITY_RELATED_TAGS = [
43
43
  "resID_Source",
44
44
  ];
45
45
 
46
- const CUSTOMER_BARCODE_TAG = "customer_barcode";
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.2",
4
+ "version": "7.17.33-alpha.4",
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,6 +72,11 @@ export const hasJPLocaleHideFeatureEnabled = Auth.hasFeatureAccess.bind(
71
72
  JP_LOCALE_HIDE_FEATURE,
72
73
  );
73
74
 
75
+ export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
76
+ null,
77
+ ENABLE_CUSTOMER_BARCODE_TAG,
78
+ );
79
+
74
80
  //filtering tags based on scope
75
81
  export const filterTags = (tagsToFilter, tagsList) => tagsList?.filter(
76
82
  (tag) => !tagsToFilter?.includes(tag?.definition?.value)
@@ -184,9 +184,9 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
184
184
  if (!hasCardBasedScope()) {
185
185
  clonedTags = _.omit(clonedTags, CARD_RELATED_TAGS);
186
186
  }
187
- //code to remove until barcode tag is not supported by BE
188
- // if (!hasCardBasedScope()) {
189
- // clonedTags = _.omit(clonedTags, CUSTOMER_BARCODE_TAG );
187
+ // code to remove until barcode tag is not supported by BE
188
+ // if (!hasCustomerBarcodeFeatureEnabled()) {
189
+ // clonedTags = _.omit(clonedTags, ENABLE_CUSTOMER_BARCODE_TAG);
190
190
  // }
191
191
  if (!hasHospitalityBasedScope()) {
192
192
  //filtering HOSPITALITY_RELATED_TAGS if org does not have HOSPITALITY_BASED_SCOPE feature enabled
@@ -213,7 +213,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
213
213
  );
214
214
  hidingDateTagsForJpLocale(hideDateTagsForJpLocale, val, list, tagValue);
215
215
  } else if (searchString === '' || !searchString || ((val.name || '').toLowerCase().indexOf(searchString.toLowerCase()) !== -1)) {
216
- let childDisabled = false;
216
+ let childDisabled = true;
217
217
  if (key === "customer_barcode" && !enabledCustomerBarcode) {
218
218
  childDisabled = true;
219
219
  }