From 367ced88d8f79a830801522581e70acb97679e1c Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 2 Oct 2025 12:55:50 -0400 Subject: [PATCH] feature/IO-3388 - Parts Queue Fix --- .../job-detail-cards.parts.component.jsx | 4 +- .../job-detail-lines/job-lines.component.jsx | 2 +- .../job-parts-queue-count.component.jsx | 85 ++++++++++--------- .../jobs-list/jobs-list.component.jsx | 2 +- .../jobs-ready-list.component.jsx | 2 +- .../parts-queue-job-lines.component.jsx | 2 +- .../parts-queue.list.component.jsx | 2 +- .../production-list-columns.data.jsx | 7 +- .../simplified-parts-jobs-list.component.jsx | 2 +- .../tech-lookup-jobs-list.component.jsx | 2 +- .../tech-assigned-prod-jobs.component.jsx | 2 +- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 14 files changed, 61 insertions(+), 54 deletions(-) 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 9f3c32820..949d42eae 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 @@ -90,7 +90,7 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) { .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; })) || @@ -103,7 +103,7 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
- +
); diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index 2cadcf4e8..02dd2cda6 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -318,7 +318,7 @@ export function JobLinesComponent({ .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; })) || diff --git a/client/src/components/job-parts-queue-count/job-parts-queue-count.component.jsx b/client/src/components/job-parts-queue-count/job-parts-queue-count.component.jsx index 8fbee411c..c7cc3a115 100644 --- a/client/src/components/job-parts-queue-count/job-parts-queue-count.component.jsx +++ b/client/src/components/job-parts-queue-count/job-parts-queue-count.component.jsx @@ -1,8 +1,9 @@ import { useMemo } from "react"; -import { Col, Row, Tag, Tooltip } from "antd"; +import { Tag, Tooltip } from "antd"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import { useTranslation } from "react-i18next"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -11,65 +12,67 @@ const mapDispatchToProps = () => ({ //setUserLanguage: language => dispatch(setUserLanguage(language)) }); -export const DEFAULT_COL_LAYOUT = { xs: 24, sm: 24, md: 8, lg: 4, xl: 4, xxl: 4 }; - export default connect(mapStateToProps, mapDispatchToProps)(JobPartsQueueCount); -export function JobPartsQueueCount({ bodyshop, parts, defaultColLayout = DEFAULT_COL_LAYOUT }) { +export function JobPartsQueueCount({ bodyshop, parts }) { + const { t } = useTranslation(); const partsStatus = useMemo(() => { if (!parts) return null; + const statusKeys = ["default_bo", "default_ordered", "default_received", "default_returned"]; return parts.reduce( (acc, val) => { if (val.part_type === "PAS" || val.part_type === "PASL") return acc; acc.total = acc.total + val.count; acc[val.status] = acc[val.status] + val.count; - return acc; }, { total: 0, null: 0, - [bodyshop.md_order_statuses.default_bo]: 0, - [bodyshop.md_order_statuses.default_ordered]: 0, - [bodyshop.md_order_statuses.default_received]: 0, - [bodyshop.md_order_statuses.default_returned]: 0 + ...Object.fromEntries(statusKeys.map((key) => [bodyshop.md_order_statuses[key], 0])) } ); }, [bodyshop, parts]); if (!parts) return null; return ( - - - - {partsStatus.total} - - - - - {partsStatus["null"]} - - - - - {partsStatus[bodyshop.md_order_statuses.default_ordered]} - - - - - {partsStatus[bodyshop.md_order_statuses.default_received]} - - - - - {partsStatus[bodyshop.md_order_statuses.default_returned]} - - - - - {partsStatus[bodyshop.md_order_statuses.default_bo]} - - - +
+ + {partsStatus.total} + + + + {partsStatus["null"]} + + + + + {partsStatus[bodyshop.md_order_statuses.default_bo]} + + + + + {partsStatus[bodyshop.md_order_statuses.default_ordered]} + + + + + {partsStatus[bodyshop.md_order_statuses.default_received]} + + + + + {partsStatus[bodyshop.md_order_statuses.default_returned]} + + +
); } diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index 49439fa00..bde88d161 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -166,7 +166,7 @@ export function JobsList({ bodyshop }) { .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; }) diff --git a/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx b/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx index b88b713c2..b218b46f4 100644 --- a/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx +++ b/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx @@ -165,7 +165,7 @@ export function JobsReadyList({ bodyshop }) { .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; }) diff --git a/client/src/components/parts-queue-card/parts-queue-job-lines.component.jsx b/client/src/components/parts-queue-card/parts-queue-job-lines.component.jsx index 7d108954c..066e937e8 100644 --- a/client/src/components/parts-queue-card/parts-queue-job-lines.component.jsx +++ b/client/src/components/parts-queue-card/parts-queue-job-lines.component.jsx @@ -145,7 +145,7 @@ export function PartsQueueJobLinesComponent({ loading, jobLines }) { .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; })) || diff --git a/client/src/components/parts-queue-list/parts-queue.list.component.jsx b/client/src/components/parts-queue-list/parts-queue.list.component.jsx index bb4b72b79..a947eaefa 100644 --- a/client/src/components/parts-queue-list/parts-queue.list.component.jsx +++ b/client/src/components/parts-queue-list/parts-queue.list.component.jsx @@ -171,7 +171,7 @@ export function PartsQueueListComponent({ bodyshop }) { filters: bodyshop.md_ro_statuses.active_statuses.map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; }) || [], diff --git a/client/src/components/production-list-columns/production-list-columns.data.jsx b/client/src/components/production-list-columns/production-list-columns.data.jsx index f26733c36..165e15c1d 100644 --- a/client/src/components/production-list-columns/production-list-columns.data.jsx +++ b/client/src/components/production-list-columns/production-list-columns.data.jsx @@ -34,8 +34,9 @@ const getEmployeeName = (employeeId, employees) => { return employee ? `${employee.first_name} ${employee.last_name}` : ""; }; -const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatments }) => { +const productionListColumnsData = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatments }) => { const { Enhanced_Payroll } = treatments; + return [ { title: i18n.t("jobs.actions.viewdetail"), @@ -313,7 +314,7 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme activeStatuses ?.map((s) => { return { - text: s || "No Status*", + text: s || i18n.t("dashboard.errors.status"), value: [s] }; }) @@ -584,4 +585,4 @@ const r = ({ technician, state, activeStatuses, data, bodyshop, refetch, treatme } ]; }; -export default r; +export default productionListColumnsData; diff --git a/client/src/components/simplified-parts-jobs-list/simplified-parts-jobs-list.component.jsx b/client/src/components/simplified-parts-jobs-list/simplified-parts-jobs-list.component.jsx index 52946a809..6c92ed2ef 100644 --- a/client/src/components/simplified-parts-jobs-list/simplified-parts-jobs-list.component.jsx +++ b/client/src/components/simplified-parts-jobs-list/simplified-parts-jobs-list.component.jsx @@ -103,7 +103,7 @@ export function SimplifiedPartsJobsListComponent({ return record.status || t("general.labels.na"); }, filteredValue: filter?.status || null, - filters: bodyshop.md_ro_statuses?.parts_statuses.map((s) => { + filters: bodyshop?.md_ro_statuses?.parts_statuses?.map((s) => { return { text: s, value: [s] }; }), onFilter: (value, record) => value.includes(record.status) diff --git a/client/src/components/tech-lookup-jobs-list/tech-lookup-jobs-list.component.jsx b/client/src/components/tech-lookup-jobs-list/tech-lookup-jobs-list.component.jsx index 0febbb24d..dfba5a133 100644 --- a/client/src/components/tech-lookup-jobs-list/tech-lookup-jobs-list.component.jsx +++ b/client/src/components/tech-lookup-jobs-list/tech-lookup-jobs-list.component.jsx @@ -111,7 +111,7 @@ export function TechLookupJobsList({ bodyshop }) { .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; })) || diff --git a/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx b/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx index 1849b9b63..5cc1f308d 100644 --- a/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx +++ b/client/src/pages/tech-assigned-prod-jobs/tech-assigned-prod-jobs.component.jsx @@ -97,7 +97,7 @@ export function TechAssignedProdJobs({ setTimeTicketTaskContext, technician, bod .filter(onlyUnique) .map((s) => { return { - text: s || "No Status*", + text: s || t("dashboard.errors.status"), value: [s] }; })) || diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index aca3da3e2..1f4a43ca7 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -996,6 +996,7 @@ "insco": "No Ins. Co.*", "refreshrequired": "You must refresh the dashboard data to see this component.", "status": "No Status*", + "status_normal": "No Status", "updatinglayout": "Error saving updated layout {{message}}" }, "labels": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 345712670..5c6d656f1 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -996,6 +996,7 @@ "insco": "", "refreshrequired": "", "status": "", + "status_normal": "", "updatinglayout": "" }, "labels": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c3f680059..74df695ea 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -996,6 +996,7 @@ "insco": "", "refreshrequired": "", "status": "", + "status_normal": "", "updatinglayout": "" }, "labels": {