feature/IO-3499-React-19: Ticket Ticket Issues, Employee Select Issues

This commit is contained in:
Dave
2026-01-16 16:41:56 -05:00
parent a2230be5fe
commit 5271970ec1
8 changed files with 265 additions and 207 deletions

View File

@@ -16,11 +16,15 @@ const mapDispatchToProps = () => ({});
export default connect(mapStateToProps, mapDispatchToProps)(JobCloseRoGuardLabor);
export function JobCloseRoGuardLabor({ job, bodyshop, warningCallback }) {
const jobId = job?.id ?? null;
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
variables: { id: job.id },
variables: { id: jobId },
skip: !jobId,
fetchPolicy: "network-only",
nextFetchPolicy: "network-only"
});
const {
treatments: { Enhanced_Payroll }
} = useTreatmentsWithConfig({
@@ -29,12 +33,13 @@ export function JobCloseRoGuardLabor({ job, bodyshop, warningCallback }) {
splitKey: bodyshop.imexshopid
});
if (!jobId) return <LoadingSkeleton />;
if (loading) return <LoadingSkeleton />;
if (error) return <AlertComponent title={error.message} type="error" />;
return Enhanced_Payroll.treatment === "on" ? (
<PayrollLaborAllocationsTable
jobId={job.id}
jobId={jobId}
timetickets={data ? data.timetickets : []}
refetch={refetch}
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
@@ -43,7 +48,7 @@ export function JobCloseRoGuardLabor({ job, bodyshop, warningCallback }) {
/>
) : (
<LaborAllocationsTableComponent
jobId={job.id}
jobId={jobId}
joblines={data ? data.joblines : []}
timetickets={data ? data.timetickets : []}
refetch={refetch}