feature/IO-3545-Production-Board-List-DND - EMP assignment selector fix

This commit is contained in:
Dave
2026-02-03 15:29:03 -05:00
parent 332ade96e5
commit 05ae0801e5

View File

@@ -35,8 +35,6 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
const result = await updateJob({ const result = await updateJob({
variables: { jobId: record.id, job: { [empAssignment]: employeeid } } variables: { jobId: record.id, job: { [empAssignment]: employeeid } }
// awaitRefetchQueries: true,
}); });
insertAuditTrail({ insertAuditTrail({
@@ -55,6 +53,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
await refetch(); await refetch();
setAssignment({ operation: null, employeeid: null });
setLoading(false); setLoading(false);
}; };
const handleRemove = async (operation) => { const handleRemove = async (operation) => {
@@ -84,6 +83,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
await refetch(); await refetch();
setAssignment({ operation: null, employeeid: null });
setLoading(false); setLoading(false);
}; };
@@ -115,6 +115,7 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
filterOption: (input, option) => option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 filterOption: (input, option) => option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}} }}
style={{ width: 200 }} style={{ width: 200 }}
value={assignment.employeeid}
onChange={onChange} onChange={onChange}
options={employeeOptions} options={employeeOptions}
/> />
@@ -142,25 +143,25 @@ export function ProductionListEmpAssignment({ insertAuditTrail, bodyshop, record
if (record[type]) theEmployee = bodyshop.employees.find((e) => e.id === record[type]); if (record[type]) theEmployee = bodyshop.employees.find((e) => e.id === record[type]);
return ( return (
<Popover destroyOnHidden content={popContent} open={visibility}> <Spin spinning={loading}>
<Spin spinning={loading}> {record[type] ? (
{record[type] ? ( <div style={{ cursor: "pointer" }}>
<div style={{ cursor: "pointer" }}> <span>{`${theEmployee?.first_name || ""} ${theEmployee?.last_name || ""}`}</span>
<span>{`${theEmployee?.first_name || ""} ${theEmployee?.last_name || ""}`}</span> <DeleteFilled style={iconStyle} onClick={() => handleRemove(type)} />
<DeleteFilled style={iconStyle} onClick={() => handleRemove(type)} /> </div>
</div> ) : (
) : ( <Popover destroyOnHidden content={popContent} open={visibility} trigger="click">
<PlusCircleFilled <PlusCircleFilled
style={{ ...iconStyle, cursor: "pointer" }} style={{ ...iconStyle, cursor: "pointer" }}
className="muted-button" className="muted-button"
onClick={() => { onClick={() => {
setAssignment({ operation: type }); setAssignment({ operation: type, employeeid: null });
setVisibility(true); setVisibility(true);
}} }}
/> />
)} </Popover>
</Spin> )}
</Popover> </Spin>
); );
} }