From cfe072744711fb98826e1b43ce70383e62278586 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 23 Jan 2024 10:20:26 -0500 Subject: [PATCH] - Rough in front end / backend Signed-off-by: Dave Richer --- .../job-lifecycle/job-lifecycle.component.jsx | 34 +++++++++++-------- .../eventAuthorizationMIddleware.js | 6 ---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/client/src/components/job-lifecycle/job-lifecycle.component.jsx b/client/src/components/job-lifecycle/job-lifecycle.component.jsx index dc6925055..c9303177e 100644 --- a/client/src/components/job-lifecycle/job-lifecycle.component.jsx +++ b/client/src/components/job-lifecycle/job-lifecycle.component.jsx @@ -13,7 +13,7 @@ const mapDispatchToProps = (dispatch) => ({ }); export function JobLifecycleComponent({bodyshop, job, ...rest}) { - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const [lifecycleData, setLifecycleData] = useState(null); @@ -56,20 +56,26 @@ export function JobLifecycleComponent({bodyshop, job, ...rest}) { return ( - - - + {!loading ? ( + + +
+ + + + {lifecycleData.map((item, index) => ( + + {item.value} - {new Date(item.start).toLocaleString()} + + ))} + + + + ) : ( + + Loading Job Timelines.... - - - {lifecycleData.map((item, index) => ( - - {item.value} - {new Date(item.start).toLocaleString()} - - ))} - - - + )} ); } diff --git a/server/middleware/eventAuthorizationMIddleware.js b/server/middleware/eventAuthorizationMIddleware.js index 423fbc73f..9dd4dfd3a 100644 --- a/server/middleware/eventAuthorizationMIddleware.js +++ b/server/middleware/eventAuthorizationMIddleware.js @@ -1,10 +1,4 @@ const path = require("path"); -require("dotenv").config({ - path: path.resolve( - process.cwd(), - `.env.${process.env.NODE_ENV || "development"}` - ), -}); /** * Checks if the event secret is correct