Added validation to job actions BOD-391
This commit is contained in:
@@ -30,7 +30,7 @@ export function JobLinesComponent({
|
||||
setSearchText,
|
||||
selectedLines,
|
||||
setSelectedLines,
|
||||
jobId,
|
||||
job,
|
||||
setJobLineEditContext,
|
||||
}) {
|
||||
const [state, setState] = useState({
|
||||
@@ -308,12 +308,14 @@ export function JobLinesComponent({
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
disabled={selectedLines.length > 0 ? false : true}
|
||||
disabled={
|
||||
!job.converted || (selectedLines.length > 0 ? false : true)
|
||||
}
|
||||
onClick={() => {
|
||||
setPartsOrderContext({
|
||||
actions: { refetch: refetch },
|
||||
context: {
|
||||
jobId: jobId,
|
||||
jobId: job.jobId,
|
||||
linesToOrder: selectedLines,
|
||||
},
|
||||
});
|
||||
@@ -346,7 +348,7 @@ export function JobLinesComponent({
|
||||
onClick={() => {
|
||||
setJobLineEditContext({
|
||||
actions: { refetch: refetch },
|
||||
context: { jobid: jobId },
|
||||
context: { jobid: job.jobId },
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -370,7 +372,7 @@ export function JobLinesComponent({
|
||||
{record.parts_order_lines.map((item) => (
|
||||
<div key={item.id}>
|
||||
<Link
|
||||
to={`/manage/jobs/${jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}
|
||||
to={`/manage/jobs/${job.jobId}?tab=partssublet&partsorderid=${item.parts_order.id}`}
|
||||
>
|
||||
{item.parts_order.order_number || ""}
|
||||
</Link>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from "react";
|
||||
import JobLinesComponent from "./job-lines.component";
|
||||
|
||||
function JobLinesContainer({ jobId, joblines, refetch }) {
|
||||
function JobLinesContainer({ job, joblines, refetch }) {
|
||||
const [searchText, setSearchText] = useState("");
|
||||
const [selectedLines, setSelectedLines] = useState([]);
|
||||
|
||||
@@ -38,7 +38,7 @@ function JobLinesContainer({ jobId, joblines, refetch }) {
|
||||
setSearchText={setSearchText}
|
||||
selectedLines={selectedLines}
|
||||
setSelectedLines={setSelectedLines}
|
||||
jobId={jobId}
|
||||
job={job}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user