!disabled && setEditing(true)}
>
{jobline.status}
diff --git a/client/src/components/jobs-available-table/jobs-available-table.container.jsx b/client/src/components/jobs-available-table/jobs-available-table.container.jsx
index 01bf3203e..5eef71012 100644
--- a/client/src/components/jobs-available-table/jobs-available-table.container.jsx
+++ b/client/src/components/jobs-available-table/jobs-available-table.container.jsx
@@ -8,7 +8,6 @@ import {
import { Col, notification, Row } from "antd";
import Axios from "axios";
import Dinero from "dinero.js";
-import _ from "lodash";
import moment from "moment";
import queryString from "query-string";
import React, { useCallback, useEffect, useState } from "react";
@@ -187,7 +186,9 @@ export function JobsAvailableContainer({
setJobModalVisible(false);
setInsertLoading(true);
- const estData = replaceEmpty(estDataRaw.data.available_jobs_by_pk);
+
+ const estData = estDataRaw.data.available_jobs_by_pk;
+
if (!(estData && estData.est_data)) {
//We don't have the right data. Error!
setInsertLoading(false);
@@ -196,7 +197,7 @@ export function JobsAvailableContainer({
});
} else {
//create upsert job
- let supp = _.cloneDeep(estData.est_data);
+ let supp = replaceEmpty({ ...estData.est_data });
delete supp.owner;
delete supp.vehicle;
@@ -208,7 +209,7 @@ export function JobsAvailableContainer({
let suppDelta = await GetSupplementDelta(
client,
selectedJob,
- estData.est_data.joblines.data
+ supp.joblines.data
);
delete supp.joblines;
@@ -380,10 +381,10 @@ export default connect(
)(JobsAvailableContainer);
function replaceEmpty(someObj, replaceValue = null) {
- const replacer = (key, value) => (value === "" ? replaceValue : value);
+ const replacer = (key, value) =>
+ value === "" ? replaceValue || null : value;
//^ because you seem to want to replace (strings) "null" or "undefined" too
- console.log(someObj);
const temp = JSON.stringify(someObj, replacer);
- console.log(`temp`, temp);
+ console.log("Parsed", JSON.parse(temp));
return JSON.parse(temp);
}
diff --git a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
index cbdca4501..ede82520d 100644
--- a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
+++ b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
@@ -61,7 +61,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
);
};
- const overlay = (
+ const overlay = bodyshop.cdk_dealerid && (