IO-3255 Fix breadcrumb path.
This commit is contained in:
@@ -5,7 +5,7 @@ import { connect } from "react-redux";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBreadcrumbs } from "../../redux/application/application.selectors";
|
import { selectBreadcrumbs } from "../../redux/application/application.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
||||||
import GlobalSearch from "../global-search/global-search.component";
|
import GlobalSearch from "../global-search/global-search.component";
|
||||||
import GlobalSearchOs from "../global-search/global-search-os.component";
|
import GlobalSearchOs from "../global-search/global-search-os.component";
|
||||||
import "./breadcrumbs.styles.scss";
|
import "./breadcrumbs.styles.scss";
|
||||||
@@ -13,10 +13,11 @@ import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
|||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
breadcrumbs: selectBreadcrumbs,
|
breadcrumbs: selectBreadcrumbs,
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop,
|
||||||
|
partsManagementOnly: selectPartsManagementOnly
|
||||||
});
|
});
|
||||||
|
|
||||||
export function BreadCrumbs({ breadcrumbs, bodyshop }) {
|
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly }) {
|
||||||
const {
|
const {
|
||||||
treatments: { OpenSearch }
|
treatments: { OpenSearch }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
@@ -34,7 +35,7 @@ export function BreadCrumbs({ breadcrumbs, bodyshop }) {
|
|||||||
{
|
{
|
||||||
key: "home",
|
key: "home",
|
||||||
title: (
|
title: (
|
||||||
<Link to={`/manage/`}>
|
<Link to={partsManagementOnly ? `/parts/` : `/manage/`}>
|
||||||
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user