From 5f0a683ec18af28f6deb832598312bc12d7ce831 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 09:58:46 -0700
Subject: [PATCH 1/7] IO-1161 Line Modal Hours to precision 1.
---
.../job-lines-upsert-modal/job-lines-upsert-modal.component.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/src/components/job-lines-upsert-modal/job-lines-upsert-modal.component.jsx b/client/src/components/job-lines-upsert-modal/job-lines-upsert-modal.component.jsx
index 24839ac89..07e9cc009 100644
--- a/client/src/components/job-lines-upsert-modal/job-lines-upsert-modal.component.jsx
+++ b/client/src/components/job-lines-upsert-modal/job-lines-upsert-modal.component.jsx
@@ -123,7 +123,7 @@ export default function JobLinesUpsertModalComponent({
// }),
// ]}
>
-
+
From ee15f063ce3e8a259db3a9a57e602506520af5ba Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 11:21:55 -0700
Subject: [PATCH 2/7] IO-1158 Change Ins Co Nm to select
---
.../jobs-create-jobs-info.component.jsx | 8 +++++++-
.../jobs-detail-general/jobs-detail-general.component.jsx | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx
index 8e9bb44b6..95bad7368 100644
--- a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx
+++ b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx
@@ -51,7 +51,13 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
-
+
diff --git a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx
index 0492f6761..6d77cadd4 100644
--- a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx
+++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx
@@ -54,7 +54,13 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
-
+
From d62a2c0aaf31e4cce67ca23e19ffbd827c27154c Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 14:42:59 -0700
Subject: [PATCH 3/7] IO-1095 Remove required fields vehicle/owner.
---
.../owner-detail-form.component.jsx | 44 ++-----------------
.../vehicle-detail-form.component.jsx | 22 +---------
2 files changed, 6 insertions(+), 60 deletions(-)
diff --git a/client/src/components/owner-detail-form/owner-detail-form.component.jsx b/client/src/components/owner-detail-form/owner-detail-form.component.jsx
index 8dc3772c6..f8886f3ce 100644
--- a/client/src/components/owner-detail-form/owner-detail-form.component.jsx
+++ b/client/src/components/owner-detail-form/owner-detail-form.component.jsx
@@ -31,55 +31,19 @@ export default function OwnerDetailFormComponent({ form, loading }) {
-
+
-
+
-
+
-
+
diff --git a/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx b/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx
index be0cb80b8..86c587afe 100644
--- a/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx
+++ b/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx
@@ -76,28 +76,10 @@ export default function VehicleDetailFormComponent({ form, loading }) {
-
+
-
+
From c9812c36c063679d2ee252ec7d786310c244ed49 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 14:47:16 -0700
Subject: [PATCH 4/7] IO-1129 MIssing color on schedule modal.
---
client/src/graphql/appointments.queries.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/client/src/graphql/appointments.queries.js b/client/src/graphql/appointments.queries.js
index 2e727fde7..7c005890b 100644
--- a/client/src/graphql/appointments.queries.js
+++ b/client/src/graphql/appointments.queries.js
@@ -85,6 +85,7 @@ export const INSERT_APPOINTMENT = gql`
title
isintake
block
+ color
}
}
update_jobs(
@@ -110,6 +111,7 @@ export const QUERY_APPOINTMENT_BY_DATE = gql`
title
isintake
block
+ color
job {
alt_transport
ro_number
From 73b0542b629c66b997c0ac16b8cebdda20969b58 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 14:58:50 -0700
Subject: [PATCH 5/7] IO-1148 Prefill scheduled completion on intake if not
present.
---
.../job-checklist-form.component.jsx | 10 ++++++++-
.../jobs-documents-gallery.component.jsx | 1 +
client/src/graphql/bodyshop.queries.js | 22 +++++++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
index ba08a8639..a7b1da714 100644
--- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
+++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
@@ -15,6 +15,7 @@ import {
} from "../../../../redux/user/user.selectors";
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
+import moment from "moment-business-days";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -133,7 +134,14 @@ export function JobChecklistForm({
initialValues={{
...(type === "intake" && {
addToProduction: true,
- scheduled_completion: job && job.scheduled_completion,
+ scheduled_completion:
+ (job && job.scheduled_completion) ||
+ moment().businessAdd(
+ (job.labhrs.aggregate.sum.mod_lb_hrs +
+ job.larhrs.aggregate.sum.mod_lb_hrs) /
+ bodyshop.target_touchtime,
+ "days"
+ ),
scheduled_delivery: job && job.scheduled_delivery,
}),
...(type === "deliver" && {
diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
index 9d017c71f..9a16a4de1 100644
--- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
+++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
@@ -173,6 +173,7 @@ function JobsDocumentsComponent({
backgroundImage: ,
height: "100%",
width: "100%",
+ cursor: "pointer",
};
}}
onClickThumbnail={(index) => {
diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js
index e19a8aa89..5f456e88a 100644
--- a/client/src/graphql/bodyshop.queries.js
+++ b/client/src/graphql/bodyshop.queries.js
@@ -197,6 +197,28 @@ export const QUERY_INTAKE_CHECKLIST = gql`
scheduled_delivery
intakechecklist
status
+ labhrs: joblines_aggregate(
+ where: {
+ _and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
+ }
+ ) {
+ aggregate {
+ sum {
+ mod_lb_hrs
+ }
+ }
+ }
+ larhrs: joblines_aggregate(
+ where: {
+ _and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
+ }
+ ) {
+ aggregate {
+ sum {
+ mod_lb_hrs
+ }
+ }
+ }
}
}
`;
From e89b4fe2a440ef160f77edd694b7c8dfb5751c2e Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 25 May 2021 16:30:29 -0700
Subject: [PATCH 6/7] IO-1137 Download zip files with appropriate name.
---
...bs-document-gallery.download.component.jsx | 75 +++++++++++++++++--
.../jobs-documents-gallery.component.jsx | 7 +-
.../jobs-documents-gallery.container.jsx | 1 +
client/src/graphql/documents.queries.js | 4 +
4 files changed, 78 insertions(+), 9 deletions(-)
diff --git a/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx b/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx
index 50a8be4ca..b172e0806 100644
--- a/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx
+++ b/client/src/components/jobs-documents-gallery/jobs-document-gallery.download.component.jsx
@@ -1,11 +1,17 @@
-import { Button } from "antd";
+import { Button, Space } from "antd";
import axios from "axios";
-import React from "react";
+import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
+import cleanAxios from "../../utils/CleanAxios";
+import formatBytes from "../../utils/formatbytes";
-export default function JobsDocumentsDownloadButton({ galleryImages }) {
+export default function JobsDocumentsDownloadButton({
+ galleryImages,
+ identifier,
+}) {
const { t } = useTranslation();
+ const [download, setDownload] = useState(null);
const imagesToDownload = [
...galleryImages.images.filter((image) => image.isSelected),
...galleryImages.other.filter((image) => image.isSelected),
@@ -18,13 +24,68 @@ export default function JobsDocumentsDownloadButton({ galleryImages }) {
ids: imagesToDownload.map((_) => _.key),
})
.then((r) => {
- window.open(r.data);
+ // window.open(r.data);
+ downloadAs(
+ r.data,
+ `${identifier || "images"}.zip`,
+ (progressEvent) => {
+ const percentage = Math.round(
+ (progressEvent.loaded * 100) / progressEvent.total
+ );
+ console.log(progressEvent, percentage);
+ setDownload((currentDownloadState) => {
+ return {
+ downloaded: progressEvent.loaded || 0,
+ speed:
+ (progressEvent.loaded || 0) -
+ ((currentDownloadState && currentDownloadState.downloaded) ||
+ 0),
+ };
+ });
+ },
+ () => setDownload(null)
+ );
});
};
return (
-
+ <>
+
+ >
);
}
+
+const downloadAs = (url, name, onDownloadProgress, onCompleted) => {
+ cleanAxios
+ .get(url, {
+ headers: {
+ "Content-Type": "application/octet-stream",
+ },
+ responseType: "blob",
+ onDownloadProgress: onDownloadProgress,
+ })
+ .then((response) => {
+ onCompleted && onCompleted();
+ const a = document.createElement("a");
+ const url = window.URL.createObjectURL(response.data);
+ a.href = url;
+ a.download = name;
+ a.click();
+ })
+ .catch((err) => {
+ console.log("error", err);
+ });
+};
diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
index 9a16a4de1..2c50c9672 100644
--- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
+++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx
@@ -17,7 +17,7 @@ function JobsDocumentsComponent({
billId,
billsCallback,
totalSize,
- bodyshop,
+ downloadIdentifier,
ignoreSizeLimit,
}) {
const [galleryImages, setgalleryImages] = useState({ images: [], other: [] });
@@ -117,7 +117,10 @@ function JobsDocumentsComponent({
galleryImages={galleryImages}
setGalleryImages={setgalleryImages}
/>
-
+
Date: Tue, 25 May 2021 16:31:09 -0700
Subject: [PATCH 7/7] IO-1168 Resolve payments export all null error.
---
.../accounting-payments-table.component.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 1d2ac0bfa..35308356e 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
@@ -7,7 +7,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
import { alphaSort } 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";
+import PaymentsExportAllButton from "../payments-export-all-button/payments-export-all-button.component";
export default function AccountingPayablesTableComponent({
loading,