From 2de605e520aebd78910af31f7e7d1114b13cc473 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Mar 2026 16:37:03 -0400 Subject: [PATCH] IO-3624 Refine Rome responsibility center tax layout --- ...p-info.responsibilitycenters.component.jsx | 8 +- ....responsibilitycenters.taxes.component.jsx | 391 ++++++++++-------- ...fo.responsibilitycenters.taxes.styles.scss | 25 ++ .../shop-intellipay-config.component.jsx | 8 +- client/src/translations/en_us/common.json | 10 + client/src/translations/es/common.json | 10 + client/src/translations/fr/common.json | 10 + 7 files changed, 282 insertions(+), 180 deletions(-) create mode 100644 client/src/components/shop-info/shop-info.responsibilitycenters.taxes.styles.scss 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 f88b3f059..0a2fa27ca 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -3316,22 +3316,22 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { <> {InstanceRenderManager({ rome: ( - <> + - + ) })} AR} id="AR"> diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.component.jsx index a947f7d1c..cfa0f589d 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.component.jsx @@ -1,4 +1,4 @@ -import { Collapse, Divider, Form, Input, InputNumber, Space, Switch } from "antd"; +import { Col, Collapse, Form, Input, InputNumber, Row, Switch } from "antd"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; @@ -6,6 +6,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors"; import InstanceRenderManager from "../../utils/instanceRenderMgr"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js"; +import "./shop-info.responsibilitycenters.taxes.styles.scss"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser @@ -16,47 +17,96 @@ const mapDispatchToProps = () => ({ }); export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoResponsibilityCenters); +const taxRootColProps = { + xs: 24, + sm: 12, + md: 8, + lg: { flex: "0 0 280px" }, + xl: { flex: "0 0 240px" }, + xxl: { flex: "0 0 300px" } +}; + +const taxTierFieldColProps = { + xs: 24, + sm: 12, + lg: 6 +}; + export function ShopInfoResponsibilityCenters({ bodyshop, form }) { const { t } = useTranslation(); - //Iteratively build the form items. - const formItems = []; - for (let tyCounter = 1; tyCounter <= 5; tyCounter++) { - const section = []; + const profileTaxCards = []; + for (let typeNum = 1; typeNum <= 5; typeNum++) { + const rootTaxItems = getRootTaxFormItems({ typeNum, bodyshop, t }); - section.push( - TaxFormItems({ - typeNum: tyCounter, - rootElements: true, - bodyshop - }) + profileTaxCards.push( + +
+ + {rootTaxItems.map((item, index) => ( + + {item} + + ))} + + + {Array.from({ length: 5 }, (_, index) => { + const typeNumIterator = index + 1; + const tierTaxItems = getTierTaxFormItems({ + typeNum, + typeNumIterator, + t + }); + + return ( + + + + {tierTaxItems.map((item, tierIndex) => ( + + {item} + + ))} + + + + ); + })} + +
+
); - for (let iterator = 1; iterator <= 5; iterator++) { - section.push( - TaxFormItems({ - typeNum: tyCounter, - typeNumIterator: iterator, - rootElements: false - }) - ); - } - formItems.push({section}); - formItems.push(); } + return ( <> - - {t("jobs.labels.cieca_pft")} - - {formItems} + +
{profileTaxCards}
+
- + + - - ) - }, - { - key: "cieca_pfo", - label: t("jobs.labels.cieca_pfo"), - forceRender: true, - children: ( - <> + + ) + }, + { + key: "cieca_pfo", + label: t("jobs.labels.cieca_pfo"), + forceRender: true, + children: ( + <> - - ) - } - ]} - /> + + ) + } + ]} + /> + ); } -function TaxFormItems({ typeNum, typeNumIterator, rootElements, bodyshop }) { - const { t } = useTranslation(); - - if (rootElements) - return ( - <> - - - - - - - - - - - - - - - {bodyshopHasDmsKey(bodyshop) && ( +function getRootTaxFormItems({ typeNum, bodyshop, t }) { + return [ + + + , + + + , + + + , + + + , + ...(bodyshopHasDmsKey(bodyshop) + ? [ - )} - - ); - return ( - <> - - - - - - - - - - - - - - ); + ] + : []) + ]; +} + +function getTierTaxFormItems({ typeNum, typeNumIterator, t }) { + return [ + + + , + + + , + + + , + + + + ]; } diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.styles.scss b/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.styles.scss new file mode 100644 index 000000000..5cbfe7f95 --- /dev/null +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.taxes.styles.scss @@ -0,0 +1,25 @@ +.responsibility-centers-tax-tier-grid__col.ant-col { + flex: 0 0 100%; + max-width: 100%; +} + +@media (min-width: 992px) { + .responsibility-centers-tax-tier-grid__col.ant-col { + flex: 0 0 50%; + max-width: 50%; + } +} + +@media (min-width: 1600px) { + .responsibility-centers-tax-tier-grid__col.ant-col { + flex: 0 0 25%; + max-width: 25%; + } +} + +@media (min-width: 2400px) { + .responsibility-centers-tax-tier-grid__col.ant-col { + flex: 0 0 20%; + max-width: 20%; + } +} diff --git a/client/src/components/shop-info/shop-intellipay-config.component.jsx b/client/src/components/shop-info/shop-intellipay-config.component.jsx index 60b4fabef..7503c8ca9 100644 --- a/client/src/components/shop-info/shop-intellipay-config.component.jsx +++ b/client/src/components/shop-info/shop-intellipay-config.component.jsx @@ -5,6 +5,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import InstanceRenderManager from "../../utils/instanceRenderMgr"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -29,7 +30,12 @@ export function ShopInfoIntellipay({ bodyshop, form }) { }} - +