From bcb7460bf2e9feea81f4f6331cea811e9acbc513 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sat, 22 Aug 2026 21:16:21 +0100 Subject: [PATCH] Enhance Loading State in Dashboard Components - Added a loading spinner to various components including InvoiceInfo, PaymentInfo, TaxRecordInfo, and others to improve user experience during data fetching. - Integrated Spin component from Ant Design with a LoadingOutlined icon to visually indicate loading states for notes sections across multiple dashboard components. - Ensured consistent loading behavior across all relevant components, enhancing overall responsiveness and user feedback. --- .../Finance/Invoices/InvoiceInfo.jsx | 11 ++++++--- .../Finance/Payments/PaymentInfo.jsx | 11 ++++++--- .../Finance/TaxRecords/TaxRecordInfo.jsx | 12 +++++++--- .../FilamentStocks/FilamentStockInfo.jsx | 12 +++++++--- .../Inventory/OrderItems/OrderItemInfo.jsx | 11 ++++++--- .../Inventory/PartStocks/PartStockInfo.jsx | 11 ++++++--- .../ProductStocks/ProductStockInfo.jsx | 11 ++++++--- .../PurchaseOrders/PurchaseOrderInfo.jsx | 11 ++++++--- .../Inventory/Shipments/PurchaseOrderInfo.jsx | 11 ++++++--- .../Inventory/Shipments/ShipmentInfo.jsx | 11 ++++++--- .../Inventory/StockAudits/StockAuditInfo.jsx | 11 ++++++--- .../StockLocations/StockLocationInfo.jsx | 11 ++++++--- .../StockTransfers/StockTransferInfo.jsx | 11 ++++++--- .../CourierServices/CourierServiceInfo.jsx | 12 +++++++--- .../Management/Couriers/CourierInfo.jsx | 12 +++++++--- .../DocumentJobs/DocumentJobInfo.jsx | 11 ++++++--- .../DocumentPrinters/DocumentPrinterInfo.jsx | 23 +++++++++++-------- .../DocumentSizes/DocumentSizeInfo.jsx | 11 ++++++--- .../DocumentTemplateDesign.jsx | 12 +++++++--- .../DocumentTemplateInfo.jsx | 11 ++++++--- .../FilamentSkus/FilamentSkuInfo.jsx | 12 +++++++--- .../Management/Filaments/FilamentInfo.jsx | 11 ++++++--- .../Dashboard/Management/Files/FileInfo.jsx | 12 +++++++--- .../Dashboard/Management/Hosts/HostInfo.jsx | 11 ++++++--- .../Management/Materials/MaterialInfo.jsx | 12 +++++++--- .../Dashboard/Management/Notes/NoteInfo.jsx | 11 ++++++--- .../Management/PartSkus/PartSkuInfo.jsx | 12 +++++++--- .../Dashboard/Management/Parts/PartInfo.jsx | 12 +++++++--- .../PermissionSettingInfo.jsx | 9 ++++++-- .../ProductCategories/ProductCategoryInfo.jsx | 12 +++++++--- .../Management/ProductSkus/ProductSkuInfo.jsx | 12 +++++++--- .../Management/Products/ProductInfo.jsx | 12 +++++++--- .../Management/TaxRates/TaxRateInfo.jsx | 12 +++++++--- .../Management/UserGroups/UserGroupInfo.jsx | 9 ++++++-- .../Dashboard/Management/Users/UserInfo.jsx | 9 ++++++-- .../Management/Vendors/VendorInfo.jsx | 12 +++++++--- .../FilamentProfiles/FilamentProfileInfo.jsx | 11 ++++++--- .../Production/GCodeFiles/GCodeFileInfo.jsx | 11 ++++++--- .../GCodeFiles/GCodeFilePreview.jsx | 12 +++++++--- .../Dashboard/Production/Jobs/JobInfo.jsx | 11 ++++++--- .../PrinterProfiles/PrinterProfileInfo.jsx | 11 ++++++--- .../Production/Printers/ControlPrinter.jsx | 12 +++++++--- .../Production/Printers/PrinterInfo.jsx | 11 ++++++--- .../Production/SubJobs/SubJobInfo.jsx | 11 ++++++--- .../Dashboard/Sales/Clients/ClientInfo.jsx | 12 +++++++--- .../ListingVarients/ListingVarientInfo.jsx | 12 +++++++--- .../Dashboard/Sales/Listings/ListingInfo.jsx | 12 +++++++--- .../Sales/Marketplaces/MarketplaceInfo.jsx | 12 +++++++--- .../Sales/SalesOrders/SalesOrderInfo.jsx | 11 ++++++--- 49 files changed, 416 insertions(+), 150 deletions(-) diff --git a/src/components/Dashboard/Finance/Invoices/InvoiceInfo.jsx b/src/components/Dashboard/Finance/Invoices/InvoiceInfo.jsx index 64edc6f8..15adcb90 100644 --- a/src/components/Dashboard/Finance/Invoices/InvoiceInfo.jsx +++ b/src/components/Dashboard/Finance/Invoices/InvoiceInfo.jsx @@ -1,6 +1,6 @@ import { useRef, useState, useEffect, useMemo } from 'react' import { useLocation } from 'react-router-dom' -import { Card, Flex, Space } from 'antd' +import { Card, Flex, Space, Spin } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import loglevel from 'loglevel' import config from '../../../../config.js' @@ -269,9 +269,14 @@ const InvoiceInfo = () => { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - - - + } + > + + + + { diff --git a/src/components/Dashboard/Management/DocumentSizes/DocumentSizeInfo.jsx b/src/components/Dashboard/Management/DocumentSizes/DocumentSizeInfo.jsx index 1c0bfbbc..c5912fb1 100644 --- a/src/components/Dashboard/Management/DocumentSizes/DocumentSizeInfo.jsx +++ b/src/components/Dashboard/Management/DocumentSizes/DocumentSizeInfo.jsx @@ -1,6 +1,6 @@ import { useRef, useState, useMemo } from 'react' import { useLocation } from 'react-router-dom' -import { Card, Flex, Space } from 'antd' +import { Card, Flex, Space, Spin } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import loglevel from 'loglevel' import config from '../../../../config.js' @@ -192,9 +192,14 @@ const DocumentSizeInfo = () => { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + diff --git a/src/components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo.jsx b/src/components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo.jsx index 3c4212fb..616406dc 100644 --- a/src/components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo.jsx +++ b/src/components/Dashboard/Management/DocumentTemplates/DocumentTemplateInfo.jsx @@ -1,6 +1,6 @@ import { useRef, useState, useMemo } from 'react' import { useLocation } from 'react-router-dom' -import { Card, Flex, Space } from 'antd' +import { Card, Flex, Space, Spin } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import loglevel from 'loglevel' import config from '../../../../config.js' @@ -205,9 +205,14 @@ const DocumentTemplateInfo = () => { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + diff --git a/src/components/Dashboard/Production/Jobs/JobInfo.jsx b/src/components/Dashboard/Production/Jobs/JobInfo.jsx index 24d74b58..23403e3e 100644 --- a/src/components/Dashboard/Production/Jobs/JobInfo.jsx +++ b/src/components/Dashboard/Production/Jobs/JobInfo.jsx @@ -1,6 +1,6 @@ import { useRef, useState, useEffect, useMemo } from 'react' import { useLocation } from 'react-router-dom' -import { Card, Flex, Space } from 'antd' +import { Card, Flex, Space, Spin } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import loglevel from 'loglevel' import config from '../../../../config.js' @@ -219,9 +219,14 @@ const JobInfo = () => { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + diff --git a/src/components/Dashboard/Production/Printers/PrinterInfo.jsx b/src/components/Dashboard/Production/Printers/PrinterInfo.jsx index 9af2e305..5562cca9 100644 --- a/src/components/Dashboard/Production/Printers/PrinterInfo.jsx +++ b/src/components/Dashboard/Production/Printers/PrinterInfo.jsx @@ -1,6 +1,6 @@ import { useRef, useState, useEffect, useMemo } from 'react' import { useLocation } from 'react-router-dom' -import { Card, Flex, Space } from 'antd' +import { Card, Flex, Space, Spin } from 'antd' import { LoadingOutlined } from '@ant-design/icons' import loglevel from 'loglevel' import config from '../../../../config.js' @@ -239,9 +239,14 @@ const PrinterInfo = () => { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + + { onToggle={(expanded) => updateCollapseState('notes', expanded)} collapseKey='notes' > - + } + > + - + +