feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checkpoint

This commit is contained in:
Dave
2025-10-14 13:23:32 -04:00
parent 6bab792b5e
commit 5a9381ebdb
11 changed files with 754 additions and 911 deletions

View File

@@ -23,6 +23,7 @@ import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
import { useSplitTreatments } from "@splitsoftware/splitio-react";
import { useSocket } from "../../contexts/SocketIO/useSocket.js";
import { determineDmsType } from "../../utils/determineDmsType";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
@@ -168,16 +169,21 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type="error" />;
if (!jobId || !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) || bodyshop.rr_dealerid || !data?.jobs_by_pk)
if (!jobId || !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) || !data?.jobs_by_pk)
return <Result status="404" title={t("general.errors.notfound")} />;
if (data.jobs_by_pk && data.jobs_by_pk.date_exported)
return <Result status="warning" title={t("dms.errors.alreadyexported")} />;
if (data.jobs_by_pk?.date_exported) return <Result status="warning" title={t("dms.errors.alreadyexported")} />;
return (
<div>
{Fortellis.treatment === "on" && (
<AlertComponent message="Posting to Fortellis" type="warning" showIcon closable />
<AlertComponent
style={{ marginBottom: 10 }}
message={`Posting to ${determineDmsType(bodyshop)}`}
type="warning"
showIcon
closable
/>
)}
<Row gutter={[16, 16]}>
<Col md={24} lg={10}>
@@ -185,7 +191,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
title={
<span>
<Link to={`/manage/jobs/${data && data.jobs_by_pk.id}`}>{`${
data && data.jobs_by_pk && data.jobs_by_pk.ro_number
data?.jobs_by_pk && data.jobs_by_pk.ro_number
}`}</Link>
{` | ${OwnerNameDisplayFunction(data.jobs_by_pk)} | ${
data.jobs_by_pk.v_model_yr || ""
@@ -197,7 +203,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
/>
</Col>
<Col md={24} lg={14}>
<DmsPostForm socket={socket} jobId={jobId} job={data && data.jobs_by_pk} logsRef={logsRef} />
<DmsPostForm socket={socket} jobId={jobId} job={data?.jobs_by_pk} logsRef={logsRef} />
</Col>
<DmsCustomerSelector jobid={jobId} />