IO-3020 IO-3036 Remove Audit and Lifecycle feature wraps.
This commit is contained in:
@@ -19,9 +19,18 @@ function FeatureWrapper({
|
||||
blurContent,
|
||||
children,
|
||||
upsellComponent,
|
||||
bypass,
|
||||
...restProps
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (bypass) {
|
||||
if (import.meta.env.DEV) {
|
||||
console.trace("*** Feature Wrapper BYPASS USED", featureName);
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
if (!ValidateFeatureName(featureName)) console.trace("*** INVALID FEATURE NAME", featureName);
|
||||
}
|
||||
@@ -59,10 +68,16 @@ function FeatureWrapper({
|
||||
}
|
||||
}
|
||||
|
||||
export function HasFeatureAccess({ featureName, bodyshop, debug = false }) {
|
||||
export function HasFeatureAccess({ featureName, bodyshop, bypass, debug = false }) {
|
||||
if (debug) {
|
||||
console.trace(`*** HasFeatureAccessFunction called with feature << ${featureName} >>`);
|
||||
}
|
||||
if (bypass) {
|
||||
if (import.meta.env.DEV) {
|
||||
console.trace("*** Feature Wrapper BYPASS USED", featureName);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return bodyshop?.features?.allAccess || dayjs(bodyshop?.features[featureName]).isAfter(dayjs());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user