All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated InventoryOverview to include additional statistics for part stock, filament stock, product stock, and stock events, improving data visibility. - Refactored InfoCollapse components to support new statistics and ensure proper state management for collapsible sections. - Enhanced ModelHistoryDisplay to support both line and bar chart types, providing more flexibility in data visualization. - Added new stats definitions for FilamentStock, PartStock, ProductStock, and StockEvent models to support the expanded inventory features.
121 lines
2.5 KiB
JavaScript
121 lines
2.5 KiB
JavaScript
import StockEventIcon from '../../components/Icons/StockEventIcon'
|
|
import ListIcon from '../../components/Icons/ListIcon'
|
|
|
|
export const StockEvent = {
|
|
name: 'stockEvent',
|
|
label: 'Stock Event',
|
|
labelPlural: 'Stock Events',
|
|
url: '/dashboard/inventory/stockevents',
|
|
prefix: 'SEV',
|
|
icon: StockEventIcon,
|
|
actions: [
|
|
{
|
|
name: 'list',
|
|
type: 'page',
|
|
pageName: 'list',
|
|
label: 'List',
|
|
icon: ListIcon
|
|
}
|
|
],
|
|
columns: ['_reference', 'owner', 'parent', 'value', 'createdAt', 'updatedAt'],
|
|
filters: ['owner', 'parent', 'createdAt', 'updatedAt', '_reference'],
|
|
sorters: ['createdAt', 'updatedAt'],
|
|
properties: [
|
|
{
|
|
name: '_id',
|
|
label: 'ID',
|
|
type: 'id',
|
|
objectType: 'stockEvent',
|
|
columnFixed: 'left',
|
|
value: null,
|
|
showCopy: true,
|
|
columnWidth: 140
|
|
},
|
|
{
|
|
name: 'createdAt',
|
|
label: 'Created At',
|
|
type: 'dateTime',
|
|
value: null,
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
{
|
|
name: '_reference',
|
|
label: 'Reference',
|
|
type: 'reference',
|
|
columnFixed: 'left',
|
|
objectType: 'stockEvent',
|
|
value: null,
|
|
showCopy: true,
|
|
readOnly: true,
|
|
columnWidth: 180
|
|
},
|
|
{
|
|
name: 'updatedAt',
|
|
label: 'Updated At',
|
|
type: 'dateTime',
|
|
value: null,
|
|
readOnly: true,
|
|
columnWidth: 175
|
|
},
|
|
{
|
|
name: 'owner',
|
|
label: 'Owner',
|
|
type: 'object',
|
|
objectType: (objectData) => {
|
|
return objectData.ownerType
|
|
},
|
|
columnFixed: 'left',
|
|
columnWidth: 200,
|
|
value: null,
|
|
showCopy: true,
|
|
showHyperlink: true
|
|
},
|
|
{
|
|
name: 'parent',
|
|
label: 'Parent',
|
|
type: 'object',
|
|
objectType: (objectData) => {
|
|
return objectData?.parentType
|
|
},
|
|
value: null,
|
|
columnWidth: 200,
|
|
showCopy: true,
|
|
showHyperlink: true
|
|
},
|
|
{
|
|
name: 'value',
|
|
label: 'Value',
|
|
columnWidth: 120,
|
|
type: 'variance',
|
|
showCopy: true,
|
|
suffix: (objectData) => {
|
|
return objectData.unit
|
|
}
|
|
}
|
|
],
|
|
stats: [
|
|
{
|
|
name: 'partStock.count',
|
|
label: 'Part Stock Events',
|
|
type: 'number',
|
|
color: 'processing',
|
|
cardWidth: 200
|
|
},
|
|
{
|
|
name: 'filamentStock.count',
|
|
label: 'Filament Stock Events',
|
|
type: 'number',
|
|
color: 'warning',
|
|
cardWidth: 220
|
|
},
|
|
{
|
|
name: 'productStock.count',
|
|
label: 'Product Stock Events',
|
|
type: 'number',
|
|
color: 'success',
|
|
cardWidth: 220
|
|
}
|
|
]
|
|
}
|