WIP Fortellis.

This commit is contained in:
Patrick Fic
2025-04-25 11:58:38 -07:00
parent e2b4b408ed
commit 19ce1c66ad
7 changed files with 895 additions and 414 deletions

View File

@@ -17,7 +17,7 @@ const mapDispatchToProps = (dispatch) => ({
});
export default connect(mapStateToProps, mapDispatchToProps)(DmsCustomerSelector);
export function DmsCustomerSelector({ bodyshop }) {
export function DmsCustomerSelector({ bodyshop, jobid }) {
const { t } = useTranslation();
const [customerList, setcustomerList] = useState([]);
const [open, setOpen] = useState(false);
@@ -38,7 +38,7 @@ export function DmsCustomerSelector({ bodyshop }) {
if (Fortellis.treatment === "on") {
const handleFortellisSelectCustomer = (customerList, callback) => {
setOpen(true);
setDmsType("fortellis");
setDmsType("cdk");
setcustomerList(customerList);
};
wsssocket.on("fortellis-select-customer", handleFortellisSelectCustomer);
@@ -67,7 +67,11 @@ export function DmsCustomerSelector({ bodyshop }) {
const onUseSelected = () => {
setOpen(false);
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
if (Fortellis.treatment === "on") {
wsssocket.emit(`fortellis-selected-customer`, { selectedCustomerId: selectedCustomer, jobid });
} else {
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
}
setSelectedCustomer(null);
};