- Introduced DashboardOverviewPage and DashboardOverviewFlexColumns components to streamline the layout and management of dashboard sections, improving overall organization and usability. - Replaced individual collapsible sections in Finance, Inventory, Production, and Sales overviews with a unified structure, enhancing maintainability and consistency across the dashboard. - Added ActionsButton component for improved action handling and keyboard shortcuts, enhancing user interaction capabilities. - Updated styles in App.css to support new drag-and-drop functionality and layout features, ensuring a cohesive visual experience. - Refactored existing components to utilize the new structure, improving code clarity and reducing redundancy.
185 lines
4.2 KiB
JavaScript
185 lines
4.2 KiB
JavaScript
import DashboardOverviewPage from '../common/DashboardOverviewPage'
|
|
import StatsDisplay from '../common/StatsDisplay'
|
|
import ModelHistoryDisplay from '../common/ModelHistoryDisplay'
|
|
import ObjectTable from '../common/ObjectTable'
|
|
|
|
const collapseDefaults = {
|
|
partStockStats: true,
|
|
filamentStockStats: true,
|
|
productStockStats: true,
|
|
purchaseOrderStats: true,
|
|
stockEventStats: true,
|
|
partStockHistory: true,
|
|
newPartStocks: true,
|
|
filamentStockHistory: true,
|
|
unconsumedFilamentStocks: true,
|
|
productStockHistory: true,
|
|
draftProductStocks: true,
|
|
purchaseOrderHistory: true,
|
|
draftPurchaseOrders: true,
|
|
stockEventHistory: true
|
|
}
|
|
|
|
const sections = [
|
|
{
|
|
key: 'partStockStats',
|
|
title: 'Part Stock Statistics',
|
|
className: 'no-t-padding-collapse',
|
|
content: <StatsDisplay objectType='partStock' />
|
|
},
|
|
{
|
|
key: 'filamentStockStats',
|
|
title: 'Filament Stock Statistics',
|
|
className: 'no-t-padding-collapse',
|
|
content: <StatsDisplay objectType='filamentStock' />
|
|
},
|
|
{
|
|
key: 'productStockStats',
|
|
title: 'Product Stock Statistics',
|
|
className: 'no-t-padding-collapse',
|
|
content: <StatsDisplay objectType='productStock' />
|
|
},
|
|
{
|
|
key: 'purchaseOrderStats',
|
|
title: 'Purchase Order Statistics',
|
|
className: 'no-t-padding-collapse',
|
|
content: <StatsDisplay objectType='purchaseOrder' />
|
|
},
|
|
{
|
|
key: 'stockEventStats',
|
|
title: 'Stock Event Statistics',
|
|
className: 'no-t-padding-collapse',
|
|
content: <StatsDisplay objectType='stockEvent' />
|
|
},
|
|
{
|
|
key: 'partAndFilamentHistoryRow',
|
|
type: 'row',
|
|
columns: [
|
|
[
|
|
{
|
|
key: 'partStockHistory',
|
|
title: 'Part Stock History',
|
|
content: (
|
|
<ModelHistoryDisplay objectType='partStock' chartType='line' />
|
|
)
|
|
}
|
|
],
|
|
[
|
|
{
|
|
key: 'filamentStockHistory',
|
|
title: 'Filament Stock History',
|
|
content: (
|
|
<ModelHistoryDisplay objectType='filamentStock' chartType='line' />
|
|
)
|
|
}
|
|
]
|
|
]
|
|
},
|
|
{
|
|
key: 'newPartAndUnconsumedFilamentRow',
|
|
type: 'row',
|
|
columns: [
|
|
[
|
|
{
|
|
key: 'newPartStocks',
|
|
title: 'New Part Stocks',
|
|
content: (
|
|
<ObjectTable type='partStock' masterFilter={{ state: 'new' }} />
|
|
)
|
|
}
|
|
],
|
|
[
|
|
{
|
|
key: 'unconsumedFilamentStocks',
|
|
title: 'Unconsumed Filament Stocks',
|
|
content: (
|
|
<ObjectTable
|
|
type='filamentStock'
|
|
masterFilter={{ state: 'unconsumed' }}
|
|
/>
|
|
)
|
|
}
|
|
]
|
|
]
|
|
},
|
|
{
|
|
key: 'productAndPurchaseOrderHistoryRow',
|
|
type: 'row',
|
|
columns: [
|
|
[
|
|
{
|
|
key: 'productStockHistory',
|
|
title: 'Product Stock History',
|
|
content: (
|
|
<ModelHistoryDisplay objectType='productStock' chartType='line' />
|
|
)
|
|
}
|
|
],
|
|
[
|
|
{
|
|
key: 'purchaseOrderHistory',
|
|
title: 'Purchase Order History',
|
|
content: <ModelHistoryDisplay objectType='purchaseOrder' />
|
|
}
|
|
]
|
|
]
|
|
},
|
|
{
|
|
key: 'draftProductAndPurchaseOrderRow',
|
|
type: 'row',
|
|
columns: [
|
|
[
|
|
{
|
|
key: 'draftProductStocks',
|
|
title: 'Draft Product Stocks',
|
|
content: (
|
|
<ObjectTable
|
|
type='productStock'
|
|
masterFilter={{ state: 'draft' }}
|
|
/>
|
|
)
|
|
}
|
|
],
|
|
[
|
|
{
|
|
key: 'draftPurchaseOrders',
|
|
title: 'Draft Purchase Orders',
|
|
content: (
|
|
<ObjectTable
|
|
type='purchaseOrder'
|
|
masterFilter={{ state: 'draft' }}
|
|
/>
|
|
)
|
|
}
|
|
]
|
|
]
|
|
},
|
|
{
|
|
key: 'stockEventHistoryRow',
|
|
type: 'row',
|
|
columns: [
|
|
[
|
|
{
|
|
key: 'stockEventHistory',
|
|
title: 'Stock Event History',
|
|
content: (
|
|
<ModelHistoryDisplay objectType='stockEvent' chartType='line' />
|
|
)
|
|
}
|
|
]
|
|
]
|
|
}
|
|
]
|
|
|
|
const InventoryOverview = () => {
|
|
return (
|
|
<DashboardOverviewPage
|
|
pageName='InventoryOverview'
|
|
collapseDefaults={collapseDefaults}
|
|
sections={sections}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default InventoryOverview
|