diff --git a/assets/stylesheets/App.css b/assets/stylesheets/App.css index 3459759..93e745d 100644 --- a/assets/stylesheets/App.css +++ b/assets/stylesheets/App.css @@ -640,6 +640,7 @@ body { .h-100 { height: 100%; + min-height: 0; } .ant-table.ant-table-middle .ant-table-filter-trigger { @@ -804,6 +805,14 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton { margin-left: 4px; } +.farmcontrol-splitter .ant-splitter-panel { + overflow: visible; +} + +.farmcontrol-splitter.ant-splitter-horizontal .ant-splitter-panel { + width: 100%; +} + .farmcontrol-splitter .ant-splitter-panel:has(~ .ant-splitter-panel) .info-collapse.ant-collapse.ant-collapse-icon-position-end @@ -812,3 +821,22 @@ span.ant-skeleton-input.ant-skeleton-input-sm.text-skeleton { .ant-collapse-expand-icon { padding-inline-end: 2px; } + +.objectTableCards { + overflow: hidden; +} + +.objectTableCardsContainer { + width: 100%; + height: 100%; +} + +.objectTableCardsContainer .ant-spin-nested-loading { + width: 100%; + height: 100%; +} + +.objectTableCardsContainer .ant-spin-container { + width: 100%; + height: 100%; +} diff --git a/src/components/Dashboard/Finance/Invoices.jsx b/src/components/Dashboard/Finance/Invoices.jsx index 7a55e89..eff04fe 100644 --- a/src/components/Dashboard/Finance/Invoices.jsx +++ b/src/components/Dashboard/Finance/Invoices.jsx @@ -50,7 +50,7 @@ const Invoices = () => { return ( <> - + diff --git a/src/components/Dashboard/Finance/Payments.jsx b/src/components/Dashboard/Finance/Payments.jsx index cbda595..588380c 100644 --- a/src/components/Dashboard/Finance/Payments.jsx +++ b/src/components/Dashboard/Finance/Payments.jsx @@ -50,7 +50,7 @@ const Payments = () => { return ( <> - + diff --git a/src/components/Dashboard/Finance/TaxRecords.jsx b/src/components/Dashboard/Finance/TaxRecords.jsx index ed4fecd..c6c93b0 100644 --- a/src/components/Dashboard/Finance/TaxRecords.jsx +++ b/src/components/Dashboard/Finance/TaxRecords.jsx @@ -50,7 +50,7 @@ const TaxRecords = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/FilamentStocks.jsx b/src/components/Dashboard/Inventory/FilamentStocks.jsx index e1bd340..735c06f 100644 --- a/src/components/Dashboard/Inventory/FilamentStocks.jsx +++ b/src/components/Dashboard/Inventory/FilamentStocks.jsx @@ -55,7 +55,7 @@ const FilamentStocks = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/OrderItems.jsx b/src/components/Dashboard/Inventory/OrderItems.jsx index 111791e..3a0b8fe 100644 --- a/src/components/Dashboard/Inventory/OrderItems.jsx +++ b/src/components/Dashboard/Inventory/OrderItems.jsx @@ -50,7 +50,7 @@ const OrderItems = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/PartStocks.jsx b/src/components/Dashboard/Inventory/PartStocks.jsx index 29f0fbf..31a82dc 100644 --- a/src/components/Dashboard/Inventory/PartStocks.jsx +++ b/src/components/Dashboard/Inventory/PartStocks.jsx @@ -55,7 +55,7 @@ const PartStocks = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/ProductStocks.jsx b/src/components/Dashboard/Inventory/ProductStocks.jsx index 2fd327c..0b35734 100644 --- a/src/components/Dashboard/Inventory/ProductStocks.jsx +++ b/src/components/Dashboard/Inventory/ProductStocks.jsx @@ -56,7 +56,7 @@ const ProductStocks = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/PurchaseOrders.jsx b/src/components/Dashboard/Inventory/PurchaseOrders.jsx index b529966..889631e 100644 --- a/src/components/Dashboard/Inventory/PurchaseOrders.jsx +++ b/src/components/Dashboard/Inventory/PurchaseOrders.jsx @@ -50,7 +50,7 @@ const PurchaseOrders = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/Shipments.jsx b/src/components/Dashboard/Inventory/Shipments.jsx index 193d57b..359ecda 100644 --- a/src/components/Dashboard/Inventory/Shipments.jsx +++ b/src/components/Dashboard/Inventory/Shipments.jsx @@ -50,7 +50,7 @@ const Shipments = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/StockAudits.jsx b/src/components/Dashboard/Inventory/StockAudits.jsx index 263a2cb..7fec593 100644 --- a/src/components/Dashboard/Inventory/StockAudits.jsx +++ b/src/components/Dashboard/Inventory/StockAudits.jsx @@ -55,7 +55,7 @@ const StockAudits = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/StockEvents.jsx b/src/components/Dashboard/Inventory/StockEvents.jsx index 48e69cf..9aa994d 100644 --- a/src/components/Dashboard/Inventory/StockEvents.jsx +++ b/src/components/Dashboard/Inventory/StockEvents.jsx @@ -38,7 +38,7 @@ const StockEvents = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/StockLocations.jsx b/src/components/Dashboard/Inventory/StockLocations.jsx index 1b45562..c6da139 100644 --- a/src/components/Dashboard/Inventory/StockLocations.jsx +++ b/src/components/Dashboard/Inventory/StockLocations.jsx @@ -53,7 +53,7 @@ const StockLocations = () => { return ( <> - + diff --git a/src/components/Dashboard/Inventory/StockTransfers.jsx b/src/components/Dashboard/Inventory/StockTransfers.jsx index 4abcecc..d3a6cc9 100644 --- a/src/components/Dashboard/Inventory/StockTransfers.jsx +++ b/src/components/Dashboard/Inventory/StockTransfers.jsx @@ -53,7 +53,7 @@ const StockTransfers = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/AppPasswords.jsx b/src/components/Dashboard/Management/AppPasswords.jsx index 09fd0eb..755baff 100644 --- a/src/components/Dashboard/Management/AppPasswords.jsx +++ b/src/components/Dashboard/Management/AppPasswords.jsx @@ -49,7 +49,7 @@ const AppPasswords = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/AuditLogs.jsx b/src/components/Dashboard/Management/AuditLogs.jsx index e892bf2..c4e3421 100644 --- a/src/components/Dashboard/Management/AuditLogs.jsx +++ b/src/components/Dashboard/Management/AuditLogs.jsx @@ -36,7 +36,7 @@ const AuditLogs = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/CourierServices.jsx b/src/components/Dashboard/Management/CourierServices.jsx index 3ca521f..39584f0 100644 --- a/src/components/Dashboard/Management/CourierServices.jsx +++ b/src/components/Dashboard/Management/CourierServices.jsx @@ -50,7 +50,7 @@ const CourierServices = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Couriers.jsx b/src/components/Dashboard/Management/Couriers.jsx index 88665bc..f55912d 100644 --- a/src/components/Dashboard/Management/Couriers.jsx +++ b/src/components/Dashboard/Management/Couriers.jsx @@ -49,7 +49,7 @@ const Couriers = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/DocumentJobs.jsx b/src/components/Dashboard/Management/DocumentJobs.jsx index 762d60a..da21775 100644 --- a/src/components/Dashboard/Management/DocumentJobs.jsx +++ b/src/components/Dashboard/Management/DocumentJobs.jsx @@ -50,7 +50,7 @@ const DocumentJobs = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/DocumentPrinters.jsx b/src/components/Dashboard/Management/DocumentPrinters.jsx index 5f0f837..6b52600 100644 --- a/src/components/Dashboard/Management/DocumentPrinters.jsx +++ b/src/components/Dashboard/Management/DocumentPrinters.jsx @@ -49,7 +49,7 @@ const DocumentPrinters = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/DocumentSizes.jsx b/src/components/Dashboard/Management/DocumentSizes.jsx index a05a8e9..3ddce4c 100644 --- a/src/components/Dashboard/Management/DocumentSizes.jsx +++ b/src/components/Dashboard/Management/DocumentSizes.jsx @@ -48,7 +48,7 @@ const DocumentSizes = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/DocumentTemplates.jsx b/src/components/Dashboard/Management/DocumentTemplates.jsx index 73d7797..f28c989 100644 --- a/src/components/Dashboard/Management/DocumentTemplates.jsx +++ b/src/components/Dashboard/Management/DocumentTemplates.jsx @@ -50,7 +50,7 @@ const DocumentTemplates = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/FilamentSkus.jsx b/src/components/Dashboard/Management/FilamentSkus.jsx index 34fff3e..853a5cb 100644 --- a/src/components/Dashboard/Management/FilamentSkus.jsx +++ b/src/components/Dashboard/Management/FilamentSkus.jsx @@ -53,7 +53,7 @@ const FilamentSkus = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Filaments.jsx b/src/components/Dashboard/Management/Filaments.jsx index 53644b9..8b1cecf 100644 --- a/src/components/Dashboard/Management/Filaments.jsx +++ b/src/components/Dashboard/Management/Filaments.jsx @@ -55,7 +55,7 @@ const Filaments = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Files.jsx b/src/components/Dashboard/Management/Files.jsx index 87e4b7e..8d6b536 100644 --- a/src/components/Dashboard/Management/Files.jsx +++ b/src/components/Dashboard/Management/Files.jsx @@ -38,7 +38,7 @@ const Files = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Hosts.jsx b/src/components/Dashboard/Management/Hosts.jsx index bd28d69..1b1dbb6 100644 --- a/src/components/Dashboard/Management/Hosts.jsx +++ b/src/components/Dashboard/Management/Hosts.jsx @@ -54,7 +54,7 @@ const Hosts = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Materials.jsx b/src/components/Dashboard/Management/Materials.jsx index 4b74602..ce7594f 100644 --- a/src/components/Dashboard/Management/Materials.jsx +++ b/src/components/Dashboard/Management/Materials.jsx @@ -52,7 +52,7 @@ const Materials = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/NoteTypes.jsx b/src/components/Dashboard/Management/NoteTypes.jsx index d707471..0b88e1e 100644 --- a/src/components/Dashboard/Management/NoteTypes.jsx +++ b/src/components/Dashboard/Management/NoteTypes.jsx @@ -50,7 +50,7 @@ const NoteTypes = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/PartSkus.jsx b/src/components/Dashboard/Management/PartSkus.jsx index 987d392..ea85d87 100644 --- a/src/components/Dashboard/Management/PartSkus.jsx +++ b/src/components/Dashboard/Management/PartSkus.jsx @@ -52,7 +52,7 @@ const PartSkus = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Parts.jsx b/src/components/Dashboard/Management/Parts.jsx index 14d32e8..e00bf06 100644 --- a/src/components/Dashboard/Management/Parts.jsx +++ b/src/components/Dashboard/Management/Parts.jsx @@ -54,7 +54,7 @@ const Parts = (filter) => { return ( <> - + diff --git a/src/components/Dashboard/Management/ProductCategories.jsx b/src/components/Dashboard/Management/ProductCategories.jsx index 7f2ab33..e20ce61 100644 --- a/src/components/Dashboard/Management/ProductCategories.jsx +++ b/src/components/Dashboard/Management/ProductCategories.jsx @@ -52,7 +52,7 @@ const ProductCategories = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/ProductSkus.jsx b/src/components/Dashboard/Management/ProductSkus.jsx index fd7735f..8fc470f 100644 --- a/src/components/Dashboard/Management/ProductSkus.jsx +++ b/src/components/Dashboard/Management/ProductSkus.jsx @@ -53,7 +53,7 @@ const ProductSkus = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Products.jsx b/src/components/Dashboard/Management/Products.jsx index 2c3afe3..b595d95 100644 --- a/src/components/Dashboard/Management/Products.jsx +++ b/src/components/Dashboard/Management/Products.jsx @@ -325,7 +325,7 @@ const Products = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/TaxRates.jsx b/src/components/Dashboard/Management/TaxRates.jsx index 5030855..64a415b 100644 --- a/src/components/Dashboard/Management/TaxRates.jsx +++ b/src/components/Dashboard/Management/TaxRates.jsx @@ -49,7 +49,7 @@ const TaxRates = () => { return ( <> - + diff --git a/src/components/Dashboard/Management/Users.jsx b/src/components/Dashboard/Management/Users.jsx index bd57e65..231fd26 100644 --- a/src/components/Dashboard/Management/Users.jsx +++ b/src/components/Dashboard/Management/Users.jsx @@ -37,7 +37,7 @@ const Users = () => { return ( - + diff --git a/src/components/Dashboard/Management/Vendors.jsx b/src/components/Dashboard/Management/Vendors.jsx index 0c35638..0afced5 100644 --- a/src/components/Dashboard/Management/Vendors.jsx +++ b/src/components/Dashboard/Management/Vendors.jsx @@ -49,7 +49,7 @@ const Vendors = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/FilamentProfiles.jsx b/src/components/Dashboard/Production/FilamentProfiles.jsx index bc0a275..becacc1 100644 --- a/src/components/Dashboard/Production/FilamentProfiles.jsx +++ b/src/components/Dashboard/Production/FilamentProfiles.jsx @@ -77,7 +77,7 @@ const FilamentProfiles = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/GCodeFiles.jsx b/src/components/Dashboard/Production/GCodeFiles.jsx index 852c31b..fa97093 100644 --- a/src/components/Dashboard/Production/GCodeFiles.jsx +++ b/src/components/Dashboard/Production/GCodeFiles.jsx @@ -52,7 +52,7 @@ const GCodeFiles = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/Jobs.jsx b/src/components/Dashboard/Production/Jobs.jsx index f2251fc..5c48817 100644 --- a/src/components/Dashboard/Production/Jobs.jsx +++ b/src/components/Dashboard/Production/Jobs.jsx @@ -54,7 +54,7 @@ const Jobs = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/PrinterProfiles.jsx b/src/components/Dashboard/Production/PrinterProfiles.jsx index 39e5f2e..6076805 100644 --- a/src/components/Dashboard/Production/PrinterProfiles.jsx +++ b/src/components/Dashboard/Production/PrinterProfiles.jsx @@ -66,7 +66,7 @@ const PrinterProfiles = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/Printers.jsx b/src/components/Dashboard/Production/Printers.jsx index 70e6919..de51288 100644 --- a/src/components/Dashboard/Production/Printers.jsx +++ b/src/components/Dashboard/Production/Printers.jsx @@ -55,7 +55,7 @@ const Printers = () => { return ( <> - + diff --git a/src/components/Dashboard/Production/SubJobs.jsx b/src/components/Dashboard/Production/SubJobs.jsx index f1c01a6..64ed435 100644 --- a/src/components/Dashboard/Production/SubJobs.jsx +++ b/src/components/Dashboard/Production/SubJobs.jsx @@ -39,7 +39,7 @@ const SubJobs = () => { return ( <> - + diff --git a/src/components/Dashboard/Sales/Clients.jsx b/src/components/Dashboard/Sales/Clients.jsx index 607688e..f3b3a31 100644 --- a/src/components/Dashboard/Sales/Clients.jsx +++ b/src/components/Dashboard/Sales/Clients.jsx @@ -49,7 +49,7 @@ const Clients = () => { return ( <> - + diff --git a/src/components/Dashboard/Sales/Listings.jsx b/src/components/Dashboard/Sales/Listings.jsx index 84a0cc2..759d90e 100644 --- a/src/components/Dashboard/Sales/Listings.jsx +++ b/src/components/Dashboard/Sales/Listings.jsx @@ -50,7 +50,7 @@ const Listings = () => { return ( <> - + diff --git a/src/components/Dashboard/Sales/Marketplaces.jsx b/src/components/Dashboard/Sales/Marketplaces.jsx index 2959fbd..b5fbe51 100644 --- a/src/components/Dashboard/Sales/Marketplaces.jsx +++ b/src/components/Dashboard/Sales/Marketplaces.jsx @@ -50,7 +50,7 @@ const Marketplaces = () => { return ( <> - + diff --git a/src/components/Dashboard/Sales/SalesOrders.jsx b/src/components/Dashboard/Sales/SalesOrders.jsx index 6bab9fa..0893440 100644 --- a/src/components/Dashboard/Sales/SalesOrders.jsx +++ b/src/components/Dashboard/Sales/SalesOrders.jsx @@ -50,7 +50,7 @@ const SalesOrders = () => { return ( <> - + diff --git a/src/components/Dashboard/common/FilePreview.jsx b/src/components/Dashboard/common/FilePreview.jsx index c6b1972..1c2546b 100644 --- a/src/components/Dashboard/common/FilePreview.jsx +++ b/src/components/Dashboard/common/FilePreview.jsx @@ -36,6 +36,8 @@ const FilePreview = ({ file, style = {} }) => { } }, [file._id, file?.type, fetchPreview, token]) + console.log(file) + if (loading == true || !file?.type) { return } @@ -44,13 +46,11 @@ const FilePreview = ({ file, style = {} }) => { return
{error}
} - const isGcode = ['.g', '.gcode'].includes( - (file?.extension || '').toLowerCase() - ) + const isGcode = + ['.g', '.gcode'].includes((file?.extension || '').toLowerCase()) || false - const is3DModel = ['.stl', '.3mf'].includes( - (file?.extension || '').toLowerCase() - ) + const is3DModel = + ['.stl', '.3mf'].includes((file?.extension || '').toLowerCase()) || false const isImage = file?.type.startsWith('image/') diff --git a/src/components/Dashboard/common/ObjectTable.jsx b/src/components/Dashboard/common/ObjectTable.jsx index 7798f93..e4afa90 100644 --- a/src/components/Dashboard/common/ObjectTable.jsx +++ b/src/components/Dashboard/common/ObjectTable.jsx @@ -45,6 +45,7 @@ import { AuthContext } from '../context/AuthContext' import { ElectronContext } from '../context/ElectronContext' import ActionsIcon from '../../Icons/ActionsIcon' import FilterIcon from '../../Icons/FilterIcon' +import ScrollBox from './ScrollBox' const logger = loglevel.getLogger('DasboardTable') logger.setLevel(config.logLevel) @@ -132,7 +133,7 @@ const ObjectTable = forwardRef( const navigate = useNavigate() var adjustedScrollHeight = scrollHeight if (isMobile) { - adjustedScrollHeight = 'calc(var(--unit-100vh) - 316px)' + adjustedScrollHeight = 'calc(var(--unit-100vh) - 298px)' } if (cards) { adjustedScrollHeight = 'calc(var(--unit-100vh) - 210px)' @@ -1071,52 +1072,53 @@ const ObjectTable = forwardRef( const renderCards = () => { return ( - - {tableData.map((record) => { - if (record?._id == undefined) { - return null - } - return ( - -
- + + {tableData.map((record) => { + if (record?._id == undefined) { + return null + } + return ( + - - + - - -
- - ) - })} -
+ onRegister={registerForm} + > + + + + + + + ) + })} + + + ) } @@ -1143,9 +1145,15 @@ const ObjectTable = forwardRef( {cards ? ( - } spinning={loading}> - {renderCards()} - +
+ } + spinning={loading} + style={{ height: '100%' }} + > + {renderCards()} + +
) : ( { notificationListenersRef.current.clear() }, []) - const resubscribeActivityListeners = useCallback((socket = socketRef.current) => { - if (!socket?.connected) { - return - } - - subscribedActivityCallbacksRef.current.forEach((callbacks, callbacksRefKey) => { - if (!callbacks?.length) { + const resubscribeActivityListeners = useCallback( + (socket = socketRef.current) => { + if (!socket?.connected) { return } - if (subscribedActivityServerSubscriptionsRef.current.has(callbacksRefKey)) { - return - } - - const colonIndex = callbacksRefKey.indexOf(':') - if (colonIndex === -1) { - return - } - - const objectType = callbacksRefKey.slice(0, colonIndex) - const objectId = callbacksRefKey.slice(colonIndex + 1) - - socket.emit( - 'subscribeToObjectActivity', - { _id: objectId, objectType }, - (result) => { - if (result?.success) { - subscribedActivityServerSubscriptionsRef.current.add(callbacksRefKey) - if (Array.isArray(result.activities)) { - callbacks.forEach((callback) => { - try { - callback(null, result.activities) - } catch (error) { - logger.error('Error in activity resubscribe callback:', error) - } - }) - } + subscribedActivityCallbacksRef.current.forEach( + (callbacks, callbacksRefKey) => { + if (!callbacks?.length) { + return } + + if ( + subscribedActivityServerSubscriptionsRef.current.has( + callbacksRefKey + ) + ) { + return + } + + const colonIndex = callbacksRefKey.indexOf(':') + if (colonIndex === -1) { + return + } + + const objectType = callbacksRefKey.slice(0, colonIndex) + const objectId = callbacksRefKey.slice(colonIndex + 1) + + socket.emit( + 'subscribeToObjectActivity', + { _id: objectId, objectType }, + (result) => { + if (result?.success) { + subscribedActivityServerSubscriptionsRef.current.add( + callbacksRefKey + ) + if (Array.isArray(result.activities)) { + callbacks.forEach((callback) => { + try { + callback(null, result.activities) + } catch (error) { + logger.error( + 'Error in activity resubscribe callback:', + error + ) + } + }) + } + } + } + ) } ) - }) - }, []) + }, + [] + ) const registerNotificationListener = useCallback((callback) => { notificationListenersRef.current.add(callback) @@ -966,7 +980,9 @@ const ApiServerProvider = ({ children }) => { { _id: id, objectType: type }, (result) => { if (result?.success) { - subscribedActivityServerSubscriptionsRef.current.add(callbacksRefKey) + subscribedActivityServerSubscriptionsRef.current.add( + callbacksRefKey + ) if (Array.isArray(result.activities)) { subscribedActivityCallbacksRef.current .get(callbacksRefKey) @@ -974,7 +990,10 @@ const ApiServerProvider = ({ children }) => { try { activityCallback(null, result.activities) } catch (error) { - logger.error('Error in activity subscribe callback:', error) + logger.error( + 'Error in activity subscribe callback:', + error + ) } }) }