feature/IO-3255-simplified-parts-management - Bug Fixes
This commit is contained in:
@@ -220,7 +220,7 @@ export function SimplifiedPartsJobsListComponent({
|
||||
<RbacWrapper action="shop:config">
|
||||
<Button
|
||||
icon={<SettingOutlined />}
|
||||
onClick={() => history("/parts/parts-settings")}
|
||||
onClick={() => history("/parts/settings")}
|
||||
title={t("general.labels.settings")}
|
||||
>
|
||||
{t("general.labels.settings")}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { FloatButton, Layout, Spin } from "antd";
|
||||
import { Route, Routes, useNavigate } from "react-router-dom";
|
||||
|
||||
// import preval from "preval.macro";
|
||||
import { lazy, Suspense, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import BreadCrumbs from "../../components/breadcrumbs/breadcrumbs.component";
|
||||
import ChatAffixContainer from "../../components/chat-affix/chat-affix.container";
|
||||
@@ -20,7 +20,7 @@ import LoadingSpinner from "../../components/loading-spinner/loading-spinner.com
|
||||
import PartnerPingComponent from "../../components/partner-ping/partner-ping.component";
|
||||
import ShopSubStatusComponent from "../../components/shop-sub-status/shop-sub-status.component";
|
||||
import UpdateAlert from "../../components/update-alert/update-alert.component";
|
||||
import { selectBodyshop, selectInstanceConflict } from "../../redux/user/user.selectors";
|
||||
import { selectBodyshop, selectInstanceConflict, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr.js";
|
||||
import useAlertsNotifications from "../../hooks/useAlertsNotifications.jsx";
|
||||
|
||||
@@ -106,12 +106,14 @@ const { Content } = Layout;
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
conflict: selectInstanceConflict,
|
||||
bodyshop: selectBodyshop
|
||||
bodyshop: selectBodyshop,
|
||||
partsManagementOnly: selectPartsManagementOnly
|
||||
});
|
||||
|
||||
export function Manage({ conflict, bodyshop }) {
|
||||
export function Manage({ conflict, bodyshop, partsManagementOnly }) {
|
||||
const { t } = useTranslation();
|
||||
const [chatVisible] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
// Centralized alerts handling (fetch + dedupe + notifications)
|
||||
useAlertsNotifications();
|
||||
@@ -132,6 +134,12 @@ export function Manage({ conflict, bodyshop }) {
|
||||
});
|
||||
}, [t]);
|
||||
|
||||
if (partsManagementOnly) {
|
||||
// This NEEDS to be done this way, DO NOT use the react router, it will cause a ton of side effects
|
||||
window.location = "/parts";
|
||||
return null; // Prevent further rendering
|
||||
}
|
||||
|
||||
const AppRouteTable = (
|
||||
<Suspense
|
||||
fallback={
|
||||
|
||||
@@ -30,7 +30,7 @@ export function PartsSettingsPage({ setSelectedHeader, setBreadcrumbs }) {
|
||||
rome: "$t(titles.romeonline)"
|
||||
})
|
||||
});
|
||||
setSelectedHeader("parts-settings");
|
||||
setSelectedHeader("settings");
|
||||
setBreadcrumbs([
|
||||
{
|
||||
link: "/parts",
|
||||
|
||||
@@ -108,7 +108,7 @@ export function SimplifiedPartsPage({ conflict, bodyshop }) {
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/parts-settings"
|
||||
path="/settings"
|
||||
element={
|
||||
<Suspense fallback={<Spin />}>
|
||||
<PartsSettingsPage />
|
||||
|
||||
@@ -401,12 +401,11 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
||||
window.$zoho.salesiq.visitor.info({ "Shop Name": payload.shopname });
|
||||
}
|
||||
});
|
||||
|
||||
// Set whether it is for parts management only
|
||||
yield put(setPartsManagementOnly(payload.features.partsManagementOnly));
|
||||
} catch (error) {
|
||||
console.warn("Couldnt find $crisp.", error.message);
|
||||
}
|
||||
|
||||
yield put(setPartsManagementOnly(payload.features.partsManagementOnly));
|
||||
} catch (error) {
|
||||
yield put(signInFailure(error.message));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user