feature/IO-3255-simplified-parts-management - Checkpoint

This commit is contained in:
Dave
2025-08-13 15:05:57 -04:00
parent de6bb3d634
commit 898b97151f
4 changed files with 54 additions and 39 deletions

View File

@@ -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}
/>
<NotificationProvider>

View File

@@ -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 = {

View File

@@ -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 (
<Footer>
<div
style={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
margin: "1rem 0rem"
}}
>
<div>
{`${InstanceRenderManager({
imex: t("titles.imexonline"),
rome: t("titles.romeonline")
})} - ${import.meta.env.VITE_APP_GIT_SHA_DATE}`}
</div>
<WssStatusDisplayComponent />
<Link to="/disclaimer" target="_blank" style={{ color: "#ccc" }}>
Disclaimer & Notices
</Link>
</div>
</Footer>
);
}
return (
<Footer>

View File

@@ -23,12 +23,9 @@ const SimplifiedPartsJobsDetailPage = lazy(
() => import("../simplified-parts-jobs-detail/simplified-parts-jobs-detail.container.jsx")
);
const PartsSettingsPage = lazy(() => import("../parts-settings/parts-settings.page.component.jsx"));
const ShopPage = lazy(() => import("../shop/shop.page.component.jsx"));
const ShopVendorPageContainer = lazy(() => import("../shop-vendor/shop-vendor.page.container.jsx"));
const EmailOverlayContainer = lazy(() => import("../../components/email-overlay/email-overlay.container.jsx"));
const FeatureRequestPage = lazy(() => import("../feature-request/feature-request.page.jsx"));
const ReportCenterModal = lazy(() => import("../../components/report-center-modal/report-center-modal.container.jsx"));
const Help = lazy(() => import("../help/help.page.jsx"));
const PrintCenterModalContainer = lazy(
() => import("../../components/print-center-modal/print-center-modal.container")
);
@@ -108,15 +105,6 @@ export function SimplifiedPartsPage({ conflict, bodyshop, alerts, setAlerts }) {
}
}, [alerts, displayedAlertIds, notification]);
useEffect(() => {
window.Canny("initChangelog", {
appID: "680bd2c7ee501290377f6686",
position: "top",
align: "left",
theme: "light" // options: light [default], dark, auto
});
}, []);
useEffect(() => {
document.title = InstanceRenderManager({
imex: t("titles.imexonline"),
@@ -166,24 +154,6 @@ export function SimplifiedPartsPage({ conflict, bodyshop, alerts, setAlerts }) {
</Suspense>
}
/>
<Route
path="/shop"
element={
<Suspense fallback={<Spin />}>
<ShopPage />
</Suspense>
}
/>
<Route path="/feature-request/*" index element={<FeatureRequestPage />} />
<Route
path="/help"
element={
<Suspense fallback={<Spin />}>
<Help />
</Suspense>
}
/>
<Route
path="/parts-settings"
element={