Allow for Component Token Overrides.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2023-12-28 17:33:21 -05:00
parent e5d8cc2bea
commit 79dce5d069
57 changed files with 1890 additions and 1861 deletions

View File

@@ -28,13 +28,13 @@ export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoComponent);
export function ShopInfoComponent({bodyshop, form, saveLoading}) {
const { treatments: {CriticalPartsScanning} } = useSplitTreatments({
attributes: {},
names: ["CriticalPartsScanning"],
splitKey: bodyshop.imexshopid,
});
const {treatments: {CriticalPartsScanning}} = useSplitTreatments({
attributes: {},
names: ["CriticalPartsScanning"],
splitKey: bodyshop.imexshopid,
});
const {t} = useTranslation();
const {t} = useTranslation();
const history = useNavigate();
const location = useLocation();
const search = queryString.parse(location.search);
@@ -58,47 +58,63 @@ export function ShopInfoComponent({bodyshop, form, saveLoading}) {
search: `?tab=${search.tab}&subtab=${key}`,
})
}
>
<Tabs.TabPane key="general" tab={t("bodyshop.labels.shopinfo")}>
<ShopInfoGeneral form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="speedprint" tab={t("bodyshop.labels.speedprint")}>
<ShopInfoSpeedPrint form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="rbac" tab={t("bodyshop.labels.rbac")}>
<ShopInfoRbacComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="roStatus" tab={t("bodyshop.labels.jobstatuses")}>
<ShopInfoROStatusComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="scheduling" tab={t("bodyshop.labels.scheduling")}>
<ShopInfoSchedulingComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane
key="orderStatus"
tab={t("bodyshop.labels.orderstatuses")}
>
<ShopInfoOrderStatusComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane
key="responsibilityCenters"
tab={t("bodyshop.labels.responsibilitycenters.title")}
>
<ShopInfoResponsibilityCenterComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="checklists" tab={t("bodyshop.labels.checklists")}>
<ShopInfoIntakeChecklistComponent form={form}/>
</Tabs.TabPane>
<Tabs.TabPane key="laborrates" tab={t("bodyshop.labels.laborrates")}>
<ShopInfoLaborRates form={form}/>
</Tabs.TabPane>
{CriticalPartsScanning.treatment === "on" && (
<Tabs.TabPane key="partsscan" tab={t("bodyshop.labels.partsscan")}>
<ShopInfoPartsScan form={form}/>
</Tabs.TabPane>
)}
</Tabs>
items={[
{
key: "general",
tab: t("bodyshop.labels.shopinfo"),
children: <ShopInfoGeneral form={form}/>,
},
{
key: "speedprint",
tab: t("bodyshop.labels.speedprint"),
children: <ShopInfoSpeedPrint form={form}/>,
},
{
key: "rbac",
tab: t("bodyshop.labels.rbac"),
children: <ShopInfoRbacComponent form={form}/>,
},
{
key: "roStatus",
tab: t("bodyshop.labels.jobstatuses"),
children: <ShopInfoROStatusComponent form={form}/>,
},
{
key: "scheduling",
tab: t("bodyshop.labels.scheduling"),
children: <ShopInfoSchedulingComponent form={form}/>,
},
{
key: "orderStatus",
tab: t("bodyshop.labels.orderstatuses"),
children: <ShopInfoOrderStatusComponent form={form}/>,
},
{
key: "responsibilityCenters",
tab: t("bodyshop.labels.responsibilitycenters.title"),
children: <ShopInfoResponsibilityCenterComponent form={form}/>,
},
{
key: "checklists",
tab: t("bodyshop.labels.checklists"),
children: <ShopInfoIntakeChecklistComponent form={form}/>,
},
{
key: "laborrates",
tab: t("bodyshop.labels.laborrates"),
children: <ShopInfoLaborRates form={form}/>,
},
...(CriticalPartsScanning.treatment === "on"
? [
{
key: "partsscan",
tab: t("bodyshop.labels.partsscan"),
children: <ShopInfoPartsScan form={form}/>,
},
]
: []),
]}
/>
</Card>
);
}