@capillarytech/creatives-library 7.17.58 → 7.17.59
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.
|
@@ -12,6 +12,7 @@ export const PROMO_ENGINE = 'PROMO_ENGINE';
|
|
|
12
12
|
export const CUSTOM_TAG = 'CustomTagMessage';
|
|
13
13
|
export const CUSTOMER_EXTENDED_FIELD = 'Customer extended fields';
|
|
14
14
|
export const EXTENDED_TAG = 'ExtendedTagMessage';
|
|
15
|
+
export const BADGES_UI_ENABLED = 'BADGES_UI_ENABLED';
|
|
15
16
|
export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
|
|
16
17
|
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
17
18
|
|
|
@@ -70,5 +71,19 @@ export const PROMO_ENGINE_RELATED_TAGS = [
|
|
|
70
71
|
"promotion_expiry_date",
|
|
71
72
|
];
|
|
72
73
|
|
|
74
|
+
export const BADGES_RELATED_TAGS = [
|
|
75
|
+
"Badge",
|
|
76
|
+
"Badge_expiry_date",
|
|
77
|
+
"badge_expiry_mm_slash_dd_slash_yyyy",
|
|
78
|
+
"badge_expiry_dd_slash_mm_slash_yyyy",
|
|
79
|
+
"badge_expiry_yyyy_hyphen_mm_hyphen_dd",
|
|
80
|
+
"badge_expiry_mm_slash_dd_slash_yy",
|
|
81
|
+
"badge_expiry_dd_space_Mon_space_yyyy",
|
|
82
|
+
"badge_expiry_Day_comma_space_Mon_space_dd_comma_space_yy",
|
|
83
|
+
"badge_expiry_Dd_dot_mm_dot_yy",
|
|
84
|
+
"badge_expiry_dd_space_Mon",
|
|
85
|
+
"Days_until_expiry",
|
|
86
|
+
];
|
|
87
|
+
|
|
73
88
|
export const CUSTOMER_BARCODE_TAG = "customer_barcode";
|
|
74
89
|
export const COPY_OF = "Copy of";
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
REGISTRATION_CUSTOM_FIELD,
|
|
16
16
|
JP_LOCALE_HIDE_FEATURE,
|
|
17
17
|
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
18
|
+
BADGES_UI_ENABLED,
|
|
18
19
|
} from '../containers/App/constants';
|
|
19
20
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
20
21
|
|
|
@@ -77,6 +78,12 @@ export const hasGiftVoucherFeature = Auth.hasFeatureAccess.bind(
|
|
|
77
78
|
null,
|
|
78
79
|
GIFT_CARDS,
|
|
79
80
|
);
|
|
81
|
+
|
|
82
|
+
export const hasBadgesFeature = Auth.hasFeatureAccess.bind(
|
|
83
|
+
null,
|
|
84
|
+
BADGES_UI_ENABLED
|
|
85
|
+
);
|
|
86
|
+
|
|
80
87
|
export const hasJPLocaleHideFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
81
88
|
null,
|
|
82
89
|
JP_LOCALE_HIDE_FEATURE,
|
|
@@ -2313,7 +2313,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2313
2313
|
const { formatMessage } = this.props.intl;
|
|
2314
2314
|
|
|
2315
2315
|
const { accessibleFeatures = [] } = this.props.currentOrgDetails || {};
|
|
2316
|
-
const hasAiSuggestionsEnabled =
|
|
2316
|
+
const hasAiSuggestionsEnabled = accessibleFeatures.includes(
|
|
2317
|
+
ENABLE_AI_SUGGESTIONS
|
|
2318
|
+
);
|
|
2317
2319
|
|
|
2318
2320
|
let errorMessageText = false;
|
|
2319
2321
|
switch (errorType) {
|
|
@@ -22,8 +22,8 @@ import './_tagList.scss';
|
|
|
22
22
|
import { selectCurrentOrgDetails } from '../Cap/selectors';
|
|
23
23
|
import { injectIntl } from 'react-intl';
|
|
24
24
|
import { scope } from './messages';
|
|
25
|
-
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature } from '../../utils/common';
|
|
26
|
-
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS } from '../../containers/App/constants';
|
|
25
|
+
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature } from '../../utils/common';
|
|
26
|
+
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS } from '../../containers/App/constants';
|
|
27
27
|
|
|
28
28
|
const TreeNode = Tree.TreeNode;
|
|
29
29
|
|
|
@@ -105,6 +105,10 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
105
105
|
//filtering GIFT_VOUCHER_RELATED_TAGS if org does not have GIFT_CARDS feature enabled
|
|
106
106
|
excludedTags.push(...GIFT_VOUCHER_RELATED_TAGS);
|
|
107
107
|
}
|
|
108
|
+
if (!hasBadgesFeature()) {
|
|
109
|
+
//filtering BADGES_RELATED_TAGS if org does not have BADGES feature enabled
|
|
110
|
+
excludedTags.push(...BADGES_RELATED_TAGS);
|
|
111
|
+
}
|
|
108
112
|
//Form tags object with tag headers
|
|
109
113
|
_.forEach(tagsList, (temp) => {
|
|
110
114
|
const tag = temp.definition;
|