diff --git a/client/src/components/feature-wrapper/blur-wrapper.component.jsx b/client/src/components/feature-wrapper/blur-wrapper.component.jsx
index fcf80b04b..67c4b8b82 100644
--- a/client/src/components/feature-wrapper/blur-wrapper.component.jsx
+++ b/client/src/components/feature-wrapper/blur-wrapper.component.jsx
@@ -4,6 +4,7 @@ import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { HasFeatureAccess } from "./feature-wrapper.component";
+import { DateTimeFormatterFunction } from "../../utils/DateFormatter";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
@@ -31,6 +32,7 @@ export function BlurWrapper({
if (import.meta.env.DEV) {
if (!ValidateFeatureName(featureName)) console.trace("*** INVALID FEATURE NAME", featureName);
}
+
if (debug) {
console.trace("*** DEBUG MODE", featureName);
console.log("*** HAS FEATURE ACCESS?", featureName, HasFeatureAccess({ featureName, bodyshop }));
@@ -61,8 +63,17 @@ export function BlurWrapper({
} else {
if (typeof overrideValueFunction === "function") {
newValueProp = overrideValueFunction();
- } else if (overrideValueFunction === "RandomDinero") {
+ } else if (typeof overrideValueFunction === "string" && overrideValueFunction === "RandomDinero") {
newValueProp = RandomDinero();
+ } else if (typeof overrideValueFunction === "string" && overrideValueFunction === "RandomAmount") {
+ newValueProp = RandomAmount();
+ } else if (
+ typeof overrideValueFunction === "string" &&
+ overrideValueFunction.startsWith("RandomSmallString")
+ ) {
+ newValueProp = RandomSmallString(overrideValueFunction.split(":")[1] || 3); //Default back to 3 words, otherwise use the string.
+ } else if (typeof overrideValueFunction === "string" && overrideValueFunction.startsWith("RandomDate")) {
+ newValueProp = RandomDate();
} else {
newValueProp = "This is some random text. Nothing interesting here.";
}
@@ -86,6 +97,23 @@ export default connect(mapStateToProps, null)(BlurWrapper);
function RandomDinero() {
return Dinero({ amount: Math.round(Math.exp(Math.random() * 10, 2)) }).toFormat();
}
+function RandomAmount() {
+ return Math.round(Math.exp(Math.random() * 10));
+}
+
+function RandomSmallString(maxWords = 3) {
+ const words = ["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"];
+ const wordCount = Math.floor(Math.random() * maxWords) + 1; // Random number between 1 and 3
+ let result = [];
+ for (let i = 0; i < wordCount; i++) {
+ const randomIndex = Math.floor(Math.random() * words.length);
+ result.push(words[randomIndex]);
+ }
+ return result.join(" ");
+}
+function RandomDate() {
+ return DateTimeFormatterFunction(new Date(Math.floor(Math.random() * 1000000000000)));
+}
const featureNameList = [
"mobile",
@@ -104,9 +132,10 @@ const featureNameList = [
"checklist",
"smartscheduling",
"roguard",
- "dashboard"
+ "dashboard",
+ "lifecycle"
];
-function ValidateFeatureName(featureName) {
+export function ValidateFeatureName(featureName) {
return featureNameList.includes(featureName);
}
diff --git a/client/src/components/feature-wrapper/feature-wrapper.component.jsx b/client/src/components/feature-wrapper/feature-wrapper.component.jsx
index 693fb5d92..275bca222 100644
--- a/client/src/components/feature-wrapper/feature-wrapper.component.jsx
+++ b/client/src/components/feature-wrapper/feature-wrapper.component.jsx
@@ -1,11 +1,12 @@
-import dayjs from "../../utils/day";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
-import AlertComponent from "../alert/alert.component";
+import dayjs from "../../utils/day";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
+import AlertComponent from "../alert/alert.component";
+import { ValidateFeatureName } from "./blur-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
@@ -21,9 +22,12 @@ function FeatureWrapper({
...restProps
}) {
const { t } = useTranslation();
+ if (import.meta.env.DEV) {
+ if (!ValidateFeatureName(featureName)) console.trace("*** INVALID FEATURE NAME", featureName);
+ }
if (upsellComponent) {
- console.error("Upsell component passed in. This is not yet implemented.");
+ console.error("*** Upsell component passed in. This is not yet implemented.");
}
if (HasFeatureAccess({ featureName, bodyshop })) return children;
diff --git a/client/src/components/job-lifecycle/job-lifecycle.component.jsx b/client/src/components/job-lifecycle/job-lifecycle.component.jsx
index e648ad4d5..62b9391cc 100644
--- a/client/src/components/job-lifecycle/job-lifecycle.component.jsx
+++ b/client/src/components/job-lifecycle/job-lifecycle.component.jsx
@@ -8,6 +8,7 @@ import { isEmpty } from "lodash";
import { useTranslation } from "react-i18next";
import "./job-lifecycle.styles.scss";
+import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
// show text on bar if text can fit
export function JobLifecycleComponent({ job, statuses, ...rest }) {
@@ -65,14 +66,23 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
{
title: t("job_lifecycle.columns.value"),
dataIndex: "value",
- key: "value"
+ key: "value",
+ render: (text, record) => (
+