IO-1037 Disable time ticket button on non converted jobs.
This commit is contained in:
@@ -49,6 +49,7 @@ const adjSpan = {
|
|||||||
|
|
||||||
export function JobsDetailLaborContainer({
|
export function JobsDetailLaborContainer({
|
||||||
jobRO,
|
jobRO,
|
||||||
|
job,
|
||||||
jobId,
|
jobId,
|
||||||
joblines,
|
joblines,
|
||||||
timetickets,
|
timetickets,
|
||||||
@@ -65,7 +66,7 @@ export function JobsDetailLaborContainer({
|
|||||||
timetickets={timetickets}
|
timetickets={timetickets}
|
||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
techConsole={techConsole}
|
techConsole={techConsole}
|
||||||
disabled={jobRO}
|
disabled={jobRO || !job.converted}
|
||||||
jobId={jobId}
|
jobId={jobId}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { GET_LINE_TICKET_BY_PK } from "../../graphql/jobs-lines.queries";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import JobsDetailLaborComponent from "./jobs-detail-labor.component";
|
import JobsDetailLaborComponent from "./jobs-detail-labor.component";
|
||||||
|
|
||||||
export default function JobsDetailLaborContainer({ jobId, techConsole }) {
|
export default function JobsDetailLaborContainer({ jobId, techConsole, job }) {
|
||||||
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
|
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
|
||||||
variables: { id: jobId },
|
variables: { id: jobId },
|
||||||
skip: !!!jobId,
|
skip: !!!jobId,
|
||||||
@@ -21,6 +21,7 @@ export default function JobsDetailLaborContainer({ jobId, techConsole }) {
|
|||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
techConsole={techConsole}
|
techConsole={techConsole}
|
||||||
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
|
||||||
|
job={job}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ export function TimeTicketList({
|
|||||||
<TimeTicketEnterButton
|
<TimeTicketEnterButton
|
||||||
actions={{ refetch }}
|
actions={{ refetch }}
|
||||||
context={{ jobId: jobId }}
|
context={{ jobId: jobId }}
|
||||||
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{t("timetickets.actions.enter")}
|
{t("timetickets.actions.enter")}
|
||||||
</TimeTicketEnterButton>
|
</TimeTicketEnterButton>
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ export function JobsDetailPage({
|
|||||||
}
|
}
|
||||||
key="labor"
|
key="labor"
|
||||||
>
|
>
|
||||||
<JobsDetailLaborContainer jobId={job.id} />
|
<JobsDetailLaborContainer job={job} jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
forceRender
|
forceRender
|
||||||
|
|||||||
Reference in New Issue
Block a user