From db249d9dc91ca4bed27f1ac977a652aa9da0e898 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Fri, 31 Jul 2026 22:54:28 +0100 Subject: [PATCH] Add Part Stock and Product Stock Events sections to Inventory components - Introduced new 'Part Stock Events' and 'Product Stock Events' sections in PartStockInfo and ProductStockInfo components, respectively. - Updated state management to include events and modified the UI to display event-related information. - Added icons and collapsible sections for better organization and user experience. --- .../Inventory/PartStocks/PartStockInfo.jsx | 26 +++++++++++++++++-- .../ProductStocks/ProductStockInfo.jsx | 21 +++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard/Inventory/PartStocks/PartStockInfo.jsx b/src/components/Dashboard/Inventory/PartStocks/PartStockInfo.jsx index fc40e93..5f00888 100644 --- a/src/components/Dashboard/Inventory/PartStocks/PartStockInfo.jsx +++ b/src/components/Dashboard/Inventory/PartStocks/PartStockInfo.jsx @@ -24,6 +24,7 @@ import DocumentPrintButton from '../../common/DocumentPrintButton.jsx' import UserNotifierToggle from '../../common/UserNotifierToggle.jsx' import ScrollBox from '../../common/ScrollBox.jsx' import HistoryDisplay from '../../common/HistoryDisplay.jsx' +import PartStockIcon from '../../../Icons/PartStockIcon.jsx' const log = loglevel.getLogger('PartStockInfo') log.setLevel(config.logLevel) @@ -37,7 +38,7 @@ const PartStockInfo = () => { 'PartStockInfo', { info: true, - stocks: true, + events: true, history: true, notes: true, auditLogs: false @@ -91,6 +92,7 @@ const PartStockInfo = () => { disabled={objectFormState.loading} items={[ { key: 'info', label: 'Part Stock Information' }, + { key: 'events', label: 'Part Stock Events' }, { key: 'history', label: 'Part Stock History' }, { key: 'notes', label: 'Notes' }, { key: 'auditLogs', label: 'Audit Logs' } @@ -128,7 +130,9 @@ const PartStockInfo = () => { }} editLoading={objectFormState.editLoading} formValid={objectFormState.formValid} - disabled={objectFormState.beingEditedByOther || objectFormState.loading} + disabled={ + objectFormState.beingEditedByOther || objectFormState.loading + } loading={objectFormState.editLoading} /> @@ -177,6 +181,24 @@ const PartStockInfo = () => { + } + active={collapseState.events} + onToggle={(expanded) => updateCollapseState('events', expanded)} + collapseKey='events' + > + {objectFormState.loading ? ( + + ) : ( + + )} + + } diff --git a/src/components/Dashboard/Inventory/ProductStocks/ProductStockInfo.jsx b/src/components/Dashboard/Inventory/ProductStocks/ProductStockInfo.jsx index 6c2ad50..8c667a4 100644 --- a/src/components/Dashboard/Inventory/ProductStocks/ProductStockInfo.jsx +++ b/src/components/Dashboard/Inventory/ProductStocks/ProductStockInfo.jsx @@ -19,6 +19,7 @@ import InfoCircleIcon from '../../../Icons/InfoCircleIcon.jsx' import NoteIcon from '../../../Icons/NoteIcon.jsx' import AuditLogIcon from '../../../Icons/AuditLogIcon.jsx' import PartStockIcon from '../../../Icons/PartStockIcon.jsx' +import ProductStockIcon from '../../../Icons/ProductStockIcon.jsx' import GraphIcon from '../../../Icons/GraphIcon.jsx' import ObjectForm from '../../common/ObjectForm.jsx' import EditButtons from '../../common/EditButtons.jsx' @@ -48,6 +49,7 @@ const ProductStockInfo = () => { { info: true, partStocks: true, + events: true, history: true, notes: true, auditLogs: false @@ -115,6 +117,7 @@ const ProductStockInfo = () => { items={[ { key: 'info', label: 'Product Stock Information' }, { key: 'partStocks', label: 'Part Stocks' }, + { key: 'events', label: 'Product Stock Events' }, { key: 'history', label: 'Product Stock History' }, { key: 'notes', label: 'Notes' }, { key: 'auditLogs', label: 'Audit Logs' } @@ -221,6 +224,24 @@ const ProductStockInfo = () => { + } + active={collapseState.events} + onToggle={(expanded) => updateCollapseState('events', expanded)} + collapseKey='events' + > + {objectFormState.loading ? ( + + ) : ( + + )} + + }