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 ed27f08cb..c975388f2 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
@@ -1,5 +1,5 @@
-import { FileExcelFilled } from "@ant-design/icons";
-import { Card, Col, Row, Space } from "antd";
+import { FileExcelFilled, EditFilled, SyncOutlined } from "@ant-design/icons";
+import { Card, Col, Row, Space, Button } from "antd";
import React, { useEffect, useState } from "react";
import Gallery from "react-grid-gallery";
import { useTranslation } from "react-i18next";
@@ -23,6 +23,25 @@ function JobsDocumentsComponent({
}) {
const [galleryImages, setgalleryImages] = useState({ images: [], other: [] });
const { t } = useTranslation();
+ const [index, setIndex] = useState(0);
+
+ const onCurrentImageChange = (index) => {
+ setIndex(index);
+ };
+
+ useEffect(() => {
+ console.log("Added event listening for reteching.");
+ window.addEventListener("storage", (ev) => {
+ if (ev.key === "refetch" && ev.newValue === true) {
+ refetch && refetch();
+ localStorage.setItem("refetch", false);
+ }
+ });
+
+ return () => {
+ window.removeEventListener("storage");
+ };
+ }, [refetch]);
useEffect(() => {
let documents = data.reduce(
@@ -101,6 +120,9 @@ function JobsDocumentsComponent({
+
{
+ console.log(`Clicked`);
+ const newWindow = window.open(
+ `${window.location.protocol}//${window.location.host}/edit?documentId=${galleryImages.images[index].id}`,
+ "_blank",
+ "noopener,noreferrer"
+ );
+ if (newWindow) newWindow.opener = null;
+ }}
+ >
+
+ ,
+ ]}
onClickImage={(props) => {
window.open(
props.target.src,
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index e2ffadc03..c2f2d2791 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -6,7 +6,7 @@
},
"errors": {
"deleting": "Error encountered while deleting allocation. {{message}}",
- "saving": "Error while allocating. {{message}}",
+ "saving": "Error while allocating. {{message}}",
"validation": "Please ensure all fields are entered correctly. "
},
"fields": {
@@ -701,10 +701,12 @@
"upload": "Upload",
"upload_limitexceeded": "Uploading all selected documents will exceed the job storage limit for your shop. ",
"upload_limitexceeded_title": "Unable to upload document(s)",
+ "uploading": "Uploading...",
"usage": "of job storage used. ({{used}} / {{total}})"
},
"successes": {
"delete": "Document(s) deleted successfully.",
+ "edituploaded": "Edited document uploaded successfully. Please close this window and refresh the documents list.",
"insert": "Uploaded document successfully. ",
"updated": "Document updated successfully. "
}
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 606c03ce3..5cba0da9a 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -701,10 +701,12 @@
"upload": "Subir",
"upload_limitexceeded": "",
"upload_limitexceeded_title": "",
+ "uploading": "",
"usage": ""
},
"successes": {
"delete": "Documento eliminado con éxito.",
+ "edituploaded": "",
"insert": "Documento cargado con éxito.",
"updated": ""
}
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index f7ee47e50..c480fc6cb 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -701,10 +701,12 @@
"upload": "Télécharger",
"upload_limitexceeded": "",
"upload_limitexceeded_title": "",
+ "uploading": "",
"usage": ""
},
"successes": {
"delete": "Le document a bien été supprimé.",
+ "edituploaded": "",
"insert": "Document téléchargé avec succès.",
"updated": ""
}
From af6bb18db225a7b6934d22fd3e843e445990726c Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Mon, 31 May 2021 10:50:28 -0700
Subject: [PATCH 3/7] IO-1138 Additional offline check.
---
client/src/App/App.jsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx
index cbf096f8f..fbaedfd0a 100644
--- a/client/src/App/App.jsx
+++ b/client/src/App/App.jsx
@@ -40,8 +40,12 @@ const mapDispatchToProps = (dispatch) => ({
export function App({ checkUserSession, currentUser, online, setOnline }) {
useEffect(() => {
+ if (!navigator.onLine) {
+ setOnline(false);
+ }
+
checkUserSession();
- }, [checkUserSession]);
+ }, [checkUserSession, setOnline]);
//const b = Grid.useBreakpoint();
// console.log("Breakpoints:", b);
From afb0c85e9f8437c715aa679e7aa1ea843ad00c9a Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Mon, 31 May 2021 10:56:13 -0700
Subject: [PATCH 4/7] 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({