IO-1578 Add employee sorting to prod board.

This commit is contained in:
Patrick Fic
2021-12-28 09:17:16 -08:00
parent 8a42a995f7
commit 4a46bdb9e8
6 changed files with 42 additions and 233 deletions

View File

@@ -33,6 +33,7 @@ export function ProductionColumnsComponent({
setColumns([
...columns,
...dataSource({
bodyshop,
technician,
state: tableState,
activeStatuses: bodyshop.md_ro_statuses.active_statuses,

View File

@@ -18,7 +18,7 @@ import ProductionListColumnNote from "./production-list-columns.productionnote.c
import ProductionListColumnStatus from "./production-list-columns.status.component";
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
const r = ({ technician, state, activeStatuses }) => {
const r = ({ technician, state, activeStatuses, bodyshop }) => {
return [
{
title: i18n.t("jobs.actions.viewdetail"),
@@ -353,6 +353,14 @@ const r = ({ technician, state, activeStatuses }) => {
title: i18n.t("jobs.fields.employee_body"),
dataIndex: "employee_body",
key: "employee_body",
sortOrder:
state.sortedInfo.columnKey === "employee_body" &&
state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees.find((e) => e.id === a.employee_body)?.first_name,
bodyshop.employees.find((e) => e.id === b.employee_body)?.first_name
),
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
@@ -364,6 +372,14 @@ const r = ({ technician, state, activeStatuses }) => {
title: i18n.t("jobs.fields.employee_prep"),
dataIndex: "employee_prep",
key: "employee_prep",
sortOrder:
state.sortedInfo.columnKey === "employee_prep" &&
state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees.find((e) => e.id === a.employee_prep)?.first_name,
bodyshop.employees.find((e) => e.id === b.employee_prep)?.first_name
),
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
@@ -375,6 +391,13 @@ const r = ({ technician, state, activeStatuses }) => {
title: i18n.t("jobs.fields.employee_csr"),
dataIndex: "employee_csr",
key: "employee_csr",
sortOrder:
state.sortedInfo.columnKey === "employee_csr" && state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees.find((e) => e.id === a.employee_csr)?.first_name,
bodyshop.employees.find((e) => e.id === b.employee_csr)?.first_name
),
render: (text, record) => (
<ProductionListEmployeeAssignment record={record} type="employee_csr" />
),
@@ -383,6 +406,16 @@ const r = ({ technician, state, activeStatuses }) => {
title: i18n.t("jobs.fields.employee_refinish"),
dataIndex: "employee_refinish",
key: "employee_refinish",
sortOrder:
state.sortedInfo.columnKey === "employee_refinish" &&
state.sortedInfo.order,
sorter: (a, b) =>
alphaSort(
bodyshop.employees.find((e) => e.id === a.employee_refinish)
?.first_name,
bodyshop.employees.find((e) => e.id === b.employee_refinish)
?.first_name
),
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}

View File

@@ -38,6 +38,7 @@ export function ProductionListTable({
.columns.columnKeys.map((k) => {
return {
...ProductionListColumns({
bodyshop,
technician,
state,
activeStatuses: bodyshop.md_ro_statuses.active_statuses,

View File

@@ -76,6 +76,7 @@ export function ProductionListTable({
matchingColumnConfig.columns.columnKeys.map((k) => {
return {
...ProductionListColumns({
bodyshop,
technician,
state,
activeStatuses: bodyshop.md_ro_statuses.active_statuses,