Merge pull request #125 from kjannette/forward6

Forward6
This commit is contained in:
S Jannette
2024-03-05 18:58:13 -06:00
committed by GitHub
4 changed files with 53 additions and 31 deletions

View File

@@ -148,13 +148,18 @@ const DocumentListPage = ({ perPage }) => {
caseId,
documentType
) {
console.log("documentType in handleNavigate", documentType);
const _id = String(documentId);
const _resGen = String(responseGenerations);
const parentCaseId = String(caseId);
const _docType = String(documentType);
navigate(
`/docedit/${_id}/${responseGenerations}/${parentCaseId}/${documentType}`
);
if (documentType === "interrogatories-out") {
navigate(`/reqedit/${_id}/interrogatories-out/${parentCaseId}`);
} else {
navigate(
`/docedit/${_id}/${responseGenerations}/${parentCaseId}/${documentType}`
);
}
}
function handleCancelDelete() {

View File

@@ -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 <div className="numbering-container">{`${numText}${i + 1} `}</div>;
};
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 = () => {
<div className="pleading-header">
INTERROGATORIES AND REQUESTS FOR PRODUCTION
</div>
<div>
{displayCopy.prelimaryStatement(
documentType,
respondent,
servingParty
)}
</div>
<div>{outgoingComesNow(state, fetchedCase)}</div>
{/*displayCopy.prelimaryStatement*/}
<div className="doc-editing-sub-wrapper row">
<div className="pleading-header">INSTRUCTIONS</div>

View File

@@ -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,` +
<div className="jersey-itals">et. seq.</div> +
`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 <div className="req-edit-comesnow">{copyString}</div>;
};

View File

@@ -349,6 +349,11 @@
color: #000;
}
.req-edit-comesnow {
line-height: 2;
text-align: justify;
}
.scroll-button {
position: fixed;
top: 250px;