feature/IO-3255-simplified-parts-management - Fix top level breadcrumbs, up deps

This commit is contained in:
Dave Richer
2025-08-06 13:34:00 -04:00
parent 567002236d
commit 84795b2048
6 changed files with 29 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
useEffect(() => {
const pathname = window.location.pathname;
const isParts = pathname.startsWith("/parts/") && bodyshop?.external_shop_id;
const isParts = pathname === "/parts" || pathname.startsWith("/parts/") || bodyshop?.external_shop_id;
setIsPartsEntry(isParts);
}, [setIsPartsEntry, bodyshop?.external_shop_id]);

View File

@@ -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>
)

View File

@@ -1,6 +1,6 @@
import { Tabs } from "antd";
import queryString from "query-string";
import React, { useEffect } from "react";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { useLocation, useNavigate } from "react-router-dom";
@@ -8,20 +8,17 @@ import { createStructuredSelector } from "reselect";
import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
import ShopVendorPageComponent from "../shop-vendor/shop-vendor.page.component";
import { setBreadcrumbs, setSelectedHeader } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
import PartsShopInfoContainer from "../../components/parts-shop-info/parts-shop-info.container";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
const mapStateToProps = createStructuredSelector({});
const mapDispatchToProps = (dispatch) => ({
setSelectedHeader: (key) => dispatch(setSelectedHeader(key)),
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs))
});
export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
export function PartsSettingsPage({ setSelectedHeader, setBreadcrumbs }) {
const { t } = useTranslation();
const history = useNavigate();
const search = queryString.parse(useLocation().search);
@@ -53,7 +50,7 @@ export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs
const items = [
{
key: "shop",
label: t("bodyshop.labels.shop_management"),
label: t("bodyshop.labels.parts_shop_management"),
children: (
<RbacWrapper action="shop:config">
<PartsShopInfoContainer />
@@ -62,7 +59,7 @@ export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs
},
{
key: "vendors",
label: t("bodyshop.labels.vendor_management"),
label: t("bodyshop.labels.parts_vendor_management"),
children: (
<RbacWrapper action="shop:vendors">
<ShopVendorPageComponent />

View File

@@ -657,6 +657,8 @@
"zip_post": "Zip/Postal Code"
},
"labels": {
"parts_shop_management": "Shop Management",
"parts_vendor_management": "Vendor Management",
"2tiername": "Name => RO",
"2tiersetup": "2 Tier Setup",
"2tiersource": "Source => RO",
@@ -1259,6 +1261,7 @@
"vehicle": "Vehicle"
},
"labels": {
"settings": "Settings",
"actions": "Actions",
"areyousure": "Are you sure?",
"barcode": "Barcode",
@@ -3526,6 +3529,9 @@
"all_tasks": "All Tasks",
"app": "",
"bc": {
"simplified-parts-jobs": "Jobs",
"parts": "Jobs",
"parts_settings": "Settings",
"accounting-payables": "Payables",
"accounting-payments": "Payments",
"accounting-receivables": "Receivables",

View File

@@ -657,6 +657,8 @@
"zip_post": ""
},
"labels": {
"parts_shop_management": "",
"parts_vendor_management": "",
"2tiername": "",
"2tiersetup": "",
"2tiersource": "",
@@ -1260,6 +1262,7 @@
},
"labels": {
"actions": "Comportamiento",
"settings": "",
"areyousure": "",
"barcode": "código de barras",
"cancel": "",
@@ -3526,6 +3529,9 @@
"all_tasks": "",
"app": "",
"bc": {
"simplified-parts-jobs": "",
"parts": "",
"parts_settings": "",
"accounting-payables": "",
"accounting-payments": "",
"accounting-receivables": "",

View File

@@ -657,6 +657,8 @@
"zip_post": ""
},
"labels": {
"parts_shop_management": "",
"parts_vendor_management": "",
"2tiername": "",
"2tiersetup": "",
"2tiersource": "",
@@ -1259,6 +1261,7 @@
"vehicle": ""
},
"labels": {
"settings": "",
"actions": "actes",
"areyousure": "",
"barcode": "code à barre",
@@ -3526,6 +3529,9 @@
"all_tasks": "",
"app": "",
"bc": {
"simplified-parts-jobs": "",
"parts": "",
"parts_settings": "",
"accounting-payables": "",
"accounting-payments": "",
"accounting-receivables": "",