From 85b12b17e0725f5f36a7a555f8d232057cf3cab3 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 24 Feb 2024 01:19:28 -0600 Subject: [PATCH 01/15] more --- src/App.js | 2 +- src/Components/Dashboard/Dashboard.js | 1 + src/Components/Login/Login.js | 4 ++++ src/Components/Modals/UploadModal.js | 21 +++++++++++++++------ src/styles/modals.scss | 10 +++++++--- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/App.js b/src/App.js index 3f3eff7..b75a5af 100644 --- a/src/App.js +++ b/src/App.js @@ -34,7 +34,7 @@ function App() { const { currentUserEmail } = useContext(AuthContext); const { group } = appState; const navigate = useNavigate(); - + console.log("group in App", group); // wait for user information if (typeof currentUserEmail === "undefined") { return null; diff --git a/src/Components/Dashboard/Dashboard.js b/src/Components/Dashboard/Dashboard.js index 97571ae..30499e3 100644 --- a/src/Components/Dashboard/Dashboard.js +++ b/src/Components/Dashboard/Dashboard.js @@ -30,6 +30,7 @@ const Dashboard = () => { const { group } = appState; const appUserId = group ? group.appUserId : null; const isDashboard = true; + useEffect(() => { if (count.current == null) { setIsMobile(window.innerWidth < 440); diff --git a/src/Components/Login/Login.js b/src/Components/Login/Login.js index 7a061e1..070a1e0 100644 --- a/src/Components/Login/Login.js +++ b/src/Components/Login/Login.js @@ -20,12 +20,16 @@ const Login = () => { } setIsBusy(true); setNotice(""); + console.log("auth", auth); + console.log("email", email); + console.log("password", password); try { const userCredential = await signInWithEmailAndPassword( auth, email, password ); + console.log("userCredential", userCredential); // Signed in userCredential?.user && navigate("/dashboard"); } catch (error) { diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 9a45e21..6d7a668 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -173,17 +173,26 @@ const UploadModal = (props) => {

- Select a document in pdf format for upload. Enter the document title - below. Document description is optional. + Select a .pdf file for upload. Enter title and choose document type. + (the other fields are optional.)

- This document will be associated with {caption} v. {captionTwo} + Select the document type.{" "} + + Selecting "complaint" will automatically begin creation of + discovery requests. + +

+

+ The document will be associated with{" "} + + {caption} v. {captionTwo} + {caseNumber ? `, ${caseNumber}` : ""}.

- If that is not the case you want to associate with this document, - click "cancel", go back and select the intended case from your - active case list. + If that is not the correct case: click cancel to go back and select + the intended case from your active cases.

diff --git a/src/styles/modals.scss b/src/styles/modals.scss index 133bf3f..4ca0116 100644 --- a/src/styles/modals.scss +++ b/src/styles/modals.scss @@ -12,21 +12,25 @@ } .modal-header-text-wrapper { - margin-bottom: 12px; + margin-bottom: 18px; padding: 0px 8px; } .upload-modal-header-text { font-family: Roboto; + font-size: 0.89rem; font-weight: 400; - line-height: 1.25rem; + line-height: 1.1rem; margin: 0px 0px 10px 0px; } +.upload-header-bold { + font-weight: 500; +} .modal-document-error { margin: -10px 2px 0px 5px; color: red; - font-size: 0.85rem; + font-size: 0.89rem; } .create-modal-header { From a7bf90076d626e1df19e56e27dffc7b81da4a760 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 24 Feb 2024 01:25:36 -0600 Subject: [PATCH 02/15] More --- src/Components/Modals/UploadModal.js | 28 ++++++++++++++++++++++++++-- src/styles/modals.scss | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 6d7a668..2b39804 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -6,6 +6,7 @@ import Button from "../../pageElements/Button"; import Form from "react-bootstrap/Form"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; +import Radiogroup from "../../pageElements/Radiogroup"; import { useNavigate } from "react-router-dom"; import { collection, setDoc, doc } from "firebase/firestore"; import { db } from "../../firebase"; @@ -30,6 +31,7 @@ const UploadModal = (props) => { const [fileToUpload, setFileToUpload] = useState(); const [fileToParse, setFileToParse] = useState(""); const [fileChanged, setFileChanged] = useState(); + const [radioValue, setRadioValue] = useState(""); const [showFileDetails, setShowFileDetails] = useState(""); const [titleError, setShowTitleError] = useState(""); const [docError, setShowDocError] = useState(""); @@ -40,7 +42,19 @@ const UploadModal = (props) => { process.env.NODE_ENV === "development" ? process.env.REACT_APP_API_DEV : process.env.REACT_APP_API_PROD; - console.log("apiUrl", apiUrl); + const radioOptions = [ + { + name: "Discovery request", + label: "Discovery request", + value: "discoveryRequest", + }, + { name: "Complaint", label: "Complaint", value: "complaint" }, + ]; + + const handleSetRadioValue = (e) => { + setRadioValue(e.value); + }; + async function saveToDb(uuidName) { const createdAt = new Date(); const data = { @@ -228,7 +242,17 @@ const UploadModal = (props) => { label={dateServed ? "" : "Date Served"} /> - + + {" "} +
+ handleSetRadioValue(e, "clientPosition")} + /> +
+ diff --git a/src/styles/modals.scss b/src/styles/modals.scss index 4ca0116..5e931a1 100644 --- a/src/styles/modals.scss +++ b/src/styles/modals.scss @@ -27,6 +27,7 @@ .upload-header-bold { font-weight: 500; } + .modal-document-error { margin: -10px 2px 0px 5px; color: red; From 2d30b4e5b8a25f59e19c0f5742feb9af8cfbd749 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 24 Feb 2024 01:33:40 -0600 Subject: [PATCH 03/15] more --- src/Components/Modals/UploadModal.js | 18 ++++++++++++------ src/styles/modals.scss | 5 +++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 2b39804..f257fb8 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -12,6 +12,7 @@ import { collection, setDoc, doc } from "firebase/firestore"; import { db } from "../../firebase"; import { v4 as uuidv4 } from "uuid"; import TextInput from "../../pageElements/TextInput"; +import { ExclamationTriangle } from "react-bootstrap-icons"; import Radio from "../../pageElements/Radio"; import "../../styles/modals.scss"; @@ -187,12 +188,18 @@ const UploadModal = (props) => {

- Select a .pdf file for upload. Enter title and choose document type. - (the other fields are optional.) + Select a .pdf file for upload, then 1. enter title 2. choose + document type. (the other fields are optional.)

- Select the document type.{" "} + Selecting "complaint" will automatically begin creation of discovery requests. @@ -243,13 +250,12 @@ const UploadModal = (props) => { /> - {" "}

handleSetRadioValue(e, "clientPosition")} + onClick={(e) => handleSetRadioValue(e, "documentType")} />
diff --git a/src/styles/modals.scss b/src/styles/modals.scss index 5e931a1..a412dba 100644 --- a/src/styles/modals.scss +++ b/src/styles/modals.scss @@ -71,6 +71,7 @@ } } } + .caption-one-container > .mb-3 { margin-bottom: 0px !important; } @@ -135,6 +136,10 @@ padding-left: 7px; } +.zora { + width: 160px !important; +} + @media only screen and (max-width: 820px) { .modal-body { width: 580px !important; From 89bb3fbe26f6323d595e2867f1bbdb4a18328e59 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 24 Feb 2024 02:14:39 -0600 Subject: [PATCH 04/15] more --- src/Components/Modals/UploadModal.js | 35 +++++++++++++++++++--------- src/pageElements/Radiogroup.js | 8 +++++++ src/styles/modals.scss | 17 ++++++++++++++ 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index f257fb8..8d9e547 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -32,7 +32,8 @@ const UploadModal = (props) => { const [fileToUpload, setFileToUpload] = useState(); const [fileToParse, setFileToParse] = useState(""); const [fileChanged, setFileChanged] = useState(); - const [radioValue, setRadioValue] = useState(""); + const [radioValue, setRadioValue] = useState(null); + const [radioValueError, setRadioValueError] = useState(""); const [showFileDetails, setShowFileDetails] = useState(""); const [titleError, setShowTitleError] = useState(""); const [docError, setShowDocError] = useState(""); @@ -43,11 +44,12 @@ const UploadModal = (props) => { process.env.NODE_ENV === "development" ? process.env.REACT_APP_API_DEV : process.env.REACT_APP_API_PROD; + const radioOptions = [ { name: "Discovery request", label: "Discovery request", - value: "discoveryRequest", + value: "discovery-request", }, { name: "Complaint", label: "Complaint", value: "complaint" }, ]; @@ -84,15 +86,24 @@ const UploadModal = (props) => { setFileToParse(file); setFileChanged(true); } - console.log("full request url:", `${apiUrl}/parseNewDoc`); + async function uploadFile(file) { try { - const response = await fetch(`${apiUrl}/parseNewDoc`, { - method: "POST", - body: file, - }); - const res = response; - return res; + if (true) { + const response = await fetch(`${apiUrl}/parseNewDoc`, { + method: "POST", + body: file, + }); + const res = response; + return res; + } else { + const response = await fetch(`${apiUrl}/parseNewDoc`, { + method: "POST", + body: file, + }); + const res = response; + return res; + } } catch (error) { console.error("Error:", error); } @@ -127,9 +138,10 @@ const UploadModal = (props) => { } async function handleUpload() { - if (!docTitle && !fileToParse) { + if (!docTitle && !fileToParse && !radioValue) { setShowDocError("Please select a document to upload."); setShowTitleError("Please enter a document title"); + setRadioValueError("Please select document type"); return; } else if (!docTitle) { setShowTitleError("Please enter a document title"); @@ -255,6 +267,7 @@ const UploadModal = (props) => { title="Document type" options={radioOptions} value={radioValue} + radioError={radioValueError} onClick={(e) => handleSetRadioValue(e, "documentType")} />
@@ -295,7 +308,7 @@ const UploadModal = (props) => {