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 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>
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user