From b36413310385056bc674ea123ea145042f69f829 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Mon, 22 Jan 2024 15:13:05 -0600 Subject: [PATCH 1/6] more --- src/Components/Document/DocumentListPage.js | 3 ++- src/pageElements/Cards.js | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Components/Document/DocumentListPage.js b/src/Components/Document/DocumentListPage.js index 3120e46..981183d 100644 --- a/src/Components/Document/DocumentListPage.js +++ b/src/Components/Document/DocumentListPage.js @@ -171,7 +171,7 @@ const DocumentListPage = ({ perPage }) => { if (!group) { return null; } - + console.log("allDocs", allDocs); const DesktopContent = () => { return ( <> @@ -204,6 +204,7 @@ const DocumentListPage = ({ perPage }) => { parentCaseNumber={doc.parentCaseNumber} parentCaseName={doc.parentCaseName} parentCaseId={doc.parentCaseId} + createdAt={doc.createdAt} docType={doc.docType} documentId={doc.documentId} dateServed={doc.dateServed} diff --git a/src/pageElements/Cards.js b/src/pageElements/Cards.js index 90377e8..20ef58b 100644 --- a/src/pageElements/Cards.js +++ b/src/pageElements/Cards.js @@ -4,7 +4,7 @@ import { FileEarmarkText } from "react-bootstrap-icons"; import TextInput from "../pageElements/TextInput"; import Tooltip from "../pageElements/Tooltip"; import { InfoCircle } from "react-bootstrap-icons"; - +import { toDate } from "firebase/firestore"; export const InfoCard = (props) => { const { data, onEdit, onCancel, onSave, onChangeInput, isEditing, isBusy } = props; @@ -273,8 +273,13 @@ export const DocCard = (props) => { handleNavigate, responseGenerations, confirmDelete, + createdAt, } = props; - + const now = new Date().getTime(); + const temp = createdAt.toDate(); + const diff = Math.round((now - temp) / 60 / 1000); + const isReportable = diff > 15; + console.log("isRpeortable", isReportable); const report = (documentId, docType) => { console.log("report documentId, docType", documentId, docType); }; From f0f59a3d3f131c385d4bf6ac9b37e928907f0219 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Mon, 22 Jan 2024 15:16:23 -0600 Subject: [PATCH 2/6] more --- src/pageElements/Cards.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pageElements/Cards.js b/src/pageElements/Cards.js index 20ef58b..d6e67eb 100644 --- a/src/pageElements/Cards.js +++ b/src/pageElements/Cards.js @@ -286,6 +286,7 @@ export const DocCard = (props) => { const tooltipText = "Parsing is taking a bit longer than usual. This usually resolves within 10 - 15 minutes. If it does not, click “report” and support will address the issue within 24 hours."; + const disabled = docType ? false : true; return (
@@ -294,7 +295,16 @@ export const DocCard = (props) => {
- {title} {disabled ? : <>} + {title}{" "} + {disabled ? ( + isReportable ? ( + + ) : ( + + ) + ) : ( + <> + )}
{dateServed ? (
Served: {dateServed}
@@ -304,7 +314,7 @@ export const DocCard = (props) => {
{parentCaseName}
- {disabled ? ( + {disabled && isReportable ? (