From c2aaf8844fe539a32f6c234ffccd126195ecd9ec Mon Sep 17 00:00:00 2001 From: swtmply Date: Fri, 26 May 2023 02:24:34 +0800 Subject: [PATCH] IO-2280 added config anchors --- .../shop-info/shop-info.component.jsx | 13 ++- .../shop-info/shop-info.general.component.jsx | 81 +++++++++++++++---- .../shop-info/shop-info.intake.component.jsx | 10 ++- ...p-info.responsibilitycenters.component.jsx | 33 +++++--- .../shop-info.rostatus.component.jsx | 3 +- .../shop-info.scheduling.component.jsx | 6 +- client/src/pages/shop/shop.page.component.jsx | 10 ++- 7 files changed, 123 insertions(+), 33 deletions(-) diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index 9baeb2c58..efabb6d5b 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -15,6 +15,8 @@ import ShopInfoResponsibilityCenterComponent from "./shop-info.responsibilitycen import ShopInfoROStatusComponent from "./shop-info.rostatus.component"; import ShopInfoSchedulingComponent from "./shop-info.scheduling.component"; import ShopInfoSpeedPrint from "./shop-info.speedprint.component"; +import { useHistory, useLocation } from "react-router-dom"; +import queryString from "query-string"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -31,6 +33,10 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) { bodyshop.imexshopid ); const { t } = useTranslation(); + const history = useHistory(); + const location = useLocation(); + const search = queryString.parse(location.search); + return ( } > - + + history.push({ search: `?tab=${search.tab}&subtab=${key}` }) + } + > diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 35415edf5..416d2f658 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -24,9 +24,13 @@ const timeZonesList = momentTZ.tz.names(); export default function ShopInfoGeneral({ form }) { const { t } = useTranslation(); + return (
- + - + - + - + - + {(fields, { add, remove, move }) => { return ( @@ -720,7 +737,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -785,7 +806,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -839,7 +864,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -935,7 +964,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -1024,7 +1057,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -1106,7 +1143,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -1223,7 +1264,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -1404,7 +1449,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( @@ -1470,7 +1519,11 @@ export default function ShopInfoGeneral({ form }) { }} - + {(fields, { add, remove, move }) => { return ( diff --git a/client/src/components/shop-info/shop-info.intake.component.jsx b/client/src/components/shop-info/shop-info.intake.component.jsx index 4cef5012d..e202dc724 100644 --- a/client/src/components/shop-info/shop-info.intake.component.jsx +++ b/client/src/components/shop-info/shop-info.intake.component.jsx @@ -20,7 +20,10 @@ export default function ShopInfoIntakeChecklistComponent({ form }) { const TemplateListGenerated = TemplateList(); return (
- + {(fields, { add, remove, move }) => { return ( @@ -188,7 +191,10 @@ export default function ShopInfoIntakeChecklistComponent({ form }) { - + {(fields, { add, remove, move }) => { return ( diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index e2e06f98b..9b7f0b0a6 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -95,7 +95,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { {form.getFieldValue("pbs_serialnumber")} )} - )} - + {(fields, { add, remove }) => { return ( @@ -462,6 +464,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { {(fields, { add, remove }) => { @@ -601,7 +604,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { {fields.map((field, index) => (
- + {DmsAp.treatment === "on" && ( - + )} - + - + - AR
}> + AR
} id="AR"> {/* {DmsAp.treatment === "on" && ( - + {/* )} - Refund
}> + Refund} id="refund"> {/* {Qb_Multi_Ar.treatment === "on" && ( - Multiple Payers Item}> + Multiple Payers Item} + id="accountitem" + > {fields.map((field, index) => ( - + + {(fields, { add, remove, move }) => { diff --git a/client/src/components/shop-info/shop-info.scheduling.component.jsx b/client/src/components/shop-info/shop-info.scheduling.component.jsx index 56bf72926..c4160a367 100644 --- a/client/src/components/shop-info/shop-info.scheduling.component.jsx +++ b/client/src/components/shop-info/shop-info.scheduling.component.jsx @@ -92,7 +92,7 @@ export default function ShopInfoSchedulingComponent({ form }) { {t("bodyshop.labels.workingdays")} - + - + {(fields, { add, remove, move }) => { return ( @@ -208,7 +208,7 @@ export default function ShopInfoSchedulingComponent({ form }) { }} - + {(fields, { add, remove, move }) => { return ( diff --git a/client/src/pages/shop/shop.page.component.jsx b/client/src/pages/shop/shop.page.component.jsx index 7c9e4d5b2..47107be43 100644 --- a/client/src/pages/shop/shop.page.component.jsx +++ b/client/src/pages/shop/shop.page.component.jsx @@ -1,5 +1,7 @@ import { Tabs } from "antd"; import React, { useEffect } from "react"; +import { useHistory, useLocation } from "react-router-dom"; +import queryString from "query-string"; import { useTranslation } from "react-i18next"; import ShopEmployeesContainer from "../../components/shop-employees/shop-employees.container"; import ShopInfoContainer from "../../components/shop-info/shop-info.container"; @@ -24,6 +26,9 @@ const mapDispatchToProps = (dispatch) => ({ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { const { t } = useTranslation(); + const history = useHistory(); + const search = queryString.parse(useLocation().search); + useEffect(() => { document.title = t("titles.shop"); setSelectedHeader("shop"); @@ -37,7 +42,10 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { return ( - + history.push({ search: `?tab=${key}` })} + >