- Introduced OrderItem and Shipment models with associated properties and actions. - Updated ObjectModels to include new models for better integration. - Refactored existing models to remove unnecessary ID references and improve hyperlink support for related objects. - Enhanced various models by removing deprecated fields and ensuring consistency in object references.
119 lines
2.4 KiB
JavaScript
119 lines
2.4 KiB
JavaScript
import SubJobIcon from '../../components/Icons/SubJobIcon'
|
|
import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|
import XMarkIcon from '../../components/Icons/XMarkIcon'
|
|
|
|
export const SubJob = {
|
|
name: 'subJob',
|
|
label: 'Sub Job',
|
|
prefix: 'SJB',
|
|
icon: SubJobIcon,
|
|
actions: [
|
|
{
|
|
name: 'info',
|
|
label: 'Info',
|
|
default: true,
|
|
row: true,
|
|
icon: InfoCircleIcon,
|
|
url: (_id) => `/dashboard/production/subjobs/info?subJobId=${_id}`
|
|
},
|
|
{
|
|
name: 'cancel',
|
|
label: 'Cancel Sub Job',
|
|
row: true,
|
|
icon: XMarkIcon,
|
|
url: (_id) =>
|
|
`/dashboard/production/subjobs/info?subJobId=${_id}&action=cancel`,
|
|
disabled: (objectData) => {
|
|
return objectData?.state?.type !== 'queued'
|
|
}
|
|
}
|
|
],
|
|
columns: ['_id', 'printer', 'job', 'state', 'createdAt'],
|
|
filters: ['state', '_id', 'job', 'printer'],
|
|
sorters: ['createdAt', 'state'],
|
|
group: ['job'],
|
|
properties: [
|
|
{
|
|
name: '_id',
|
|
label: 'ID',
|
|
type: 'id',
|
|
columnFixed: 'left',
|
|
objectType: 'subJob',
|
|
columnWidth: 140,
|
|
showCopy: true
|
|
},
|
|
{
|
|
name: 'createdAt',
|
|
label: 'Created At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
{
|
|
name: 'state',
|
|
label: 'State',
|
|
type: 'state',
|
|
objectType: 'subJob',
|
|
showStatus: true,
|
|
showProgress: true,
|
|
showId: false,
|
|
showQuantity: false,
|
|
columnWidth: 250,
|
|
readOnly: true
|
|
},
|
|
{
|
|
name: 'updatedAt',
|
|
label: 'Updated At',
|
|
type: 'dateTime',
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
|
|
{
|
|
name: 'moonrakerJobId',
|
|
label: 'Moonraker Job ID',
|
|
type: 'miscId',
|
|
columnWidth: 140,
|
|
showCopy: true
|
|
},
|
|
|
|
{
|
|
name: 'startedAt',
|
|
label: 'Started At',
|
|
type: 'dateTime',
|
|
readOnly: true
|
|
},
|
|
|
|
{
|
|
name: 'createdPartStock',
|
|
label: 'Created Part Stock',
|
|
type: 'bool',
|
|
readOnly: true
|
|
},
|
|
|
|
{
|
|
name: 'finishedAt',
|
|
label: 'Finished At',
|
|
type: 'dateTime',
|
|
readOnly: true
|
|
},
|
|
|
|
{
|
|
name: 'job',
|
|
label: 'Job',
|
|
type: 'object',
|
|
objectType: 'job',
|
|
showHyperlink: true
|
|
},
|
|
|
|
{
|
|
name: 'printer',
|
|
label: 'Printer',
|
|
type: 'object',
|
|
columnFixed: 'left',
|
|
objectType: 'printer',
|
|
showHyperlink: true
|
|
}
|
|
]
|
|
}
|