From 356c398b6ab07b17d19251fd3b0fbf1d2f9ecda7 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Tue, 5 Mar 2024 21:17:42 -0600 Subject: [PATCH] more --- src/Components/Document/ReqEditPage.js | 64 ++++++++++++++++++++++---- src/Constants/Copy/reqEditCopy.js | 13 ++++++ 2 files changed, 67 insertions(+), 10 deletions(-) diff --git a/src/Components/Document/ReqEditPage.js b/src/Components/Document/ReqEditPage.js index dd2e0a9..0c73521 100644 --- a/src/Components/Document/ReqEditPage.js +++ b/src/Components/Document/ReqEditPage.js @@ -35,8 +35,10 @@ const RequestEditPage = () => { const { group } = appState; const navigate = useNavigate(); const [requests, setRequests] = useState([1]); + const [prodReq, setProdReq] = useState(); const [fetchedCase, setFetchedCase] = useState(); const [showInputEle, setShowInputEle] = useState(true); + const [showprodInputEle, setShowprodInputEle] = useState(true); const [document, setDocument] = useState(null); const appUserId = group ? group?.appUserId : null; const [docId, setDocId] = useState(documentId); @@ -46,6 +48,7 @@ const RequestEditPage = () => { const [isReport, setIsReport] = useState(false); 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; @@ -85,6 +88,7 @@ const RequestEditPage = () => { return { showInputEle: false, text: item.text, index: index }; }); setRequests(resp); + setProdReq(standardProd); }) .catch((err) => console.log(err)); }, [documentId]); @@ -235,6 +239,19 @@ const RequestEditPage = () => { setRequests(newSelectedrequests); }; + const handleProdBlur = (e, i) => { + const newSelectedrequests = requests?.map((r) => { + if (r.index === i) { + return { + ...r, + showInputEle: !showInputEle, + }; + } + return r; + }); + setRequests(newSelectedrequests); + }; + const handleFocus = (arg, i) => { const newSelectedrequests = requests?.map((r) => { if (r.index === i) { @@ -248,11 +265,22 @@ const RequestEditPage = () => { setRequests(newSelectedrequests); }; + const handleProdFocus = (arg, i) => { + const newSelectedrequests = requests?.map((r) => { + if (r.index === i) { + return { + ...r, + showInputEle: !showInputEle, + }; + } + return r; + }); + setRequests(newSelectedrequests); + }; + const handleEditValue = (e, i) => { - console.log("e,i ", e, i); const editingRes = requests?.map((r) => { if (r.index === i) { - console.log("r.inex", r.index); return { ...r, text: e.target.value, @@ -263,6 +291,20 @@ const RequestEditPage = () => { setRequests(editingRes); }; + const handleEditProdValue = (e, i) => { + console.log("e,i ", e, i); + const editingProd = standardProd?.map((r) => { + if (r.index === i) { + return { + ...r, + text: e.target.value, + }; + } + return r; + }); + setProdReq(editingProd); + }; + const handleBack = () => { navigate(`/documents`); }; @@ -365,24 +407,26 @@ const RequestEditPage = () => {
REQUESTS FOR PRODUCTION
- {standardProd?.map((req, i) => ( + {prodReq?.map((preq, i) => (
{`${i + 1}.`}
1 + standardProd && standardProd.length > 1 ? // NEVER CHANGE THIS - req.text + preq.text : null } - setShowInputEle={setShowInputEle} + setShowInputEle={setShowprodInputEle} showInputEle={ - requests && requests.length > 1 ? req.showInputEle : null + standardProd && standardProd.length > 1 + ? preq.showInputEle + : null } - handleFocus={handleFocus} - handleEditValue={handleEditValue} - handleBlur={handleBlur} + handleFocus={handleProdFocus} + handleEditValue={handleEditProdValue} + handleBlur={handleProdBlur} i={i} />
diff --git a/src/Constants/Copy/reqEditCopy.js b/src/Constants/Copy/reqEditCopy.js index 04cbe73..9234be9 100644 --- a/src/Constants/Copy/reqEditCopy.js +++ b/src/Constants/Copy/reqEditCopy.js @@ -104,53 +104,66 @@ export const standardProd = [ { id: "e0863692-c5da-4516-b85c-233a7f811a34", text: "All documents identified, directly or indirectly, in your answers to Interrogatories.", + index: 0, }, { id: "0d648f06-b6f9-4264-bcf2-c3111fe3f976", text: "All written reports of all expert witnesses with whom you or your attorneys have consulted, including, of course, those persons you expect to call as an expert witness at trial.", + index: 1, }, { id: "8c8573de-1a5c-4828-ba99-d51f610136a5", text: "All documents upon which any expert witness upi intend to call at trial relied upon in formulating an opinion about the subject matter of this action.", + index: 2, }, { id: "63ab0999-c877-4ebc-9094-6d343294411d", text: "The most recent curriculum vitae of each expert whom you expect to call as an expert witness at trial.", + index: 3, }, { id: "5b3ac105-c026-4f37-b335-2ab83adb6658", text: "All notes, correspondence, bills, invoices, diagrams, photographs, or other documents prepared or reviewed by each person whom you expect to call as an expertwitness at trial.", + index: 4, }, { id: "eb382a63-1c0b-4a78-9bba-d67380bb6367", text: "All invoices generated by expert witnesses generated for performing all expert witness services to you, including but not limited to, fees for the medical examination, the records review, the pretrial preparation, any telephone conference, any trial testimony anticipated and any other fee paid for expert fees.", + index: 5, }, { id: "a07bbc03-2f14-4837-965b-67ee261f25e4", text: "Any and all written, recorded, or signed statements of any party, including the plaintiff, defendant, witnesses, investigators, or agent, representative or employee of the parties concerning the subject matter of this action.", + index: 6, }, { id: "495b094d-36f2-4a83-971e-54b1b5312515", text: "All documents, photographs, videotapes or audio tapes, recordings in any medium, diagnostic images, diagrams, records, surveys or other graphic representations of information concerning the subject matter of this action.", + index: 7, }, { id: "cdcc44cf-13b2-4011-adb5-ed435156a0f8", text: "Any documents which afforded, descirbed or pertained to liability insurance coverage for the occurrences which are the subject matter of the complaint.", + index: 8, }, { id: "7b85bf1d-ce31-4cb5-baac-b678f3afb418", text: "Any documents identified in any other parties’ answers to Interrogatories in your possession, if any.", + index: 9, }, { id: "5b2033f9-2d14-49d4-848a-8c3630bb78d8", text: "Any documents received pursuant to a subpoena request in this case.", + index: 10, }, { id: "fe9ce1d8-265f-4ebc-9856-99715cbb23ee", text: "Any document prepared during the regular course of business as a result of the occurrence complained of in the complaint.", + index: 11, }, { id: "0012041e-8618-4864-b084-9c354261731a", text: "Copies of any treaties, standards in the industry, legal authority, rule, case, statute, or code that will be relied upon in the defense of this case.", + index: 12, }, ];