From 2feba8b3cc916761b6bed74b3c5fe7ec9ba97175 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Tue, 1 Sep 2026 17:11:07 +0100 Subject: [PATCH] Enhance NewObjectButtons, NewObjectForm, and related components with improved loading and disabled state handling - Updated NewObjectButtons to disable controls based on loading state and current step. - Refactored NewObjectForm to integrate computed entries calculation and manage loading state more effectively. - Enhanced ObjectProperty and WizardView components to respect the disabled state during form interactions. - Introduced new utility functions for calculating model computed entries, improving data handling and clarity. --- .../Dashboard/common/NewObjectButtons.jsx | 8 +- .../Dashboard/common/NewObjectForm.jsx | 105 ++------------ .../Dashboard/common/ObjectProperty.jsx | 2 +- .../Dashboard/common/WizardView.jsx | 2 +- src/components/Dashboard/utils/Utils.js | 134 ++++++++++++++++++ 5 files changed, 156 insertions(+), 95 deletions(-) diff --git a/src/components/Dashboard/common/NewObjectButtons.jsx b/src/components/Dashboard/common/NewObjectButtons.jsx index 61ec5043..74e1987f 100644 --- a/src/components/Dashboard/common/NewObjectButtons.jsx +++ b/src/components/Dashboard/common/NewObjectButtons.jsx @@ -12,13 +12,15 @@ const NewObjectButtons = ({ submitText = 'Done', disabled = false }) => { + const controlsDisabled = disabled || submitLoading + return ( {totalSteps > 1 ? ( @@ -27,7 +29,7 @@ const NewObjectButtons = ({ {currentStep < totalSteps - 1 ? (