From 898b97151fd62131f99c8e376ae5d57284f524d8 Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 13 Aug 2025 15:05:57 -0400 Subject: [PATCH] feature/IO-3255-simplified-parts-management - Checkpoint --- client/src/App/App.jsx | 17 ++++++-- client/src/App/ProductFruitsWrapper.jsx | 7 +++- .../global-footer/global-footer.component.jsx | 39 +++++++++++++++++-- .../simplified-parts.page.component.jsx | 30 -------------- 4 files changed, 54 insertions(+), 39 deletions(-) diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 85f54240c..0c7a4051d 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -14,7 +14,7 @@ import LandingPage from "../pages/landing/landing.page"; import TechPageContainer from "../pages/tech/tech.page.container"; import SimplifiedPartsPageContainer from "../pages/simplified-parts/simplified-parts.page.container.jsx"; import { setIsPartsEntry, setOnline } from "../redux/application/application.actions"; -import { selectOnline } from "../redux/application/application.selectors"; +import { selectIsPartsEntry, selectOnline } from "../redux/application/application.selectors"; import { checkUserSession } from "../redux/user/user.actions"; import { selectBodyshop, selectCurrentEula, selectCurrentUser } from "../redux/user/user.selectors"; import PrivateRoute from "../components/PrivateRoute"; @@ -34,7 +34,8 @@ const mapStateToProps = createStructuredSelector({ currentUser: selectCurrentUser, online: selectOnline, bodyshop: selectBodyshop, - currentEula: selectCurrentEula + currentEula: selectCurrentEula, + isPartsEntry: selectIsPartsEntry }); const mapDispatchToProps = (dispatch) => ({ @@ -43,7 +44,16 @@ const mapDispatchToProps = (dispatch) => ({ setIsPartsEntry: (isParts) => dispatch(setIsPartsEntry(isParts)) }); -export function App({ bodyshop, checkUserSession, currentUser, online, setOnline, setIsPartsEntry, currentEula }) { +export function App({ + bodyshop, + checkUserSession, + currentUser, + online, + setOnline, + setIsPartsEntry, + currentEula, + isPartsEntry +}) { const client = useSplitClient().client; const [listenersAdded, setListenersAdded] = useState(false); const { t } = useTranslation(); @@ -150,6 +160,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline currentUser={currentUser} bodyshop={bodyshop} workspaceCode={bodyshop?.tours_enabled ? "9BkbEseqNqxw8jUH" : ""} + isPartsEntry={isPartsEntry} /> diff --git a/client/src/App/ProductFruitsWrapper.jsx b/client/src/App/ProductFruitsWrapper.jsx index 70372198d..f22eb7a5e 100644 --- a/client/src/App/ProductFruitsWrapper.jsx +++ b/client/src/App/ProductFruitsWrapper.jsx @@ -3,15 +3,16 @@ import PropTypes from "prop-types"; import { ProductFruits } from "react-product-fruits"; import dayjs from "dayjs"; -const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode }) => { +const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode, isPartsEntry }) => { const featureProps = bodyshop?.features ? Object.entries(bodyshop.features).reduce((acc, [key, value]) => { acc[key] = value === true || (typeof value === "string" && dayjs(value).isAfter(dayjs())); return acc; }, {}) : {}; - + return ( + !isPartsEntry && workspaceCode && currentUser?.authorized === true && currentUser?.email && ( @@ -30,6 +31,8 @@ const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode ); }); +ProductFruitsWrapper.displayName = "ProductFruitsWrapper"; + export default ProductFruitsWrapper; ProductFruitsWrapper.propTypes = { diff --git a/client/src/components/global-footer/global-footer.component.jsx b/client/src/components/global-footer/global-footer.component.jsx index 7a5cefa62..68b306943 100644 --- a/client/src/components/global-footer/global-footer.component.jsx +++ b/client/src/components/global-footer/global-footer.component.jsx @@ -7,32 +7,63 @@ import { Link } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import WssStatusDisplayComponent from "../../components/wss-status-display/wss-status-display.component.jsx"; import { addAlerts } from "../../redux/application/application.actions.js"; -import { selectAlerts } from "../../redux/application/application.selectors.js"; +import { selectAlerts, selectIsPartsEntry } from "../../redux/application/application.selectors.js"; import { selectBodyshop, selectInstanceConflict } from "../../redux/user/user.selectors"; import InstanceRenderManager from "../../utils/instanceRenderMgr.js"; + const { Footer } = Layout; const mapStateToProps = createStructuredSelector({ conflict: selectInstanceConflict, bodyshop: selectBodyshop, - alerts: selectAlerts + alerts: selectAlerts, + isPartsEntry: selectIsPartsEntry }); const mapDispatchToProps = (dispatch) => ({ setAlerts: (alerts) => dispatch(addAlerts(alerts)) }); -export function GlobalFooter() { +export function GlobalFooter({ isPartsEntry }) { const { t } = useTranslation(); useEffect(() => { + // Canny Not Required on Parts Entry + if (isPartsEntry) return; window.Canny("initChangelog", { appID: "680bd2c7ee501290377f6686", position: "top", align: "left", theme: "light" // options: light [default], dark, auto }); - }, []); + }, [isPartsEntry]); + + if (isPartsEntry) { + return ( +
+
+
+ {`${InstanceRenderManager({ + imex: t("titles.imexonline"), + rome: t("titles.romeonline") + })} - ${import.meta.env.VITE_APP_GIT_SHA_DATE}`} +
+ + + Disclaimer & Notices + +
+
+ ); + } return (