Merge pull request #136 from kjannette/tie

Tie
This commit is contained in:
S Jannette
2024-03-07 15:47:48 -06:00
committed by GitHub
4 changed files with 50 additions and 5 deletions

View File

@@ -45,6 +45,7 @@ const DocEditPage = () => {
);
const [index, setIndex] = useState(0);
const [isBusy, setIsBusy] = useState(false);
const fbUserId = group ? group.fbAuthUid : null;
// For document generation:
const state = group?.state[0] ? group.state[0].code : "ny";
const lawFirm = group ? group?.firm : null;
@@ -287,6 +288,7 @@ const DocEditPage = () => {
});
setResponses(result);
updateRespGenerationCount(documentId);
updateUserAccountDocsGenerated(fbUserId);
setIsLoading(false);
})
.catch((err) => console.log(err));
@@ -449,7 +451,19 @@ const DocEditPage = () => {
}
}
async function updateUserAccountDocsGenerated(fbUserId) {
await updateDoc(doc(db, "users", fbUserId), {
docsGenerated: increment(1),
});
}
async function updateRespGenerationCount(docId) {
console.log("updaeeResponseGenerationCount fired");
if (!docId) {
return;
}
console.log("updaeeResponseGenerationCount past if block");
await updateDoc(doc(db, "documents", docId), {
responseGenerations: increment(1),
});

View File

@@ -281,7 +281,8 @@ export const DocCard = (props) => {
const now = new Date().getTime();
const uploadedAt = new Date(createdAtTime * 1000);
const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15;
console.log("responseGenerations", responseGenerations);
console.log("docType", docType);
const disabled = docType ? false : true;
const tooltipText =
"Parsing is taking a bit longer than usual. This usually resolves within 15 minutes. If it does not, click “report” and support will address the issue within 24 hours.";
@@ -297,9 +298,9 @@ export const DocCard = (props) => {
const isOutbound = docType === "interrogatories-out";
const buttonText =
docType === "interrogatories-out"
docType === "interrogatories" && responseGenerations > 0
? "Edit Request"
: responseGenerations > 1
: docType === "interrogatories-out"
? "Edit Response"
: "Generate Response";
return (

View File

@@ -1,4 +1,4 @@
import { CircleFill, Circle } from "react-bootstrap-icons";
import { CircleFill, Circle, ExclamationTriangle } from "react-bootstrap-icons";
const Radiogroup = (props) => {
const {
@@ -19,7 +19,23 @@ const Radiogroup = (props) => {
return (
<div className="radio-option-container">
{title && <div className="checkbox-title">{title}</div>}
<div className="radio-group-title-box">
{title === "Document type" ? (
<div className="checkbox-title-icon-box">
<ExclamationTriangle
style={{
color: "red",
marginRight: "8px",
marginBottom: "6px",
}}
/>
</div>
) : (
<></>
)}
{title && <div className="checkbox-title">{title}</div>}
</div>
<div className="checkbox-option-div">
{options &&
options?.length &&

View File

@@ -27,6 +27,20 @@
border-radius: 6px;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}
.radio-group-title-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: left;
}
.checkbox-title-icon-box {
margin-top: 3px;
margin-left: 2px;
margin-right: 1px;
}
.checkbox-option-div {
display: flex;
flex-direction: row;