IO-3020 IO-3036 Remove Audit and Lifecycle feature wraps.
This commit is contained in:
@@ -49,7 +49,9 @@ export function BlurWrapper({
|
||||
}
|
||||
|
||||
if (bypass) {
|
||||
console.trace("*** BYPASS USED", featureName);
|
||||
if (import.meta.env.DEV) {
|
||||
console.trace("*** Blur Wrapper BYPASS USED", featureName);
|
||||
}
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -118,7 +120,7 @@ function RandomDate() {
|
||||
const featureNameList = [
|
||||
"mobile",
|
||||
"allAccess",
|
||||
"audit",
|
||||
//"audit", //Removing 2024-12-13. Keeping as default feature.
|
||||
"timetickets",
|
||||
"payments",
|
||||
"partsorders",
|
||||
@@ -133,8 +135,8 @@ const featureNameList = [
|
||||
"checklist",
|
||||
"smartscheduling",
|
||||
"roguard",
|
||||
"dashboard",
|
||||
"lifecycle"
|
||||
"dashboard"
|
||||
//"lifecycle" //Removing 2024-12-13. Keeping as default feature.
|
||||
];
|
||||
|
||||
export function ValidateFeatureName(featureName) {
|
||||
|
||||
@@ -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