FInal changes for 1.4.0 release.

This commit is contained in:
Patrick FIc
2025-06-18 11:54:52 -07:00
parent 8e86abc25d
commit 17033cc874
6 changed files with 18 additions and 8 deletions

View File

@@ -14,13 +14,13 @@ import JobGroupMolecule from "../job-group/job-group.molecule";
import moment from "moment";
import { useReactToPrint } from "react-to-print";
export default function JobsDetailDescriptionMolecule({ loading, job }) {
export default function JobsDetailDescriptionMolecule({ loading, job, jobDetailRef }) {
const hasQuantityGreaterThan1 = useMemo(() => {
return job?.joblines?.find((jl) => !jl.ignore && jl.quantity > 1);
}, [job]);
const handlePrint = useReactToPrint({
content: () => window.jobDetailRef.current,
contentRef: jobDetailRef,
bodyClass: "audit-container-print"
});

View File

@@ -87,7 +87,9 @@ export function ReportingTotalsStatsMolecule({ reportingLoading, scoreCard, excl
Clear
</Button>
}
message={`There are ${excludedJobIds.length} jobs excluded from the totals above.`}
message={`There ${excludedJobIds.length == 1 ? "is" : "are"} ${excludedJobIds.length} job${
excludedJobIds.length > 1 ? "s" : ""
} excluded from the totals above.`}
/>
)}
</>

View File

@@ -29,7 +29,6 @@ export function JobsDetailOrganism({ selectedJobId, setSelectedJobTargetPc }) {
skip: !selectedJobId
});
const jobDetailRef = useRef();
window.jobDetailRef = jobDetailRef;
useEffect(() => {
if (data && data.jobs_by_pk)
@@ -60,7 +59,11 @@ export function JobsDetailOrganism({ selectedJobId, setSelectedJobTargetPc }) {
return (
<div ref={jobDetailRef} className="jobs-detail-container">
<Card>
<JobsDetailDescriptionMolecule loading={loading} job={data ? data.jobs_by_pk : null} />
<JobsDetailDescriptionMolecule
loading={loading}
job={data ? data.jobs_by_pk : null}
jobDetailRef={jobDetailRef}
/>
</Card>
<Card title="Job Targets">
<JobsTargetsStatsMolecule loading={loading} job={data ? data.jobs_by_pk : null} />