IO-1819 Allow private estimate lines to be modified.
This commit is contained in:
@@ -41,9 +41,10 @@ import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.con
|
||||
import _ from "lodash";
|
||||
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||
import JobLinesExpander from "./job-lines-expander.component";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
jobRO: selectJobReadOnly,
|
||||
technician: selectTechnician,
|
||||
});
|
||||
@@ -56,6 +57,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
|
||||
export function JobLinesComponent({
|
||||
bodyshop,
|
||||
jobRO,
|
||||
technician,
|
||||
setPartsOrderContext,
|
||||
@@ -75,6 +77,14 @@ export function JobLinesComponent({
|
||||
filteredInfo: {},
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
const jobIsPrivate = bodyshop.md_ins_cos.find(
|
||||
(c) => c.name === job.ins_co_nm
|
||||
)?.private;
|
||||
|
||||
console.log(
|
||||
"🚀 ~ file: job-lines.component.jsx ~ line 81 ~ jobIsPrivate",
|
||||
jobIsPrivate
|
||||
);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -286,7 +296,7 @@ export function JobLinesComponent({
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
{record.manual_line && (
|
||||
{(record.manual_line || jobIsPrivate) && (
|
||||
<Space>
|
||||
<Button
|
||||
disabled={jobRO}
|
||||
|
||||
Reference in New Issue
Block a user