Add partSku field to GCodeFile model for enhanced object filtering
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

- Introduced a new 'partSku' field in the GCodeFile model, which is required and supports object type filtering.
- Implemented a masterFilter function to facilitate filtering based on the associated part ID, improving data management and retrieval.
This commit is contained in:
Tom Butcher 2026-07-26 21:21:25 +01:00
parent 580e5dbb34
commit 8d0f92af45

View File

@ -288,6 +288,19 @@ export const GCodeFile = {
required: true, required: true,
showHyperlink: true showHyperlink: true
}, },
{
name: 'partSku',
label: 'Part SKU',
type: 'object',
objectType: 'partSku',
required: true,
showHyperlink: true,
masterFilter: (objectData) => {
const partId = objectData?.part?._id
if (partId == null) return {}
return { part: partId }
}
},
{ {
name: 'quantity', name: 'quantity',
label: 'Quantity', label: 'Quantity',