diff --git a/src/Components/Case/CaseDetailsPage.js b/src/Components/Case/CaseDetailsPage.js index a5adff7..4511208 100644 --- a/src/Components/Case/CaseDetailsPage.js +++ b/src/Components/Case/CaseDetailsPage.js @@ -1,5 +1,5 @@ import React, { useEffect, useContext, useState } from "react"; -import { useNavigate } from "react-router-dom"; +import { useNavigate, Link } from "react-router-dom"; import { DetailCard } from "../../pageElements/DetailCard.js"; import Button from "../../pageElements/Button"; import CreateModal from "../Modals/CreateModal.js"; @@ -9,6 +9,7 @@ import { db } from "../../firebase"; import { useParams } from "react-router-dom"; import { AppContext } from "../../Hooks/useContext/appContext.js"; import LoadingSpinner from "../../pageElements/LoadingSpinner"; +import { ArrowLeft } from "react-bootstrap-icons"; import { doc, getDoc, @@ -22,6 +23,7 @@ const CaseDetailsPage = () => { const [subCase, setSubCase] = useState(null); const navigate = useNavigate(); const [showUploadModal, setShowUploadModal] = useState(); + const [uploadType, setUploadType] = useState(); const [showCreateModal, setShowCreateModal] = useState(); const [showConfirmModal, setShowConfirmModal] = useState(); const [isLoading, setIsLoading] = useState(false); @@ -167,14 +169,6 @@ const CaseDetailsPage = () => { fetchData(); }, [fbUserId]); - const handleUploadDoc = () => { - if (docsAllowed - docsGenerated > 0) { - setShowUploadModal(true); - } else { - setShowConfirmModal(true); - } - }; - const handleNavigate = (docId, caseId) => { getDocument(docId, caseId); }; @@ -186,8 +180,22 @@ const CaseDetailsPage = () => { navigate(`/reqedit/${documentId}/interrogatories-out/${caseId}`); }; - const handleBack = () => { - navigate("/cases"); + const handleUploadDoc = () => { + if (docsAllowed - docsGenerated > 0) { + setUploadType("discovery"); + setShowUploadModal(true); + } else { + setShowConfirmModal(true); + } + }; + + const handleUploadComplaint = () => { + if (docsAllowed - docsGenerated > 0) { + setUploadType("complaint"); + setShowUploadModal(true); + } else { + setShowConfirmModal(true); + } }; const handleConfirmDocType = (docType) => { @@ -208,23 +216,33 @@ const CaseDetailsPage = () => { return (
-
-
+
@@ -270,6 +288,7 @@ const CaseDetailsPage = () => { handleConfirmDocType={handleConfirmDocType} fbUserId={fbUserId} clientPosition={subCase.clientPosition} + uploadType={uploadType} /> ) : null ) : null} diff --git a/src/Components/Dashboard/Dashboard.js b/src/Components/Dashboard/Dashboard.js index 5afb2c8..b7475e6 100644 --- a/src/Components/Dashboard/Dashboard.js +++ b/src/Components/Dashboard/Dashboard.js @@ -247,7 +247,7 @@ const Dashboard = () => {

- {Math.round(responseCount * 3.2989 * 100) / 100} hours saved + {Math.round(responseCount * 3.1799 * 10) / 10} hours saved using Novodraft

diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 6e9a9d0..e3710ed 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -35,6 +35,7 @@ const UploadModal = (props) => { setIsLoading, clientPosition, fbUserId, + uploadType, } = props; const { caseId, caseNumber, jurisdiction, caption, captionTwo } = caseData; const [docTitle, setDocTitle] = useState(""); @@ -43,14 +44,19 @@ const UploadModal = (props) => { const [fileToUpload, setFileToUpload] = useState(); const [fileToParse, setFileToParse] = useState(""); const [fileChanged, setFileChanged] = useState(); - const [radioValue, setRadioValue] = useState(null); + const [radioValue, setRadioValue] = useState(uploadType); const [radioValueError, setRadioValueError] = useState(""); const [showFileDetails, setShowFileDetails] = useState(""); const [titleError, setShowTitleError] = useState(""); const [docError, setShowDocError] = useState(""); const fileTypes = ["PDF"]; const fileName = fileToParse ? fileToParse.name : undefined; - + console.log("uploadType", uploadType); + console.log("radioValue", radioValue); + const currentType = + uploadType === "complaint" ? "complaint" : "discovery request"; + const otherType = + uploadType === "complaint" ? "discovery request" : "complaint"; let docType; const apiUrl = process.env.NODE_ENV === "development" @@ -226,7 +232,7 @@ const UploadModal = (props) => { return ( - Document Upload + Upload {currentType}
@@ -250,19 +256,17 @@ const UploadModal = (props) => { - NOTE: Selecting incorrect document type may result in errors. -

- Clicking upload begins document creation. + YOU ARE UPLOADING A {currentType.toUpperCase()} +

+ If you intended to upload a {otherType} - click "cancel", then + select {otherType}

-

- Document credit will be debited from account. -

@@ -272,7 +276,14 @@ const UploadModal = (props) => { name={"title"} value={docTitle} onChange={handleTitleInput} - label={docTitle ? "" : "Title"} + label={ + docTitle + ? "" + : `${ + currentType.split("")[0].toUpperCase() + + currentType.substring(1, 20) + } title` + } error={!!titleError} message={titleError} /> @@ -283,7 +294,10 @@ const UploadModal = (props) => { name={"description"} value={docDescription} onChange={handleDescInput} - label="Description" + label={`${ + currentType.split("")[0].toUpperCase() + + currentType.substring(1, 20) + } description`} /> @@ -294,24 +308,23 @@ const UploadModal = (props) => { name={"date"} value={dateServed} onChange={handleDateInput} - label={dateServed ? "" : "Date Served"} + label={ + dateServed + ? "" + : `${ + currentType.split("")[0].toUpperCase() + + currentType.substring(1, 20) + } date served` + } /> -
- handleSetRadioValue(e, "documentType")} - /> -
+
- Select Document + Select {currentType}
{
{fileToParse ? fileToParse[0]?.name - : "Click to select a file or drag and drop here"} + : "Click to select file or drag and drop here"}
@@ -352,3 +365,13 @@ const UploadModal = (props) => { }; export default UploadModal; + +/* + handleSetRadioValue(e, "documentType")} + /> + */ diff --git a/src/Components/OptoutPage.js b/src/Components/OptoutPage.js index 488742a..32443ef 100644 --- a/src/Components/OptoutPage.js +++ b/src/Components/OptoutPage.js @@ -58,6 +58,7 @@ const OptoutPage = () => { if (dataValues === null) { return; } + console.log("datavalues", dataValues); saveRequestData(dataValues); navigate("/"); } diff --git a/src/styles/case-details.scss b/src/styles/case-details.scss index 3129104..fbd46f0 100644 --- a/src/styles/case-details.scss +++ b/src/styles/case-details.scss @@ -61,6 +61,20 @@ margin-right: 1px; } +.details-complaint-button-box { + display: flex; + flex-direction: row; + justify-content: flex-end; + margin-top: 8px; + margin-right: 1px; +} + +.details-complaint-button-box > .back-button { + &:hover { + border: 2px solid #f27300; + } +} + .back-button-box { margin-right: 8px; } @@ -102,12 +116,44 @@ display: flex; flex-direction: row; justify-content: flex-end; + padding-left: 16px; +} + +.details-butn-wrapper > .primary-button { + margin-right: 5px; } .upload-button-box { margin-left: 8px; } +.details-upload-button-box { + display: flex; + justify-content: flex-end; + width: 260px; + margin-left: 8px; +} + +.details-upload-button-box > .primary-button { + width: 250px; +} + +.details-upload-button-box { + &button { + width: 220px; + } +} + +.details-butn-sub-wrapper-r { + width: 50%; +} + +.details-butn-sub-wrapper-l { + display: flex; + justify-content: flex-end; + width: 50%; + padding-right: 5px; +} .detail-text { // } @@ -121,3 +167,15 @@ flex-direction: column; flex-grow: 3; } + +.arrow-wrapper > svg { + margin-bottom: 4px !important; + margin-right: 4px !important; + margin-left: 5px; +} + +.details-back-wrapper { + margin-left: 4px; + font-size: 1.04rem; + padding-top: 3px; +} diff --git a/src/styles/modals.scss b/src/styles/modals.scss index 920ccfc..09d592d 100644 --- a/src/styles/modals.scss +++ b/src/styles/modals.scss @@ -30,6 +30,9 @@ &.indent { margin-left: 23px; } + &.red { + color: red; + } } .upload-header-bold {