IO-1533 Kanban Customizations

This commit is contained in:
Patrick Fic
2021-11-17 22:07:50 -08:00
parent 696781c857
commit 49bf461c36
7 changed files with 205 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
import { EyeFilled, CalendarOutlined, ToolFilled } from "@ant-design/icons";
import { Card, Col, Row, Space, Typography } from "antd";
import React, { useState } from "react";
import { CalendarOutlined, EyeFilled } from "@ant-design/icons";
import { Card, Col, Row, Space } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { DateTimeFormatter } from "../../utils/DateFormatter";
@@ -17,7 +17,7 @@ export default function ProductionBoardCard(
) {
const { t } = useTranslation();
let employee_body, employee_prep, employee_refinish, employee_csr;
let employee_body, employee_prep, employee_refinish; //employee_csr;
if (card.employee_body) {
employee_body = bodyshop.employees.find((e) => e.id === card.employee_body);
}
@@ -29,9 +29,9 @@ export default function ProductionBoardCard(
(e) => e.id === card.employee_refinish
);
}
if (card.employee_csr) {
employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
}
// if (card.employee_csr) {
// employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
// }
return (
<Card
@@ -46,24 +46,15 @@ export default function ProductionBoardCard(
</Space>
}
extra={
<Space>
{cardSettings && cardSettings.sublets && (
<Col span={12}>
<ProductionSubletsManageComponent
subletJobLines={card.subletLines}
/>
</Col>
)}
{technician ? (
<Link to={`/tech/joblookup?selected=${card.id}`}>
<EyeFilled />
</Link>
) : (
<Link to={`/manage/jobs/${card.id}`}>
<EyeFilled />
</Link>
)}
</Space>
technician ? (
<Link to={`/tech/joblookup?selected=${card.id}`}>
<EyeFilled />
</Link>
) : (
<Link to={`/manage/jobs/${card.id}`}>
<EyeFilled />
</Link>
)
}
>
<Row>
@@ -85,12 +76,12 @@ export default function ProductionBoardCard(
card.v_make_desc || ""
} ${card.v_model_desc || ""}`}</div>
</Col>
{cardSettings && cardSettings.ins_co_nm && (
{cardSettings && cardSettings.ins_co_nm && card.ins_co_nm && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<div className="ellipses">{card.ins_co_nm || ""}</div>
</Col>
)}
{cardSettings && cardSettings.clm_no && (
{cardSettings && cardSettings.clm_no && card.clm_no && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<div className="ellipses">{card.clm_no || ""}</div>
</Col>
@@ -101,19 +92,28 @@ export default function ProductionBoardCard(
<Row>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`B: ${
employee_body
? `${employee_body.first_name} ${employee_body.last_name}`
? `${employee_body.first_name.substr(
0,
3
)} ${employee_body.last_name.charAt(0)}`
: ""
}`}</Col>
} ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`P: ${
employee_prep
? `${employee_prep.first_name} ${employee_prep.last_name}`
? `${employee_prep.first_name.substr(
0,
3
)} ${employee_prep.last_name.charAt(0)}`
: ""
}`}</Col>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`R: ${
employee_refinish
? `${employee_refinish.first_name} ${employee_refinish.last_name}`
? `${employee_refinish.first_name.substr(
0,
3
)} ${employee_refinish.last_name.charAt(0)}`
: ""
}`}</Col>
} ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
{/* <Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`C: ${
employee_csr
? `${employee_csr.first_name} ${employee_csr.last_name}`
@@ -122,7 +122,7 @@ export default function ProductionBoardCard(
</Row>
</Col>
)}
{cardSettings && cardSettings.laborhrs && (
{/* {cardSettings && cardSettings.laborhrs && (
<Col span={24}>
<Row>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`B: ${
@@ -133,19 +133,21 @@ export default function ProductionBoardCard(
} hrs`}</Col>
</Row>
</Col>
)}
{cardSettings && cardSettings.scheduled_completion && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<Space>
<CalendarOutlined />
<DateTimeFormatter format="MM/DD">
{card.scheduled_completion}
</DateTimeFormatter>
</Space>
</Col>
)}
{cardSettings && cardSettings.ats && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
)} */}
{cardSettings &&
cardSettings.scheduled_completion &&
card.scheduled_completion && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<Space>
<CalendarOutlined />
<DateTimeFormatter format="MM/DD">
{card.scheduled_completion}
</DateTimeFormatter>
</Space>
</Col>
)}
{cardSettings && cardSettings.ats && card.alt_transport && (
<Col span={12}>
<div>{card.alt_transport || ""}</div>
</Col>
)}

View File

@@ -84,13 +84,13 @@ export default function ProductionBoardKanbanCardSettings({
>
<Switch />
</Form.Item>
<Form.Item
{/* <Form.Item
valuePropName="checked"
label={t("production.labels.laborhrs")}
name="laborhrs"
>
<Switch />
</Form.Item>
</Form.Item> */}
<Form.Item
valuePropName="checked"
label={t("production.labels.employeeassignments")}
@@ -98,15 +98,15 @@ export default function ProductionBoardKanbanCardSettings({
>
<Switch />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
valuePropName="checked"
label={t("production.labels.scheduled_completion")}
name="scheduled_completion"
>
<Switch />
</Form.Item>{" "}
</Col>
<Col span={12}>
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.ats")}

View File

@@ -56,7 +56,10 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) {
<Button
key="complete"
loading={loading}
onClick={() => handleSubletMark(s, "complete")}
onClick={(e) => {
e.stopPropagation();
handleSubletMark(s, "complete");
}}
type={s.sublet_completed ? "primary" : "ghost"}
>
<CheckCircleFilled
@@ -66,7 +69,10 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) {
<Button
key="sublet"
loading={loading}
onClick={() => handleSubletMark(s, "ignore")}
onClick={(e) => {
e.stopPropagation();
handleSubletMark(s, "ignore");
}}
type={s.sublet_ignored ? "primary" : "ghost"}
>
<EyeInvisibleFilled