From c37150a8238bc50112a51654c0d3274bb877b60f Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Tue, 5 Mar 2024 18:57:18 -0600 Subject: [PATCH] more --- src/Components/Document/ReqEditPage.js | 34 ++++++-------------------- src/Constants/Copy/docEditCopy.js | 34 +++++++++++++++++++++++++- src/styles/docedit-page.scss | 5 ++++ 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/Components/Document/ReqEditPage.js b/src/Components/Document/ReqEditPage.js index 67c0d77..10c3dfb 100644 --- a/src/Components/Document/ReqEditPage.js +++ b/src/Components/Document/ReqEditPage.js @@ -5,7 +5,10 @@ import { Link, useNavigate } from "react-router-dom"; import { AppContext } from "../../Hooks/useContext/appContext"; import EditElement from "../../pageElements/EditElement"; import LoadingSpinner from "../../pageElements/LoadingSpinner"; -import { docEditCopy } from "../../Constants/Copy/docEditCopy.js"; +import { + docEditCopy, + outgoingComesNow, +} from "../../Constants/Copy/docEditCopy.js"; import ConfirmModal from "../Modals/ConfirmModal"; import Button from "../../pageElements/Button"; import { @@ -40,9 +43,9 @@ const RequestEditPage = () => { const [showSaveModal, setShowSaveModal] = useState(false); const [isLoading, setIsLoading] = useState(false); const [isReport, setIsReport] = useState(false); - const [issueText, setIssueText] = useState(""); const [showErrorModal, setShowErrorModal] = useState(false); const [isBusy, setIsBusy] = useState(false); + // Case Vars const state = group.state[0] ? group.state[0].code : "ny"; const lawFirm = group ? group?.firm : null; const streetAdd = group ? group?.streetAddress : null; @@ -88,7 +91,6 @@ const RequestEditPage = () => { } getOutgoingRequests(documentId) .then((data) => { - console.log("data in useEffect", data); const resp = data[0].requests.map((item, index) => { // NEVER CHANGE THIS: return { showInputEle: false, text: item.text, index: index }; @@ -116,7 +118,6 @@ const RequestEditPage = () => { } async function getOutgoingRequests(docId) { - console.log("getOutgoingRequests fired, docId", docId); const docType = String(documentType); const response = await fetch( `${apiUrl}/v1/get-outgoing-requests/${docId}/${docType}`, @@ -300,20 +301,6 @@ const RequestEditPage = () => { setIsReport(true); }; - const numberingContent = (i) => { - let numText; - if (documentType === "interrogatories") { - numText = "INTERROGATORY NO.."; - } else if (documentType === "admissions") { - numText = "REQUEST FOR ADMISSION NO."; - } else if (documentType === "production") { - numText = "REQUEST FOR PRODUCTION NO."; - } else { - numText = "REQUEST NO."; - } - return
{`${numText}${i + 1} `}
; - }; - console.log("fetchedCase", fetchedCase); const respondent = fetchedCase?.clientPosition == "Defendant" ? fetchedCase?.defendantParties @@ -330,8 +317,7 @@ const RequestEditPage = () => { fetchedCase?.clientPosition === "Defendant" ? fetchedCase?.plaintiffParties : fetchedCase?.defendantParties; - console.log("requests", requests); - + console.log("state", state); const editingContent = () => { return ( <> @@ -340,13 +326,7 @@ const RequestEditPage = () => {
INTERROGATORIES AND REQUESTS FOR PRODUCTION
-
- {displayCopy.prelimaryStatement( - documentType, - respondent, - servingParty - )} -
+
{outgoingComesNow(state, fetchedCase)}
{/*displayCopy.prelimaryStatement*/}
INSTRUCTIONS
diff --git a/src/Constants/Copy/docEditCopy.js b/src/Constants/Copy/docEditCopy.js index c3dc193..e6cf19b 100644 --- a/src/Constants/Copy/docEditCopy.js +++ b/src/Constants/Copy/docEditCopy.js @@ -1,6 +1,12 @@ export const docEditCopy = { NewYork: { - prelimaryStatement: function (documentType, respondent, servingParty) { + prelimaryStatement: function ( + documentType, + respondent, + servingParty, + fetchedCase + ) { + const position = fetchedCase.clientPosition; const docCopy = documentType && documentType === "interrogatories" ? "Interrogatories" @@ -50,3 +56,29 @@ export const docEditCopy = { versusText: "vs.", }, }; + +export const outgoingComesNow = (state, fetchedCase) => { + let copyString; + const position = fetchedCase.clientPosition; + const parties = + fetchedCase.clientPosition === "Plaintiff" + ? fetchedCase.plaintiffParties + : fetchedCase.defendantParties; + const adversary = + fetchedCase.clientPosition === "Plaintiff" + ? fetchedCase.defendantParties + : fetchedCase.plaintiffParties; + + if (state === "ny") { + copyString = `COMES NOW, ${position}, ${parties}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${adversary}, to be answered under oath, in writing, in accordance with NY CPLR 3120 - 3130.`; + } else if (state === "fl") { + copyString = `COMES NOW, ${position}, ${parties}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${adversary}, to be answered to be answered under oath, in writing, in accordance with Rule 1.340, Florida Rules of Civil Procedure.`; + } else if (state === "nj") { + copyString = + `Comes now ${position}, ${parties}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${adversary}, to be answered to be answered under oath, in writing, in accordance with NJ R. 4:17-1 - 4:18-1,` + +
et. seq.
+ + `All questions must be answered unless the court otherwise orders or unless a claim of privilege or protective order is made in accordance with R. 4:17-1(b)(3).`; + } + + return
{copyString}
; +}; diff --git a/src/styles/docedit-page.scss b/src/styles/docedit-page.scss index 6d1294d..a06bb8c 100644 --- a/src/styles/docedit-page.scss +++ b/src/styles/docedit-page.scss @@ -349,6 +349,11 @@ color: #000; } +.req-edit-comesnow { + line-height: 2; + text-align: justify; +} + .scroll-button { position: fixed; top: 250px;