From afb0c85e9f8437c715aa679e7aa1ea843ad00c9a Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Mon, 31 May 2021 10:56:13 -0700
Subject: [PATCH] IO-1167 IO-775 Minor bug fixes.
---
.../accounting-payments-table.component.jsx | 13 +++-------
.../job-detail-lines/job-lines.component.jsx | 8 +++++--
.../jobs-documents-gallery.component.jsx | 24 +++++++++----------
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
index 35308356e..f2a72dd92 100644
--- a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
+++ b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx
@@ -5,7 +5,7 @@ import { Link } from "react-router-dom";
import { logImEXEvent } from "../../firebase/firebase.utils";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
-import { alphaSort } from "../../utils/sorters";
+import { alphaSort, dateSort } from "../../utils/sorters";
import PaymentExportButton from "../payment-export-button/payment-export-button.component";
import PaymentsExportAllButton from "../payments-export-all-button/payments-export-all-button.component";
@@ -41,19 +41,12 @@ export default function AccountingPayablesTableComponent({
title: t("payments.fields.date"),
dataIndex: "date",
key: "date",
- sorter: (a, b) => alphaSort(a.date, b.date),
+ sorter: (a, b) => dateSort(a.date, b.date),
sortOrder:
state.sortedInfo.columnKey === "date" && state.sortedInfo.order,
render: (text, record) => {record.date},
},
- {
- title: t("payments.fields.date"),
- dataIndex: "date",
- key: "date",
- sorter: (a, b) => alphaSort(a.date, b.date),
- sortOrder:
- state.sortedInfo.columnKey === "date" && state.sortedInfo.order,
- },
+
{
title: t("jobs.fields.owner"),
dataIndex: "owner",
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 cd88da672..67e8381c9 100644
--- a/client/src/components/job-detail-lines/job-lines.component.jsx
+++ b/client/src/components/job-detail-lines/job-lines.component.jsx
@@ -22,6 +22,7 @@ import { createStructuredSelector } from "reselect";
import { DELETE_JOB_LINE_BY_PK } from "../../graphql/jobs-lines.queries";
import { selectJobReadOnly } from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions";
+import { selectTechnician } from "../../redux/tech/tech.selectors";
import { onlyUnique } from "../../utils/arrayHelper";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { alphaSort } from "../../utils/sorters";
@@ -37,6 +38,7 @@ import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.con
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
jobRO: selectJobReadOnly,
+ technician: selectTechnician,
});
const mapDispatchToProps = (dispatch) => ({
@@ -48,6 +50,7 @@ const mapDispatchToProps = (dispatch) => ({
export function JobLinesComponent({
jobRO,
+ technician,
setPartsOrderContext,
loading,
refetch,
@@ -364,7 +367,8 @@ export function JobLinesComponent({
disabled={
(job && !job.converted) ||
(selectedLines.length > 0 ? false : true) ||
- jobRO
+ jobRO ||
+ technician
}
onClick={() => {
setPartsOrderContext({
@@ -399,7 +403,7 @@ export function JobLinesComponent({