Merge remote-tracking branch 'origin/feature/IO-2776-cdk-fortellis' into feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration

This commit is contained in:
Dave
2025-11-14 15:22:23 -05:00
18 changed files with 395 additions and 56587 deletions

View File

@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
import { useSplitTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
@@ -18,15 +19,26 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsCdkMakesRefetch);
export function DmsCdkMakesRefetch({ currentUser, bodyshop }) {
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const {
treatments: { Fortellis }
} = useSplitTreatments({
attributes: {},
names: ["Fortellis"],
splitKey: bodyshop.imexshopid
});
if (!currentUser.email.includes("@imex.")) return null;
const handleRefetch = async () => {
setLoading(true);
await axios.post("/cdk/getvehicles", {
cdk_dealerid: bodyshop.cdk_dealerid,
bodyshopid: bodyshop.id
});
try {
setLoading(true);
await axios.post(`cdk${Fortellis.treatment === "on" ? "/fortellis" : ""}/getvehicles`, {
cdk_dealerid: bodyshop.cdk_dealerid,
bodyshopid: bodyshop.id
});
} catch (error) {
console.error(error);
}
setLoading(false);
};

View File

@@ -162,12 +162,12 @@ export default function CdkLikePostForm({ bodyshop, socket, job, logsRef, mode }
<Row gutter={[16, 12]}>
<Col xs={24} sm={12} md={8}>
<Form.Item name="dms_make" label={t("jobs.fields.dms.dms_make")} rules={[{ required: true }]}>
<Input />
<Input disabled />
</Form.Item>
</Col>
<Col xs={24} sm={12} md={8}>
<Form.Item name="dms_model" label={t("jobs.fields.dms.dms_model")} rules={[{ required: true }]}>
<Input />
<Input disabled />
</Form.Item>
</Col>
<Col xs={24} sm={12} md={8}>