diff --git a/src/Components/Dashboard/Dashboard.js b/src/Components/Dashboard/Dashboard.js index 97571ae..30499e3 100644 --- a/src/Components/Dashboard/Dashboard.js +++ b/src/Components/Dashboard/Dashboard.js @@ -30,6 +30,7 @@ const Dashboard = () => { const { group } = appState; const appUserId = group ? group.appUserId : null; const isDashboard = true; + useEffect(() => { if (count.current == null) { setIsMobile(window.innerWidth < 440); diff --git a/src/Components/Document/DocumentListPage.js b/src/Components/Document/DocumentListPage.js index 70defbc..2653da0 100644 --- a/src/Components/Document/DocumentListPage.js +++ b/src/Components/Document/DocumentListPage.js @@ -136,6 +136,10 @@ const DocumentListPage = ({ perPage }) => { { label: "Associated case name z - a", value: "parentCaseName2" }, ]; + const handleNovos = (e) => { + navigate("/how-to"); + }; + function handleNavigate( documentId, responseGenerations, @@ -188,7 +192,16 @@ const DocumentListPage = ({ perPage }) => {
-
Response Verbosity
+
+ {" "} +

+ Novos +

+

Min

diff --git a/src/Components/Login/Login.js b/src/Components/Login/Login.js index 7a061e1..dc92567 100644 --- a/src/Components/Login/Login.js +++ b/src/Components/Login/Login.js @@ -20,12 +20,14 @@ const Login = () => { } setIsBusy(true); setNotice(""); + try { const userCredential = await signInWithEmailAndPassword( auth, email, password ); + // Signed in userCredential?.user && navigate("/dashboard"); } catch (error) { diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 1f1fa10..9c0e968 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -6,11 +6,13 @@ import Button from "../../pageElements/Button"; import Form from "react-bootstrap/Form"; import Row from "react-bootstrap/Row"; import Col from "react-bootstrap/Col"; +import Radiogroup from "../../pageElements/Radiogroup"; import { useNavigate } from "react-router-dom"; import { collection, setDoc, doc } from "firebase/firestore"; import { db } from "../../firebase"; import { v4 as uuidv4 } from "uuid"; import TextInput from "../../pageElements/TextInput"; +import { ExclamationTriangle } from "react-bootstrap-icons"; import Radio from "../../pageElements/Radio"; import "../../styles/modals.scss"; @@ -30,6 +32,8 @@ const UploadModal = (props) => { const [fileToUpload, setFileToUpload] = useState(); const [fileToParse, setFileToParse] = useState(""); const [fileChanged, setFileChanged] = useState(); + const [radioValue, setRadioValue] = useState(null); + const [radioValueError, setRadioValueError] = useState(""); const [showFileDetails, setShowFileDetails] = useState(""); const [titleError, setShowTitleError] = useState(""); const [docError, setShowDocError] = useState(""); @@ -41,6 +45,19 @@ const UploadModal = (props) => { ? process.env.REACT_APP_API_DEV : process.env.REACT_APP_API_PROD; + const radioOptions = [ + { + name: "Discovery request", + label: "Discovery request", + value: "discovery-request", + }, + { name: "Complaint", label: "Complaint", value: "complaint" }, + ]; + + const handleSetRadioValue = (e) => { + setRadioValue(e.value); + }; + async function saveToDb(uuidName) { const createdAt = new Date(); const data = { @@ -72,12 +89,21 @@ const UploadModal = (props) => { async function uploadFile(file) { try { - const response = await fetch(`${apiUrl}/parseNewDoc`, { - method: "POST", - body: file, - }); - const res = response; - return res; + if (radioValue === "complaint") { + const response = await fetch(`${apiUrl}/v1/gen-disc-request`, { + method: "POST", + body: file, + }); + const res = response; + return res; + } else { + const response = await fetch(`${apiUrl}/parseNewDoc`, { + method: "POST", + body: file, + }); + const res = response; + return res; + } } catch (error) { console.error("Error:", error); } @@ -112,9 +138,10 @@ const UploadModal = (props) => { } async function handleUpload() { - if (!docTitle && !fileToParse) { + if (!docTitle && !fileToParse && !radioValue) { setShowDocError("Please select a document to upload."); setShowTitleError("Please enter a document title"); + setRadioValueError("Please select document type"); return; } else if (!docTitle) { setShowTitleError("Please enter a document title"); @@ -173,17 +200,37 @@ const UploadModal = (props) => {

- Select a document in pdf format for upload. Enter the document title - below. Document description is optional. + Select a .pdf file for upload, then 1. enter title, and 2. choose + document type (other fields optional).

- This document will be associated with {caption} v. {captionTwo} + The document created will be associated with{" "} + + {caption} v. {captionTwo} + {caseNumber ? `, ${caseNumber}` : ""}.

- If that is not the case you want to associate with this document, - click "cancel", go back and select the intended case from your - active case list. + If that is not the correct case: 1. click cancel 2. click back, then + 3. select correct case from active cases. +

+

+ + + NOTE: Selecting incorrect document type may result in errors. +

+ Clicking upload begins document creation. +

+ +

+

+ Document credit will be debited from account.

@@ -219,9 +266,19 @@ const UploadModal = (props) => { label={dateServed ? "" : "Date Served"} /> - + +
+ handleSetRadioValue(e, "documentType")} + /> +
+ - + Select Document
@@ -256,7 +313,7 @@ const UploadModal = (props) => {
- Parsing the document usually takes under 2 minutes, but be patient - - it may take up to 5. + Parsing the document for language processing usually takes fewer + than 2 minutes, but be patient - it may take up to 5.
@@ -46,8 +46,16 @@ export const Steps = () => ( 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 any time by clicking the “Save Changes” button. + the interactive Document Editor. Note the Response Novos toggle button - + this controls the amount of logical branching used in forumilting hte + response language. You can edit the responses and save progress any time + by clicking the “Save Changes” button. +
+
+ Novos level: this controls the amount of branching applied in deductive + persuasion. At the higher setting, the LLM will generate persuasive + rhetoric beyond the statement of an authoritative rule – additional + attention will be given to application of the rule to factual scenarios.{" "}
DOWNLOAD YOUR RESPONSE DOCUMENT: diff --git a/src/pageElements/Radiogroup.js b/src/pageElements/Radiogroup.js index 1ecd057..39228d7 100644 --- a/src/pageElements/Radiogroup.js +++ b/src/pageElements/Radiogroup.js @@ -12,6 +12,7 @@ const Radiogroup = (props) => { value, options, disabled, + radioError, } = props; const classCheckbox = "checkbox"; const classOption = "option"; @@ -81,6 +82,13 @@ const Radiogroup = (props) => {
))}
+
+ {radioError ? ( +
{radioError}
+ ) : ( + <> + )} +
); }; diff --git a/src/styles/doclist-page.scss b/src/styles/doclist-page.scss index f49e45a..ca5eae5 100644 --- a/src/styles/doclist-page.scss +++ b/src/styles/doclist-page.scss @@ -68,6 +68,10 @@ .toggle-outer { display: flex; flex-direction: column; + border: 1px solid var(--accent-orange-light); + margin-right: 12px; + border-radius: 10px; + background-color: var(--background-blue); } .toggle-box { @@ -81,13 +85,18 @@ .toggle-header { display: flex; justify-content: center; - padding-right: 12px; - margin-top: -8px; + padding-right: 7px; height: 28px; } -.list-upper-right { - // +.doclist-toggle-link { + color: blue; +} + +.doclist-toggle-link:hover { + cursor: pointer; + color: orange; + text-decoration: underline; } .document-list-lower-wrapper { diff --git a/src/styles/modals.scss b/src/styles/modals.scss index 133bf3f..920ccfc 100644 --- a/src/styles/modals.scss +++ b/src/styles/modals.scss @@ -12,21 +12,38 @@ } .modal-header-text-wrapper { - margin-bottom: 12px; + margin-bottom: 18px; padding: 0px 8px; } .upload-modal-header-text { font-family: Roboto; + font-size: 0.89rem; font-weight: 400; - line-height: 1.25rem; + line-height: 1.1rem; margin: 0px 0px 10px 0px; + + &.right { + margin-top: -7px; + margin-left: 23px; + } + &.indent { + margin-left: 23px; + } +} + +.upload-header-bold { + font-weight: 500; +} + +.file-upload-row { + margin-top: 6px; } .modal-document-error { margin: -10px 2px 0px 5px; color: red; - font-size: 0.85rem; + font-size: 0.89rem; } .create-modal-header { @@ -66,6 +83,7 @@ } } } + .caption-one-container > .mb-3 { margin-bottom: 0px !important; } @@ -130,6 +148,27 @@ padding-left: 7px; } +.zora { + width: 160px !important; +} + +.radio-wrapper { + height: 110px; +} + +.radio-option-container { + display: flex; + flex-direction: column; +} + +.checkbox-option-div { + height: 20px; +} +.radio-error-box { + margin-top: 16px; + margin-left: -3px; +} + @media only screen and (max-width: 820px) { .modal-body { width: 580px !important;