feature/IO-3255-simplified-parts-management - Fix top level breadcrumbs, up deps
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { HomeFilled } from "@ant-design/icons";
|
||||
import { Breadcrumb, Col, Row } from "antd";
|
||||
import React from "react";
|
||||
import { selectBreadcrumbs, selectIsPartsEntry } from "../../redux/application/application.selectors";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBreadcrumbs } from "../../redux/application/application.selectors";
|
||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
||||
import GlobalSearch from "../global-search/global-search.component";
|
||||
import GlobalSearchOs from "../global-search/global-search-os.component";
|
||||
@@ -14,10 +13,11 @@ import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
breadcrumbs: selectBreadcrumbs,
|
||||
bodyshop: selectBodyshop,
|
||||
partsManagementOnly: selectPartsManagementOnly
|
||||
partsManagementOnly: selectPartsManagementOnly,
|
||||
isPartsEntry: selectIsPartsEntry
|
||||
});
|
||||
|
||||
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly }) {
|
||||
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly, isPartsEntry }) {
|
||||
const {
|
||||
treatments: { OpenSearch }
|
||||
} = useSplitTreatments({
|
||||
@@ -35,7 +35,7 @@ export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly }) {
|
||||
{
|
||||
key: "home",
|
||||
title: (
|
||||
<Link to={partsManagementOnly ? `/parts/` : `/manage/`}>
|
||||
<Link to={partsManagementOnly || isPartsEntry ? `/parts/` : `/manage/`}>
|
||||
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
||||
</Link>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user