feature/IO-3255-simplified-parts-management - Favor isPartsEntry over isPartsManagementOnly
This commit is contained in:
@@ -4,7 +4,7 @@ import { selectBreadcrumbs, selectIsPartsEntry } from "../../redux/application/a
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import GlobalSearch from "../global-search/global-search.component";
|
import GlobalSearch from "../global-search/global-search.component";
|
||||||
import GlobalSearchOs from "../global-search/global-search-os.component";
|
import GlobalSearchOs from "../global-search/global-search-os.component";
|
||||||
import "./breadcrumbs.styles.scss";
|
import "./breadcrumbs.styles.scss";
|
||||||
@@ -13,11 +13,10 @@ import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
breadcrumbs: selectBreadcrumbs,
|
breadcrumbs: selectBreadcrumbs,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
partsManagementOnly: selectPartsManagementOnly,
|
|
||||||
isPartsEntry: selectIsPartsEntry
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly, isPartsEntry }) {
|
export function BreadCrumbs({ breadcrumbs, bodyshop, isPartsEntry }) {
|
||||||
const {
|
const {
|
||||||
treatments: { OpenSearch }
|
treatments: { OpenSearch }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
@@ -35,7 +34,7 @@ export function BreadCrumbs({ breadcrumbs, bodyshop, partsManagementOnly, isPart
|
|||||||
{
|
{
|
||||||
key: "home",
|
key: "home",
|
||||||
title: (
|
title: (
|
||||||
<Link to={partsManagementOnly || isPartsEntry ? `/parts/` : `/manage/`}>
|
<Link to={isPartsEntry ? `/parts/` : `/manage/`}>
|
||||||
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
<HomeFilled /> {(bodyshop && bodyshop.shopname && `(${bodyshop.shopname})`) || ""}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { DELETE_JOB_LINE_BY_PK } from "../../graphql/jobs-lines.queries";
|
import { DELETE_JOB_LINE_BY_PK } from "../../graphql/jobs-lines.queries";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
@@ -32,7 +32,7 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re
|
|||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { FaTasks } from "react-icons/fa";
|
import { FaTasks } from "react-icons/fa";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
@@ -51,7 +51,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
partsManagementOnly: selectPartsManagementOnly
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -78,10 +78,8 @@ export function JobLinesComponent({
|
|||||||
setBillEnterContext,
|
setBillEnterContext,
|
||||||
setTaskUpsertContext,
|
setTaskUpsertContext,
|
||||||
billsQuery,
|
billsQuery,
|
||||||
handleBillOnRowClick,
|
|
||||||
handlePartsOrderOnRowClick,
|
handlePartsOrderOnRowClick,
|
||||||
handlePartsDispatchOnRowClick,
|
isPartsEntry
|
||||||
partsManagementOnly
|
|
||||||
}) {
|
}) {
|
||||||
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
||||||
const {
|
const {
|
||||||
@@ -96,7 +94,7 @@ export function JobLinesComponent({
|
|||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
filteredInfo: {
|
filteredInfo: {
|
||||||
...(partsManagementOnly
|
...(isPartsEntry
|
||||||
? {
|
? {
|
||||||
part_type: ["PAN", "PAC", "PAR", "PAL", "PAA", "PAM", "PAP", "PAS", "PASL", "PAG"]
|
part_type: ["PAN", "PAC", "PAR", "PAL", "PAA", "PAM", "PAP", "PAS", "PASL", "PAG"]
|
||||||
}
|
}
|
||||||
@@ -229,7 +227,7 @@ export function JobLinesComponent({
|
|||||||
sorter: (a, b) => a.part_qty - b.part_qty,
|
sorter: (a, b) => a.part_qty - b.part_qty,
|
||||||
sortOrder: state.sortedInfo.columnKey === "part_qty" && state.sortedInfo.order
|
sortOrder: state.sortedInfo.columnKey === "part_qty" && state.sortedInfo.order
|
||||||
},
|
},
|
||||||
...(!partsManagementOnly
|
...(!isPartsEntry
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.mod_lbr_ty"),
|
title: t("joblines.fields.mod_lbr_ty"),
|
||||||
@@ -281,7 +279,7 @@ export function JobLinesComponent({
|
|||||||
key: "location",
|
key: "location",
|
||||||
render: (text, record) => <JobLineLocationPopup jobline={record} disabled={jobRO} />
|
render: (text, record) => <JobLineLocationPopup jobline={record} disabled={jobRO} />
|
||||||
},
|
},
|
||||||
...(!partsManagementOnly && HasFeatureAccess({ featureName: "bills", bodyshop })
|
...(!isPartsEntry && HasFeatureAccess({ featureName: "bills", bodyshop })
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: t("joblines.labels.billref"),
|
title: t("joblines.labels.billref"),
|
||||||
@@ -315,7 +313,7 @@ export function JobLinesComponent({
|
|||||||
onFilter: (value, record) => value.includes(record.status),
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
render: (text, record) => <JobLineStatusPopup jobline={record} disabled={jobRO} />
|
render: (text, record) => <JobLineStatusPopup jobline={record} disabled={jobRO} />
|
||||||
},
|
},
|
||||||
...!partsManagementOnly
|
...(!isPartsEntry
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: t("general.labels.actions"),
|
title: t("general.labels.actions"),
|
||||||
@@ -382,7 +380,7 @@ export function JobLinesComponent({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
: []
|
: [])
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
@@ -555,7 +553,7 @@ export function JobLinesComponent({
|
|||||||
<Dropdown menu={markMenu} trigger={["click"]}>
|
<Dropdown menu={markMenu} trigger={["click"]}>
|
||||||
<Button id="repair-data-mark-button">{t("jobs.actions.mark")}</Button>
|
<Button id="repair-data-mark-button">{t("jobs.actions.mark")}</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<Button
|
<Button
|
||||||
disabled={jobRO || technician}
|
disabled={jobRO || technician}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -592,12 +590,12 @@ export function JobLinesComponent({
|
|||||||
}}
|
}}
|
||||||
expandable={{
|
expandable={{
|
||||||
expandedRowRender: (record) =>
|
expandedRowRender: (record) =>
|
||||||
partsManagementOnly ? (
|
isPartsEntry ? (
|
||||||
<JobLinesExpanderSimple jobline={record} jobid={job.id} />
|
<JobLinesExpanderSimple jobline={record} jobid={job.id} />
|
||||||
) : (
|
) : (
|
||||||
<JobLinesExpander jobline={record} jobid={job.id} />
|
<JobLinesExpander jobline={record} jobid={job.id} />
|
||||||
),
|
),
|
||||||
rowExpandable: (record) => true,
|
rowExpandable: () => true,
|
||||||
//expandRowByClick: true,
|
//expandRowByClick: true,
|
||||||
expandIcon: ({ expanded, onExpand, record }) =>
|
expandIcon: ({ expanded, onExpand, record }) =>
|
||||||
expanded ? (
|
expanded ? (
|
||||||
@@ -606,9 +604,9 @@ export function JobLinesComponent({
|
|||||||
<PlusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
<PlusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record) => {
|
||||||
return {
|
return {
|
||||||
onDoubleClick: (event) => {
|
onDoubleClick: () => {
|
||||||
const notMatchingLines = selectedLines.filter((i) => i.id !== record.id);
|
const notMatchingLines = selectedLines.filter((i) => i.id !== record.id);
|
||||||
notMatchingLines.length !== selectedLines.length
|
notMatchingLines.length !== selectedLines.length
|
||||||
? setSelectedLines(notMatchingLines)
|
? setSelectedLines(notMatchingLines)
|
||||||
@@ -618,10 +616,10 @@ export function JobLinesComponent({
|
|||||||
}}
|
}}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
selectedRowKeys: selectedLines.map((item) => item && item.id),
|
selectedRowKeys: selectedLines.map((item) => item && item.id),
|
||||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
onSelectAll: (selected, selectedRows) => {
|
||||||
setSelectedLines(selectedRows);
|
setSelectedLines(selectedRows);
|
||||||
},
|
},
|
||||||
onSelect: (record, selected, selectedRows, nativeEvent) => {
|
onSelect: (record, selected) => {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
setSelectedLines((selectedLines) => _.uniqBy([...selectedLines, record], "id"));
|
setSelectedLines((selectedLines) => _.uniqBy([...selectedLines, record], "id"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
|||||||
import { insertAuditTrail } from "../../redux/application/application.actions.js";
|
import { insertAuditTrail } from "../../redux/application/application.actions.js";
|
||||||
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings.js";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings.js";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateTimeFormatter, DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
import { DateTimeFormatter, DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
||||||
@@ -32,7 +32,6 @@ import "./jobs-detail-header.styles.scss";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
partsManagementOnly: selectPartsManagementOnly,
|
|
||||||
isPartsEntry: selectIsPartsEntry
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -54,7 +53,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, partsManagementOnly, isPartsEntry }) {
|
export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, isPartsEntry }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { notification } = useNotification();
|
const { notification } = useNotification();
|
||||||
const [notesClamped, setNotesClamped] = useState(true);
|
const [notesClamped, setNotesClamped] = useState(true);
|
||||||
@@ -64,9 +63,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, pa
|
|||||||
const colSpan = {
|
const colSpan = {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 24 },
|
sm: { span: 24 },
|
||||||
md: { span: partsManagementOnly ? 8 : 12 },
|
md: { span: isPartsEntry ? 8 : 12 },
|
||||||
lg: { span: partsManagementOnly ? 8 : 6 },
|
lg: { span: isPartsEntry ? 8 : 6 },
|
||||||
xl: { span: partsManagementOnly ? 8 : 6 }
|
xl: { span: isPartsEntry ? 8 : 6 }
|
||||||
};
|
};
|
||||||
|
|
||||||
const vehicleTitle =
|
const vehicleTitle =
|
||||||
@@ -150,7 +149,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, pa
|
|||||||
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
|
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<>
|
<>
|
||||||
<DataLabel label={t("jobs.fields.alt_transport")}>
|
<DataLabel label={t("jobs.fields.alt_transport")}>
|
||||||
{job.alt_transport}
|
{job.alt_transport}
|
||||||
@@ -345,7 +344,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, pa
|
|||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<Col {...colSpan}>
|
<Col {...colSpan}>
|
||||||
<Card
|
<Card
|
||||||
style={{ height: "100%" }}
|
style={{ height: "100%" }}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Col, Row } from "antd";
|
import { Col, Row } from "antd";
|
||||||
import React from "react";
|
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import BillDetailEditcontainer from "../bill-detail-edit/bill-detail-edit.container";
|
import BillDetailEditcontainer from "../bill-detail-edit/bill-detail-edit.container";
|
||||||
import BillsListTable from "../bills-list-table/bills-list-table.component";
|
import BillsListTable from "../bills-list-table/bills-list-table.component";
|
||||||
@@ -7,15 +6,15 @@ import JobBillsTotal from "../job-bills-total/job-bills-total.component";
|
|||||||
import PartsDispatchTable from "../parts-dispatch-table/parts-dispatch-table.component";
|
import PartsDispatchTable from "../parts-dispatch-table/parts-dispatch-table.component";
|
||||||
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
||||||
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
||||||
|
import { selectIsPartsEntry } from "../../redux/application/application.selectors";
|
||||||
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
isPartsEntry: selectIsPartsEntry
|
||||||
partsManagementOnly: selectPartsManagementOnly
|
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailPliComponent);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailPliComponent);
|
||||||
|
|
||||||
export function JobsDetailPliComponent({
|
export function JobsDetailPliComponent({
|
||||||
@@ -24,9 +23,9 @@ export function JobsDetailPliComponent({
|
|||||||
handleBillOnRowClick,
|
handleBillOnRowClick,
|
||||||
handlePartsOrderOnRowClick,
|
handlePartsOrderOnRowClick,
|
||||||
handlePartsDispatchOnRowClick,
|
handlePartsDispatchOnRowClick,
|
||||||
partsManagementOnly
|
isPartsEntry
|
||||||
}) {
|
}) {
|
||||||
if (partsManagementOnly) {
|
if (isPartsEntry) {
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { PageHeader } from "@ant-design/pro-layout";
|
|||||||
import { useLazyQuery, useMutation } from "@apollo/client";
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import { Button, Drawer, Grid, Popconfirm, Space, Table } from "antd";
|
import { Button, Drawer, Grid, Popconfirm, Space, Table } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaTasks } from "react-icons/fa";
|
import { FaTasks } from "react-icons/fa";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -12,9 +12,9 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { QUERY_BILL_BY_PK } from "../../graphql/bills.queries";
|
import { QUERY_BILL_BY_PK } from "../../graphql/bills.queries";
|
||||||
import { DELETE_PARTS_ORDER } from "../../graphql/parts-orders.queries";
|
import { DELETE_PARTS_ORDER } from "../../graphql/parts-orders.queries";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
@@ -32,7 +32,7 @@ import PrintWrapper from "../print-wrapper/print-wrapper.component";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
partsManagementOnly: selectPartsManagementOnly
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -62,7 +62,7 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
handleOnRowClick,
|
handleOnRowClick,
|
||||||
setPartsReceiveContext,
|
setPartsReceiveContext,
|
||||||
setTaskUpsertContext,
|
setTaskUpsertContext,
|
||||||
partsManagementOnly
|
isPartsEntry
|
||||||
}) {
|
}) {
|
||||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
.filter((screen) => !!screen[1])
|
.filter((screen) => !!screen[1])
|
||||||
@@ -136,7 +136,7 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
>
|
>
|
||||||
{t("parts_orders.actions.receive")}
|
{t("parts_orders.actions.receive")}
|
||||||
</Button>
|
</Button>
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<Button
|
<Button
|
||||||
title={t("tasks.buttons.create")}
|
title={t("tasks.buttons.create")}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -174,7 +174,7 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
<DeleteFilled />
|
<DeleteFilled />
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
(jobRO ? !record.return : jobRO) ||
|
(jobRO ? !record.return : jobRO) ||
|
||||||
@@ -311,7 +311,7 @@ export function PartsOrderListTableDrawerComponent({
|
|||||||
title: t("parts_orders.fields.backordered_on"),
|
title: t("parts_orders.fields.backordered_on"),
|
||||||
dataIndex: "backordered_on",
|
dataIndex: "backordered_on",
|
||||||
key: "backordered_on",
|
key: "backordered_on",
|
||||||
render: (text, record) => <DateFormatter>{text}</DateFormatter>
|
render: (text) => <DateFormatter>{text}</DateFormatter>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("parts_orders.fields.backordered_eta"),
|
title: t("parts_orders.fields.backordered_eta"),
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { DELETE_PARTS_ORDER } from "../../graphql/parts-orders.queries";
|
import { DELETE_PARTS_ORDER } from "../../graphql/parts-orders.queries";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
@@ -24,7 +24,7 @@ import ShareToTeamsButton from "../share-to-teams/share-to-teams.component.jsx";
|
|||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
partsManagementOnly: selectPartsManagementOnly
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -54,7 +54,7 @@ export function PartsOrderListTableComponent({
|
|||||||
handleOnRowClick,
|
handleOnRowClick,
|
||||||
setPartsReceiveContext,
|
setPartsReceiveContext,
|
||||||
setTaskUpsertContext,
|
setTaskUpsertContext,
|
||||||
partsManagementOnly
|
isPartsEntry
|
||||||
}) {
|
}) {
|
||||||
const responsibilityCenters = bodyshop.md_responsibility_centers;
|
const responsibilityCenters = bodyshop.md_responsibility_centers;
|
||||||
const Templates = TemplateList("partsorder", { job });
|
const Templates = TemplateList("partsorder", { job });
|
||||||
@@ -108,7 +108,7 @@ export function PartsOrderListTableComponent({
|
|||||||
>
|
>
|
||||||
{t("parts_orders.actions.receive")}
|
{t("parts_orders.actions.receive")}
|
||||||
</Button>
|
</Button>
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Button
|
||||||
title={t("tasks.buttons.create")}
|
title={t("tasks.buttons.create")}
|
||||||
@@ -148,7 +148,7 @@ export function PartsOrderListTableComponent({
|
|||||||
<Button disabled={jobRO} icon={<DeleteFilled />} />
|
<Button disabled={jobRO} icon={<DeleteFilled />} />
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
(jobRO ? !record.return : jobRO) ||
|
(jobRO ? !record.return : jobRO) ||
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-he
|
|||||||
import JobsDetailPliContainer from "../../components/jobs-detail-pli/jobs-detail-pli.container.jsx";
|
import JobsDetailPliContainer from "../../components/jobs-detail-pli/jobs-detail-pli.container.jsx";
|
||||||
import { QUERY_PARTS_BILLS_BY_JOBID } from "../../graphql/bills.queries.js";
|
import { QUERY_PARTS_BILLS_BY_JOBID } from "../../graphql/bills.queries.js";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions.js";
|
import { insertAuditTrail } from "../../redux/application/application.actions.js";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors.js";
|
import { selectIsPartsEntry, selectJobReadOnly } from "../../redux/application/application.selectors.js";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions.js";
|
import { setModalContext } from "../../redux/modals/modals.actions.js";
|
||||||
import { selectBodyshop, selectPartsManagementOnly } from "../../redux/user/user.selectors.js";
|
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
partsManagementOnly: selectPartsManagementOnly
|
isPartsEntry: selectIsPartsEntry
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setPrintCenterContext: (context) =>
|
setPrintCenterContext: (context) =>
|
||||||
@@ -53,7 +53,7 @@ export function SimplifiedPartsJobDetailComponent({
|
|||||||
mutationUpdateJob,
|
mutationUpdateJob,
|
||||||
insertAuditTrail,
|
insertAuditTrail,
|
||||||
refetch,
|
refetch,
|
||||||
partsManagementOnly
|
isPartsEntry
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -137,7 +137,7 @@ export function SimplifiedPartsJobDetailComponent({
|
|||||||
{t("jobs.actions.printCenter")}
|
{t("jobs.actions.printCenter")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{!partsManagementOnly && (
|
{!isPartsEntry && (
|
||||||
<>
|
<>
|
||||||
<JobsDetailHeaderActions key="actions" job={job} refetch={refetch} />
|
<JobsDetailHeaderActions key="actions" job={job} refetch={refetch} />
|
||||||
<Button type="primary" loading={loading} disabled={jobRO} onClick={() => form.submit()}>
|
<Button type="primary" loading={loading} disabled={jobRO} onClick={() => form.submit()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user