From f4208a2212da983a9287d699170d1f9d059aeaae Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 22 Dec 2022 15:06:10 -0800 Subject: [PATCH] Client side package updates. --- client/package.json | 29 +- ...bs-document-gallery.download.component.jsx | 80 +- client/src/index.js | 16 +- client/src/utils/CurrencyFormatter.jsx | 4 +- client/yarn.lock | 9208 +++++++---------- 5 files changed, 3820 insertions(+), 5517 deletions(-) diff --git a/client/package.json b/client/package.json index c6eda0caa..fc05352e4 100644 --- a/client/package.json +++ b/client/package.json @@ -26,8 +26,8 @@ "exifr": "^7.1.3", "firebase": "^9.9.1", "graphql": "^16.5.0", - "i18next": "^21.8.14", - "i18next-browser-languagedetector": "^6.1.4", + "i18next": "^22.4.6", + "i18next-browser-languagedetector": "^7.0.1", "jsoneditor": "^9.9.0", "jsreport-browser-client-dist": "^1.3.0", "libphonenumber-js": "^1.10.9", @@ -35,28 +35,28 @@ "markerjs2": "^2.22.0", "moment-business-days": "^1.2.0", "moment-timezone": "^0.5.34", - "normalize-url": "^7.0.3", - "phone": "^3.1.23", + "normalize-url": "^8.0.0", + "phone": "^3.1.32", "preval.macro": "^5.0.0", "prop-types": "^15.8.1", - "query-string": "^7.1.1", + "query-string": "^8.1.0", "rc-queue-anim": "^2.0.0", "rc-scroll-anim": "^2.7.6", - "react": "^17.0.2", - "react-big-calendar": "^1.5.0", + "react": "^18.2.0", + "react-big-calendar": "^1.5.2", "react-color": "^2.19.3", "react-cookie": "^4.1.1", - "react-dom": "^17.0.2", + "react-dom": "^18.2.0", "react-drag-listview": "^0.2.1", "react-grid-gallery": "^0.5.5", "react-grid-layout": "^1.3.4", - "react-i18next": "^11.18.1", - "react-icons": "^4.4.0", - "react-number-format": "^4.9.3", - "react-redux": "^7.2.8", + "react-i18next": "^12.1.1", + "react-icons": "^4.7.1", + "react-number-format": "^5.1.2", + "react-redux": "^8.0.5", "react-resizable": "^3.0.4", "react-router-dom": "^5.3.0", - "react-scripts": "^4.0.3", + "react-scripts": "^5.0.1", "react-sticky": "^6.0.3", "react-sublime-video": "^0.2.5", "react-virtualized": "^9.22.3", @@ -70,7 +70,7 @@ "socket.io-client": "^4.5.1", "styled-components": "^5.3.5", "subscriptions-transport-ws": "^0.11.0", - "web-vitals": "^2.1.4", + "web-vitals": "^3.1.0", "workbox-background-sync": "^6.5.3", "workbox-broadcast-update": "^6.5.3", "workbox-cacheable-response": "^6.5.3", @@ -88,6 +88,7 @@ "scripts": { "analyze": "source-map-explorer 'build/static/js/*.js'", "start": "craco start", + "startrs": "react-scripts start", "build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build", "build:test": "env-cmd -f .env.test yarn run build", "build-deploy:test": "yarn run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'", 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 7d322c61d..5818eaf53 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 @@ -5,7 +5,7 @@ import { useTranslation } from "react-i18next"; import { logImEXEvent } from "../../firebase/firebase.utils"; import cleanAxios from "../../utils/CleanAxios"; import formatBytes from "../../utils/formatbytes"; -import yauzl from "yauzl"; +//import yauzl from "yauzl"; import { useTreatments } from "@splitsoftware/splitio-react"; import { connect } from "react-redux"; @@ -36,7 +36,7 @@ export function JobsDocumentsDownloadButton({ ); const imagesToDownload = [ ...galleryImages.images.filter((image) => image.isSelected), - ...galleryImages.other.filter((image) => image.isSelected), + ...galleryImages.other.filter((image) => image.isSelected), ]; function downloadProgress(progressEvent) { @@ -69,44 +69,42 @@ export function JobsDocumentsDownloadButton({ setDownload(null); if (Direct_Media_Download.treatment === "on") { try { - const parentDir = await window.showDirectoryPicker({ - id: "media", - startIn: "downloads", - }); - - const directory = await parentDir.getDirectoryHandle(identifier, { - create: true, - }); - - yauzl.fromBuffer( - Buffer.from(theDownloadedZip.data), - {}, - (err, zipFile) => { - if (err) throw err; - zipFile.on("entry", (entry) => { - zipFile.openReadStream(entry, async (readErr, readStream) => { - if (readErr) { - zipFile.close(); - throw readErr; - } - if (err) throw err; - let fileSystemHandle = await directory.getFileHandle( - entry.fileName, - { - create: true, - } - ); - const writable = await fileSystemHandle.createWritable(); - readStream.on("data", async function (chunk) { - await writable.write(chunk); - }); - readStream.on("end", async function () { - await writable.close(); - }); - }); - }); - } - ); + // const parentDir = await window.showDirectoryPicker({ + // id: "media", + // startIn: "downloads", + // }); + // const directory = await parentDir.getDirectoryHandle(identifier, { + // create: true, + // }); + // yauzl.fromBuffer( + // Buffer.from(theDownloadedZip.data), + // {}, + // (err, zipFile) => { + // if (err) throw err; + // zipFile.on("entry", (entry) => { + // zipFile.openReadStream(entry, async (readErr, readStream) => { + // if (readErr) { + // zipFile.close(); + // throw readErr; + // } + // if (err) throw err; + // let fileSystemHandle = await directory.getFileHandle( + // entry.fileName, + // { + // create: true, + // } + // ); + // const writable = await fileSystemHandle.createWritable(); + // readStream.on("data", async function (chunk) { + // await writable.write(chunk); + // }); + // readStream.on("end", async function () { + // await writable.close(); + // }); + // }); + // }); + // } + // ); } catch (e) { console.log(e); standardMediaDownload(theDownloadedZip.data); @@ -123,7 +121,7 @@ export function JobsDocumentsDownloadButton({ a.click(); } }; - + return ( <>