diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index 1dc6f0ad5..4ca84f56d 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -32,9 +32,9 @@ const mapDispatchToProps = (dispatch) => ({ }); const span = { - sm: { span: 24 }, - md: { span: 12 }, - lg: { span: 8 }, + lg: { span: 24 }, + xl: { span: 12 }, + xxl: { span: 8 }, }; export function JobDetailCards({ bodyshop, setPrintCenterContext }) { @@ -137,12 +137,6 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) { data={data ? data.jobs_by_pk : null} /> - - - + + + ) : null} diff --git a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx index 58b87ce3b..dcb049f79 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx @@ -1,16 +1,119 @@ +import { Table } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; +import JobLineNotePopup from "../job-line-note-popup/job-line-note-popup.component"; import PartsStatusPie from "../parts-status-pie/parts-status-pie.component"; import CardTemplate from "./job-detail-cards.template.component"; -export default function JobDetailCardsPartsComponent({ loading, data }) { +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectJobReadOnly } from "../../redux/application/application.selectors"; +import { onlyUnique } from "../../utils/arrayHelper"; +import { alphaSort } from "../../utils/sorters"; +import JobLineLocationPopup from "../job-line-location-popup/job-line-location-popup.component"; +import JobLineStatusPopup from "../job-line-status-popup/job-line-status-popup.component"; +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser + jobRO: selectJobReadOnly, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(JobDetailCardsPartsComponent); + +export function JobDetailCardsPartsComponent({ loading, data, jobRO }) { const { t } = useTranslation(); const { joblines_status } = data; + const columns = [ + { + title: t("joblines.fields.line_desc"), + dataIndex: "line_desc", + fixed: "left", + key: "line_desc", + sorter: (a, b) => alphaSort(a.line_desc, b.line_desc), + onCell: (record) => ({ + className: record.manual_line && "job-line-manual", + style: { + ...(record.critical ? { boxShadow: " -.5em 0 0 #FFC107" } : {}), + }, + }), + width: "30%", + ellipsis: true, + }, + { + title: t("joblines.fields.part_type"), + dataIndex: "part_type", + key: "part_type", + width: "15%", + sorter: (a, b) => + alphaSort( + t(`joblines.fields.part_types.${a.part_type}`), + t(`joblines.fields.part_types.${b.part_type}`) + ), + render: (text, record) => + record.part_type + ? t(`joblines.fields.part_types.${record.part_type}`) + : null, + }, + { + title: t("joblines.fields.part_qty"), + dataIndex: "part_qty", + key: "part_qty", + width: "10%", + }, + { + title: t("joblines.fields.notes"), + dataIndex: "notes", + key: "notes", + render: (text, record) => ( + + ), + }, + { + title: t("joblines.fields.location"), + dataIndex: "location", + key: "location", + sorter: (a, b) => alphaSort(a.location, b.location), + render: (text, record) => ( + + ), + }, + { + title: t("joblines.fields.status"), + dataIndex: "status", + key: "status", + sorter: (a, b) => alphaSort(a.status, b.status), + filters: + (data && + data.joblines + ?.map((l) => l.status) + .filter(onlyUnique) + .map((s) => { + return { + text: s || "No Status*", + value: [s], + }; + })) || + [], + onFilter: (value, record) => value.includes(record.status), + render: (text, record) => ( + + ), + }, + ]; return (
+ ); diff --git a/client/src/components/production-list-detail/production-list-detail.component.jsx b/client/src/components/production-list-detail/production-list-detail.component.jsx index ac5b4146c..dac4b084f 100644 --- a/client/src/components/production-list-detail/production-list-detail.component.jsx +++ b/client/src/components/production-list-detail/production-list-detail.component.jsx @@ -88,7 +88,7 @@ export function ProductionListDetail({ /> } placement="right" - width={"33%"} + width={"50%"} onClose={handleClose} visible={selected} > diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 08edf4bfc..dd33ed58f 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -869,10 +869,40 @@ export const QUERY_JOB_CARD_DETAILS = gql` count status } - joblines(where: { removed: { _eq: false } }) { + + joblines( + where: { + removed: { _eq: false } + part_type: { _is_null: false, _nin: ["PAE", "PAS", "PASL"] } + } + order_by: { line_no: asc } + ) { id + alt_partm + line_no + unq_seq + line_ind + line_desc + line_ref + part_type + part_qty mod_lbr_ty + db_hrs mod_lb_hrs + lbr_op + lbr_amt + op_code_desc + status + notes + location + tax_part + db_ref + manual_line + prt_dsmk_p + prt_dsmk_m + ioucreated + convertedtolbr + critical } owner { id