feature/IO-3255-simplified-parts-management - Checkpoint
This commit is contained in:
@@ -14,7 +14,7 @@ import LandingPage from "../pages/landing/landing.page";
|
|||||||
import TechPageContainer from "../pages/tech/tech.page.container";
|
import TechPageContainer from "../pages/tech/tech.page.container";
|
||||||
import SimplifiedPartsPageContainer from "../pages/simplified-parts/simplified-parts.page.container.jsx";
|
import SimplifiedPartsPageContainer from "../pages/simplified-parts/simplified-parts.page.container.jsx";
|
||||||
import { setIsPartsEntry, setOnline } from "../redux/application/application.actions";
|
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 { checkUserSession } from "../redux/user/user.actions";
|
||||||
import { selectBodyshop, selectCurrentEula, selectCurrentUser } from "../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentEula, selectCurrentUser } from "../redux/user/user.selectors";
|
||||||
import PrivateRoute from "../components/PrivateRoute";
|
import PrivateRoute from "../components/PrivateRoute";
|
||||||
@@ -34,7 +34,8 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
online: selectOnline,
|
online: selectOnline,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentEula: selectCurrentEula
|
currentEula: selectCurrentEula,
|
||||||
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -43,7 +44,16 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
setIsPartsEntry: (isParts) => dispatch(setIsPartsEntry(isParts))
|
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 client = useSplitClient().client;
|
||||||
const [listenersAdded, setListenersAdded] = useState(false);
|
const [listenersAdded, setListenersAdded] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -150,6 +160,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
currentUser={currentUser}
|
currentUser={currentUser}
|
||||||
bodyshop={bodyshop}
|
bodyshop={bodyshop}
|
||||||
workspaceCode={bodyshop?.tours_enabled ? "9BkbEseqNqxw8jUH" : ""}
|
workspaceCode={bodyshop?.tours_enabled ? "9BkbEseqNqxw8jUH" : ""}
|
||||||
|
isPartsEntry={isPartsEntry}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NotificationProvider>
|
<NotificationProvider>
|
||||||
|
|||||||
@@ -3,15 +3,16 @@ import PropTypes from "prop-types";
|
|||||||
import { ProductFruits } from "react-product-fruits";
|
import { ProductFruits } from "react-product-fruits";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode }) => {
|
const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode, isPartsEntry }) => {
|
||||||
const featureProps = bodyshop?.features
|
const featureProps = bodyshop?.features
|
||||||
? Object.entries(bodyshop.features).reduce((acc, [key, value]) => {
|
? Object.entries(bodyshop.features).reduce((acc, [key, value]) => {
|
||||||
acc[key] = value === true || (typeof value === "string" && dayjs(value).isAfter(dayjs()));
|
acc[key] = value === true || (typeof value === "string" && dayjs(value).isAfter(dayjs()));
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
!isPartsEntry &&
|
||||||
workspaceCode &&
|
workspaceCode &&
|
||||||
currentUser?.authorized === true &&
|
currentUser?.authorized === true &&
|
||||||
currentUser?.email && (
|
currentUser?.email && (
|
||||||
@@ -30,6 +31,8 @@ const ProductFruitsWrapper = React.memo(({ currentUser, bodyshop, workspaceCode
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ProductFruitsWrapper.displayName = "ProductFruitsWrapper";
|
||||||
|
|
||||||
export default ProductFruitsWrapper;
|
export default ProductFruitsWrapper;
|
||||||
|
|
||||||
ProductFruitsWrapper.propTypes = {
|
ProductFruitsWrapper.propTypes = {
|
||||||
|
|||||||
@@ -7,32 +7,63 @@ import { Link } from "react-router-dom";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import WssStatusDisplayComponent from "../../components/wss-status-display/wss-status-display.component.jsx";
|
import WssStatusDisplayComponent from "../../components/wss-status-display/wss-status-display.component.jsx";
|
||||||
import { addAlerts } from "../../redux/application/application.actions.js";
|
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 { selectBodyshop, selectInstanceConflict } from "../../redux/user/user.selectors";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr.js";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr.js";
|
||||||
|
|
||||||
const { Footer } = Layout;
|
const { Footer } = Layout;
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
conflict: selectInstanceConflict,
|
conflict: selectInstanceConflict,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
alerts: selectAlerts
|
alerts: selectAlerts,
|
||||||
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setAlerts: (alerts) => dispatch(addAlerts(alerts))
|
setAlerts: (alerts) => dispatch(addAlerts(alerts))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function GlobalFooter() {
|
export function GlobalFooter({ isPartsEntry }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// Canny Not Required on Parts Entry
|
||||||
|
if (isPartsEntry) return;
|
||||||
window.Canny("initChangelog", {
|
window.Canny("initChangelog", {
|
||||||
appID: "680bd2c7ee501290377f6686",
|
appID: "680bd2c7ee501290377f6686",
|
||||||
position: "top",
|
position: "top",
|
||||||
align: "left",
|
align: "left",
|
||||||
theme: "light" // options: light [default], dark, auto
|
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 (
|
return (
|
||||||
<Footer>
|
<Footer>
|
||||||
|
|||||||
@@ -23,12 +23,9 @@ const SimplifiedPartsJobsDetailPage = lazy(
|
|||||||
() => import("../simplified-parts-jobs-detail/simplified-parts-jobs-detail.container.jsx")
|
() => import("../simplified-parts-jobs-detail/simplified-parts-jobs-detail.container.jsx")
|
||||||
);
|
);
|
||||||
const PartsSettingsPage = lazy(() => import("../parts-settings/parts-settings.page.component.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 ShopVendorPageContainer = lazy(() => import("../shop-vendor/shop-vendor.page.container.jsx"));
|
||||||
const EmailOverlayContainer = lazy(() => import("../../components/email-overlay/email-overlay.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 ReportCenterModal = lazy(() => import("../../components/report-center-modal/report-center-modal.container.jsx"));
|
||||||
const Help = lazy(() => import("../help/help.page.jsx"));
|
|
||||||
const PrintCenterModalContainer = lazy(
|
const PrintCenterModalContainer = lazy(
|
||||||
() => import("../../components/print-center-modal/print-center-modal.container")
|
() => import("../../components/print-center-modal/print-center-modal.container")
|
||||||
);
|
);
|
||||||
@@ -108,15 +105,6 @@ export function SimplifiedPartsPage({ conflict, bodyshop, alerts, setAlerts }) {
|
|||||||
}
|
}
|
||||||
}, [alerts, displayedAlertIds, notification]);
|
}, [alerts, displayedAlertIds, notification]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
window.Canny("initChangelog", {
|
|
||||||
appID: "680bd2c7ee501290377f6686",
|
|
||||||
position: "top",
|
|
||||||
align: "left",
|
|
||||||
theme: "light" // options: light [default], dark, auto
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = InstanceRenderManager({
|
document.title = InstanceRenderManager({
|
||||||
imex: t("titles.imexonline"),
|
imex: t("titles.imexonline"),
|
||||||
@@ -166,24 +154,6 @@ export function SimplifiedPartsPage({ conflict, bodyshop, alerts, setAlerts }) {
|
|||||||
</Suspense>
|
</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
|
<Route
|
||||||
path="/parts-settings"
|
path="/parts-settings"
|
||||||
element={
|
element={
|
||||||
|
|||||||
Reference in New Issue
Block a user