WIP Tech Claiming Ability

This commit is contained in:
Patrick Fic
2023-08-04 12:28:08 -07:00
parent de102d9898
commit 786c790307
10 changed files with 286 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
import { Card, Col, Row, Table } from "antd";
import { Button, Card, Col, Row, Table } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { DateTimeFormatter } from "../../utils/DateFormatter";
@@ -28,9 +28,12 @@ export default function PartsDispatchExpander({ dispatch, job }) {
width: "20%",
//sorter: (a, b) => alphaSort(a.number, b.number),
render: (text, record) => (
<DateTimeFormatter>{record.accepted_at}</DateTimeFormatter>
),
render: (text, record) =>
record.accepted_at ? (
<DateTimeFormatter>{record.accepted_at}</DateTimeFormatter>
) : (
<Button>{t("parts_dispatch.actions.accept")}</Button>
),
},
];
return (
@@ -38,7 +41,7 @@ export default function PartsDispatchExpander({ dispatch, job }) {
<Row gutter={[16, 16]}>
<Col span={24}>
<Table
pagination={false}
rowKey={"id"}
dataSource={dispatch.parts_dispatch_lines}
columns={columns}
/>