feature/IO-3624-Shop-Config-UX-Refresh - DMS Sections

This commit is contained in:
Dave
2026-03-24 17:45:42 -04:00
parent 591439b79c
commit 1102670e66
4 changed files with 1557 additions and 1512 deletions

View File

@@ -400,10 +400,13 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
]} ]}
</LayoutFormRow> </LayoutFormRow>
{hasDMSKey && ( {hasDMSKey && (
<> <LayoutFormRow header={t("bodyshop.labels.dms_setup")} id="dms_setup">
<div>
<LayoutFormRow id="dmsconfiguration" grow={true}> <LayoutFormRow id="dmsconfiguration" grow={true}>
{bodyshop.rr_dealerid && ( {bodyshop.rr_dealerid && (
<DataLabel label={t("bodyshop.labels.dms.rr_dealerid")}>{form.getFieldValue("rr_dealerid")}</DataLabel> <DataLabel label={t("bodyshop.labels.dms.rr_dealerid")}>
{form.getFieldValue("rr_dealerid")}
</DataLabel>
)} )}
{bodyshop.cdk_dealerid && ( {bodyshop.cdk_dealerid && (
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}> <DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>
@@ -645,7 +648,8 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
</LayoutFormRow> </LayoutFormRow>
</> </>
)} )}
</> </div>
</LayoutFormRow>
)} )}
{HasFeatureAccess({ featureName: "export", bodyshop }) && ( {HasFeatureAccess({ featureName: "export", bodyshop }) && (
<> <>
@@ -919,10 +923,33 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{(fields, { add, remove }) => { {(fields, { add, remove }) => {
return ( return (
<div> <div>
{fields.map((field, index) => ( {fields.map((field, index) => {
const dmsDefault = form.getFieldValue([
"md_responsibility_centers",
"dms_defaults",
field.name
]) || { name: undefined };
return (
<Form.Item key={field.key}> <Form.Item key={field.key}>
<LayoutFormRow
title={getFormListItemTitle(
t("bodyshop.fields.dms.mappingname"),
index,
dmsDefault.name
)}
extra={
<Button
type="text"
icon={<DeleteFilled />}
onClick={() => {
remove(field.name);
}}
/>
}
>
<div> <div>
<LayoutFormRow id="mappingname" noDivider={index > 0 ? false : true}> <LayoutFormRow noDivider>
<Form.Item <Form.Item
label={t("bodyshop.fields.dms.mappingname")} label={t("bodyshop.fields.dms.mappingname")}
key={`${index}name`} key={`${index}name`}
@@ -937,13 +964,8 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
> >
<Input /> <Input />
</Form.Item> </Form.Item>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
</LayoutFormRow> </LayoutFormRow>
<LayoutFormRow header={t("bodyshop.labels.dms.costsmapping")} id="costsmapping"> <LayoutFormRow header={t("bodyshop.labels.dms.costsmapping")}>
<Form.Item <Form.Item
label={t("bodyshop.fields.responsibilitycenters.ats")} label={t("bodyshop.fields.responsibilitycenters.ats")}
rules={[ rules={[
@@ -1554,7 +1576,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
/> />
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>
<LayoutFormRow header={t("bodyshop.labels.dms.profitsmapping")} id="profitsmapping"> <LayoutFormRow header={t("bodyshop.labels.dms.profitsmapping")}>
<Form.Item <Form.Item
label={t("bodyshop.fields.responsibilitycenters.ats")} label={t("bodyshop.fields.responsibilitycenters.ats")}
rules={[ rules={[
@@ -2166,8 +2188,10 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
</Form.Item> </Form.Item>
</LayoutFormRow> </LayoutFormRow>
</div> </div>
</LayoutFormRow>
</Form.Item> </Form.Item>
))} );
})}
<Form.Item> <Form.Item>
<Button <Button
type="dashed" type="dashed"
@@ -3434,9 +3458,31 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{(fields, { add, remove }) => { {(fields, { add, remove }) => {
return ( return (
<div> <div>
{fields.map((field, index) => ( {fields.map((field, index) => {
const salesTaxCode =
form.getFieldValue(["md_responsibility_centers", "sales_tax_codes", field.name]) || {};
return (
<Form.Item key={field.key}> <Form.Item key={field.key}>
<LayoutFormRow id="sales_tax_codes" noDivider={index > 0 ? false : true}> <LayoutFormRow
id="sales_tax_codes"
noDivider
title={getFormListItemTitle(
t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description"),
index,
salesTaxCode.description,
salesTaxCode.code
)}
extra={
<Button
type="text"
icon={<DeleteFilled />}
onClick={() => {
remove(field.name);
}}
/>
}
>
<Form.Item <Form.Item
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description")} label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description")}
key={`${index}description`} key={`${index}description`}
@@ -3477,14 +3523,10 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
> >
<Switch /> <Switch />
</Form.Item> </Form.Item>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
</LayoutFormRow> </LayoutFormRow>
</Form.Item> </Form.Item>
))} );
})}
<Form.Item> <Form.Item>
<Button <Button
type="dashed" type="dashed"

View File

@@ -723,6 +723,7 @@
"customtemplates": "Custom Templates", "customtemplates": "Custom Templates",
"defaultcostsmapping": "Default Costs Mapping", "defaultcostsmapping": "Default Costs Mapping",
"defaultprofitsmapping": "Default Profits Mapping", "defaultprofitsmapping": "Default Profits Mapping",
"dms_setup": "DMS Setup",
"deliverchecklist": "Delivery Checklist", "deliverchecklist": "Delivery Checklist",
"dms": { "dms": {
"cdk": { "cdk": {

View File

@@ -723,6 +723,7 @@
"customtemplates": "", "customtemplates": "",
"defaultcostsmapping": "", "defaultcostsmapping": "",
"defaultprofitsmapping": "", "defaultprofitsmapping": "",
"dms_setup": "",
"deliverchecklist": "", "deliverchecklist": "",
"dms": { "dms": {
"cdk": { "cdk": {

View File

@@ -723,6 +723,7 @@
"customtemplates": "", "customtemplates": "",
"defaultcostsmapping": "", "defaultcostsmapping": "",
"defaultprofitsmapping": "", "defaultprofitsmapping": "",
"dms_setup": "",
"deliverchecklist": "", "deliverchecklist": "",
"dms": { "dms": {
"cdk": { "cdk": {