From c5ddfa221aa5298ccbae5d4736d7dd165a239cb9 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sat, 20 Jan 2024 22:17:57 -0600 Subject: [PATCH 01/24] more --- src/Constants/Copy/howToSteps.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Constants/Copy/howToSteps.js b/src/Constants/Copy/howToSteps.js index 3b33760..2aa7799 100644 --- a/src/Constants/Copy/howToSteps.js +++ b/src/Constants/Copy/howToSteps.js @@ -12,17 +12,16 @@ export const Steps = () => ( information -- case name, case number, parties, etc. -- and click “Save Case”. The modal will close, returning you to the{" "} Case View. - -
  • On the newly-created case info card, click the “View” button (far right) to navigate to its Case Details View. Click “Upload Document” to surface the Document Upload Modal.
  • - UPLOAD A DOCUMENT: On the Document Upload Modal, enter - the document title, i.e. “Defendant’s Interrogatories,” and (optionally) - the date served. Drag and drop or click to select the request document - from your files. The document must be in .pdf format. + UPLOAD YOUR DOCUMENT: On the Document Upload Modal, + enter the document title, i.e. “Defendant’s Interrogatories,” and + (optionally) the date served. Drag and drop or click to select the + request document from your files.{" "} + The document must be in .pdf format.
    {" "}

    Click “Upload”, and will you automatically navigate to the Document @@ -30,12 +29,17 @@ export const Steps = () => (

    {" "}
  • - GENERATE THE DISCOVERY RESPONSE: Click the “Generate - Responses'' button. Novdraft’s Intellidraft AI will generate the - response and automatically navigate to the interactive Document Editor. - You can edit the responses and save progress anytime by clicking the - “Save Changes” button. When you are satisfied, you can download a .docx - file by clicking the “Create .docx File” button. + GENERATE THE RESPONSE: From the Document List View, + click the “Generate Responses'' button. Novdraft’s Intellidraft AI will + generate the response and automatically navigate to the interactive + Document Editor. You can edit the responses and save progress anytime by + clicking the “Save Changes” button. When you are satisfied, you can + download a .docx file by clicking the “Create .docx File” button. +
  • +
  • + DOWNLOAD YOUR RESPONSE DOCUMENT: Click the “Create + .Docx' button to downlaod your fully-formatted, ready-to-serve response. + Or, if you want, edit first to tailor it to your needs.
  • Date: Sat, 20 Jan 2024 22:21:46 -0600 Subject: [PATCH 02/24] more --- src/Constants/Copy/howToSteps.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Constants/Copy/howToSteps.js b/src/Constants/Copy/howToSteps.js index 2aa7799..7f89367 100644 --- a/src/Constants/Copy/howToSteps.js +++ b/src/Constants/Copy/howToSteps.js @@ -39,7 +39,6 @@ export const Steps = () => (
  • DOWNLOAD YOUR RESPONSE DOCUMENT: Click the “Create .Docx' button to downlaod your fully-formatted, ready-to-serve response. - Or, if you want, edit first to tailor it to your needs.
  • Date: Sun, 21 Jan 2024 15:06:51 -0600 Subject: [PATCH 03/24] more --- src/Components/Modals/CreateModal.js | 22 +--------------------- src/Constants/Fields/CreateCaseFields.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 src/Constants/Fields/CreateCaseFields.js diff --git a/src/Components/Modals/CreateModal.js b/src/Components/Modals/CreateModal.js index 776c6c3..b81e87a 100644 --- a/src/Components/Modals/CreateModal.js +++ b/src/Components/Modals/CreateModal.js @@ -11,6 +11,7 @@ import { collection, setDoc, updateDoc, doc } from "firebase/firestore"; import { AppContext } from "../../Hooks/useContext/appContext.js"; import { db } from "../../firebase"; import { objectMap } from "../../Utils/Object"; +import { createCaseFields as fields } from "../../Constants/Fields/CreateCaseFields.js"; import "../../styles/modals.scss"; import { getFormDataDefaults, @@ -29,27 +30,6 @@ const CreateModal = ({ setShowModal, caseData }) => { const editCaseId = caseData?.id; const isEditing = typeof editCaseId !== "undefined"; - const fields = { - caption: { required: true, maxLength: 45 }, - captionTwo: { required: true, maxLength: 45 }, - caseNumber: { required: true, maxLength: 45 }, - judge: { required: true, maxLength: 45 }, - plaintiffParties: { required: true, maxLength: 45 }, - defendantParties: { required: true, maxLength: 45 }, - jurisdiction: { required: true, maxLength: 45 }, - billingCode: { required: true, maxLength: 45 }, - venue: { required: true, maxLength: 45 }, - caseType: { required: true, maxLength: 45 }, - trialDate: { required: true, maxLength: 45, type: "date" }, - filedDate: { required: true, maxLength: 45, type: "date" }, - contactFirstName: { required: true, maxLength: 45 }, - contactLastName: { required: true, maxLength: 45 }, - contactEmail: { required: true, maxLength: 45, type: "email" }, - leadAttorneys: { required: true, maxLength: 45 }, - lawFirm: { required: false, maxLength: 45 }, - clientPosition: { required: true, default: "Defendant" }, - }; - const [isBusy, setIsBusy] = useState(false); const [data, setData] = useState( getFormDataDefaults(fields, isEditing ? caseData : undefined) diff --git a/src/Constants/Fields/CreateCaseFields.js b/src/Constants/Fields/CreateCaseFields.js new file mode 100644 index 0000000..8a20778 --- /dev/null +++ b/src/Constants/Fields/CreateCaseFields.js @@ -0,0 +1,20 @@ +export const createCaseFields = { + caption: { required: true, maxLength: 45 }, + captionTwo: { required: true, maxLength: 45 }, + caseNumber: { required: true, maxLength: 45 }, + judge: { required: true, maxLength: 45 }, + plaintiffParties: { required: true, maxLength: 45 }, + defendantParties: { required: true, maxLength: 45 }, + jurisdiction: { required: true, maxLength: 45 }, + billingCode: { required: true, maxLength: 45 }, + venue: { required: true, maxLength: 45 }, + caseType: { required: true, maxLength: 45 }, + trialDate: { required: true, maxLength: 45, type: "date" }, + filedDate: { required: true, maxLength: 45, type: "date" }, + contactFirstName: { required: true, maxLength: 45 }, + contactLastName: { required: true, maxLength: 45 }, + contactEmail: { required: true, maxLength: 45, type: "email" }, + leadAttorneys: { required: true, maxLength: 45 }, + lawFirm: { required: false, maxLength: 45 }, + clientPosition: { required: true, default: "Defendant" }, +}; From d349c98fcc01fb627dd3aea770a6b00604d39dfe Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sun, 21 Jan 2024 15:12:59 -0600 Subject: [PATCH 04/24] more --- src/Components/SignupPage/SignupPage.js | 1 - src/Utils/Form.js | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Components/SignupPage/SignupPage.js b/src/Components/SignupPage/SignupPage.js index 900991c..8328b3a 100644 --- a/src/Components/SignupPage/SignupPage.js +++ b/src/Components/SignupPage/SignupPage.js @@ -180,7 +180,6 @@ const SignupPage = () => { {names.map((name, i) => ( - {console.log("data, name", data, name)} { return null; }; -export const isFormDataHasErrors = (data) => - Object.values(data).reduce( +export const isFormDataHasErrors = (data) => { + console.log("data", data); + return Object.values(data).reduce( (hasErrors, { error }) => hasErrors || error, false ); +}; From 81f4e07633b4570f968988bc2411b86d15ef5359 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Sun, 21 Jan 2024 15:36:58 -0600 Subject: [PATCH 05/24] more --- src/Components/Modals/CreateModal.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Components/Modals/CreateModal.js b/src/Components/Modals/CreateModal.js index b81e87a..489ccc1 100644 --- a/src/Components/Modals/CreateModal.js +++ b/src/Components/Modals/CreateModal.js @@ -45,14 +45,13 @@ const CreateModal = ({ setShowModal, caseData }) => { const validateData = () => { const newData = getValidatedFormData(data, fields); const hasErrors = isFormDataHasErrors(newData); + console.log("create hasErrors", hasErrors); setData(newData); return hasErrors ? null : objectMap(({ value }) => value, newData); }; - async function saveCaseData() { - const dataValues = validateData(); - - if (dataValues === null) { + async function saveCaseData(dataValues) { + if (isBusy) { return; } setIsBusy(true); @@ -90,10 +89,20 @@ const CreateModal = ({ setShowModal, caseData }) => { } }; - const handleCreate = () => { - if (!isBusy) { - void saveCaseData(); + const handleCreateCase = (e) => { + e.preventDefault(); + const dataValues = validateData(); + + if (dataValues === null) { + return; + } else { + try { + saveCaseData(dataValues); + } catch (err) { + console.log(err); + } } + navigate("/dashboard"); }; @@ -528,7 +537,7 @@ const CreateModal = ({ setShowModal, caseData }) => {