From b0d077e104a4c23587ce7ed4528b7493927125b9 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 28 Dec 2023 10:12:59 -0800 Subject: [PATCH] IO-2514 Production Board Estimators --- .../production-list-columns.data.js | 29 ++++++++++++++++++- client/src/graphql/jobs.queries.js | 2 ++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/client/src/components/production-list-columns/production-list-columns.data.js b/client/src/components/production-list-columns/production-list-columns.data.js index a93e0f3e6..a7f1ead6e 100644 --- a/client/src/components/production-list-columns/production-list-columns.data.js +++ b/client/src/components/production-list-columns/production-list-columns.data.js @@ -1,4 +1,4 @@ -import { PauseCircleOutlined, BranchesOutlined } from "@ant-design/icons"; +import { BranchesOutlined, PauseCircleOutlined } from "@ant-design/icons"; import { Space, Tooltip } from "antd"; import i18n from "i18next"; import moment from "moment"; @@ -536,6 +536,33 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { ), }, + { + title: i18n.t("jobs.labels.estimator"), + dataIndex: "estimator", + key: "estimator", + sorter: (a, b) => + alphaSort( + `${a.est_ct_fn || ""} ${a.est_ct_ln || ""}`.trim(), + `${b.est_ct_fn || ""} ${b.est_ct_ln || ""}`.trim() + ), + sortOrder: + state.sortedInfo.columnKey === "estimator" && state.sortedInfo.order, + filters: + (bodyshop && + bodyshop.md_estimators.map((s) => { + return { + text: `${s.est_ct_fn || ""} ${s.est_ct_ln || ""}`.trim(), + value: [`${s.est_ct_fn || ""} ${s.est_ct_ln || ""}`.trim()], + }; + })) || + [], + onFilter: (value, record) => + value.includes( + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim() + ), + render: (text, record) => + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(), + }, //Added as a place holder for St Claude. Not implemented as it requires another join for a field used by only 1 client. // { diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index b18673de6..fbeb8740d 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -364,6 +364,8 @@ export const QUERY_JOBS_IN_PRODUCTION = gql` employee_refinish employee_prep employee_csr + est_ct_fn + est_ct_ln suspended date_repairstarted joblines_status {