feature/IO-3255-simplified-parts-management - Fix top level breadcrumbs, up deps
This commit is contained in:
@@ -58,7 +58,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const pathname = window.location.pathname;
|
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(isParts);
|
||||||
}, [setIsPartsEntry, bodyshop?.external_shop_id]);
|
}, [setIsPartsEntry, bodyshop?.external_shop_id]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { HomeFilled } from "@ant-design/icons";
|
import { HomeFilled } from "@ant-design/icons";
|
||||||
import { Breadcrumb, Col, Row } from "antd";
|
import { Breadcrumb, Col, Row } from "antd";
|
||||||
import React from "react";
|
import { selectBreadcrumbs, selectIsPartsEntry } from "../../redux/application/application.selectors";
|
||||||
import { connect } from "react-redux";
|
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 { selectBodyshop, selectPartsManagementOnly } 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";
|
||||||
@@ -14,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
|
partsManagementOnly: selectPartsManagementOnly,
|
||||||
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly }) {
|
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly, isPartsEntry }) {
|
||||||
const {
|
const {
|
||||||
treatments: { OpenSearch }
|
treatments: { OpenSearch }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
@@ -35,7 +35,7 @@ export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly }) {
|
|||||||
{
|
{
|
||||||
key: "home",
|
key: "home",
|
||||||
title: (
|
title: (
|
||||||
<Link to={partsManagementOnly ? `/parts/` : `/manage/`}>
|
<Link to={partsManagementOnly || isPartsEntry ? `/parts/` : `/manage/`}>
|
||||||
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Tabs } from "antd";
|
import { Tabs } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
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 RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
|
||||||
import ShopVendorPageComponent from "../shop-vendor/shop-vendor.page.component";
|
import ShopVendorPageComponent from "../shop-vendor/shop-vendor.page.component";
|
||||||
import { setBreadcrumbs, setSelectedHeader } from "../../redux/application/application.actions";
|
import { setBreadcrumbs, setSelectedHeader } from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
import PartsShopInfoContainer from "../../components/parts-shop-info/parts-shop-info.container";
|
import PartsShopInfoContainer from "../../components/parts-shop-info/parts-shop-info.container";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({});
|
||||||
bodyshop: selectBodyshop
|
|
||||||
});
|
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setSelectedHeader: (key) => dispatch(setSelectedHeader(key)),
|
setSelectedHeader: (key) => dispatch(setSelectedHeader(key)),
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs))
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
|
export function PartsSettingsPage({ setSelectedHeader, setBreadcrumbs }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useNavigate();
|
const history = useNavigate();
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
@@ -53,7 +50,7 @@ export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs
|
|||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
key: "shop",
|
key: "shop",
|
||||||
label: t("bodyshop.labels.shop_management"),
|
label: t("bodyshop.labels.parts_shop_management"),
|
||||||
children: (
|
children: (
|
||||||
<RbacWrapper action="shop:config">
|
<RbacWrapper action="shop:config">
|
||||||
<PartsShopInfoContainer />
|
<PartsShopInfoContainer />
|
||||||
@@ -62,7 +59,7 @@ export function PartsSettingsPage({ bodyshop, setSelectedHeader, setBreadcrumbs
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "vendors",
|
key: "vendors",
|
||||||
label: t("bodyshop.labels.vendor_management"),
|
label: t("bodyshop.labels.parts_vendor_management"),
|
||||||
children: (
|
children: (
|
||||||
<RbacWrapper action="shop:vendors">
|
<RbacWrapper action="shop:vendors">
|
||||||
<ShopVendorPageComponent />
|
<ShopVendorPageComponent />
|
||||||
|
|||||||
@@ -657,6 +657,8 @@
|
|||||||
"zip_post": "Zip/Postal Code"
|
"zip_post": "Zip/Postal Code"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"parts_shop_management": "Shop Management",
|
||||||
|
"parts_vendor_management": "Vendor Management",
|
||||||
"2tiername": "Name => RO",
|
"2tiername": "Name => RO",
|
||||||
"2tiersetup": "2 Tier Setup",
|
"2tiersetup": "2 Tier Setup",
|
||||||
"2tiersource": "Source => RO",
|
"2tiersource": "Source => RO",
|
||||||
@@ -1259,6 +1261,7 @@
|
|||||||
"vehicle": "Vehicle"
|
"vehicle": "Vehicle"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"settings": "Settings",
|
||||||
"actions": "Actions",
|
"actions": "Actions",
|
||||||
"areyousure": "Are you sure?",
|
"areyousure": "Are you sure?",
|
||||||
"barcode": "Barcode",
|
"barcode": "Barcode",
|
||||||
@@ -3526,6 +3529,9 @@
|
|||||||
"all_tasks": "All Tasks",
|
"all_tasks": "All Tasks",
|
||||||
"app": "",
|
"app": "",
|
||||||
"bc": {
|
"bc": {
|
||||||
|
"simplified-parts-jobs": "Jobs",
|
||||||
|
"parts": "Jobs",
|
||||||
|
"parts_settings": "Settings",
|
||||||
"accounting-payables": "Payables",
|
"accounting-payables": "Payables",
|
||||||
"accounting-payments": "Payments",
|
"accounting-payments": "Payments",
|
||||||
"accounting-receivables": "Receivables",
|
"accounting-receivables": "Receivables",
|
||||||
|
|||||||
@@ -657,6 +657,8 @@
|
|||||||
"zip_post": ""
|
"zip_post": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"parts_shop_management": "",
|
||||||
|
"parts_vendor_management": "",
|
||||||
"2tiername": "",
|
"2tiername": "",
|
||||||
"2tiersetup": "",
|
"2tiersetup": "",
|
||||||
"2tiersource": "",
|
"2tiersource": "",
|
||||||
@@ -1260,6 +1262,7 @@
|
|||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": "Comportamiento",
|
"actions": "Comportamiento",
|
||||||
|
"settings": "",
|
||||||
"areyousure": "",
|
"areyousure": "",
|
||||||
"barcode": "código de barras",
|
"barcode": "código de barras",
|
||||||
"cancel": "",
|
"cancel": "",
|
||||||
@@ -3526,6 +3529,9 @@
|
|||||||
"all_tasks": "",
|
"all_tasks": "",
|
||||||
"app": "",
|
"app": "",
|
||||||
"bc": {
|
"bc": {
|
||||||
|
"simplified-parts-jobs": "",
|
||||||
|
"parts": "",
|
||||||
|
"parts_settings": "",
|
||||||
"accounting-payables": "",
|
"accounting-payables": "",
|
||||||
"accounting-payments": "",
|
"accounting-payments": "",
|
||||||
"accounting-receivables": "",
|
"accounting-receivables": "",
|
||||||
|
|||||||
@@ -657,6 +657,8 @@
|
|||||||
"zip_post": ""
|
"zip_post": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"parts_shop_management": "",
|
||||||
|
"parts_vendor_management": "",
|
||||||
"2tiername": "",
|
"2tiername": "",
|
||||||
"2tiersetup": "",
|
"2tiersetup": "",
|
||||||
"2tiersource": "",
|
"2tiersource": "",
|
||||||
@@ -1259,6 +1261,7 @@
|
|||||||
"vehicle": ""
|
"vehicle": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
|
"settings": "",
|
||||||
"actions": "actes",
|
"actions": "actes",
|
||||||
"areyousure": "",
|
"areyousure": "",
|
||||||
"barcode": "code à barre",
|
"barcode": "code à barre",
|
||||||
@@ -3526,6 +3529,9 @@
|
|||||||
"all_tasks": "",
|
"all_tasks": "",
|
||||||
"app": "",
|
"app": "",
|
||||||
"bc": {
|
"bc": {
|
||||||
|
"simplified-parts-jobs": "",
|
||||||
|
"parts": "",
|
||||||
|
"parts_settings": "",
|
||||||
"accounting-payables": "",
|
"accounting-payables": "",
|
||||||
"accounting-payments": "",
|
"accounting-payments": "",
|
||||||
"accounting-receivables": "",
|
"accounting-receivables": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user