From c10daf008e5f6bffac02d308482237de1284beb2 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 7 Dec 2025 02:42:02 +0000 Subject: [PATCH] Enhance ObjectProperty component with readOnly handling and reference case support - Added functionality to process readOnly as a function for dynamic object data handling. - Updated rendering logic to include a new 'reference' case, allowing for the display of ID references with appropriate components. - Improved ObjectDisplay rendering by passing showHyperlink prop for enhanced interactivity. --- .../Dashboard/common/ObjectProperty.jsx | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/components/Dashboard/common/ObjectProperty.jsx b/src/components/Dashboard/common/ObjectProperty.jsx index a9a2031..72e9c6a 100644 --- a/src/components/Dashboard/common/ObjectProperty.jsx +++ b/src/components/Dashboard/common/ObjectProperty.jsx @@ -131,6 +131,10 @@ const ObjectProperty = ({ options = options(objectData) } + if (readOnly && typeof readOnly == 'function' && objectData) { + readOnly = readOnly(objectData) + } + if (!value) { value = getPropertyValue(objectData, name) } @@ -364,7 +368,13 @@ const ObjectProperty = ({ } case 'object': { if (value && value._id) { - return + return ( + + ) } else { return ( @@ -439,6 +449,24 @@ const ObjectProperty = ({ ) } } + case 'reference': { + if (value) { + return ( + + ) + } else { + return ( + + n/a + + ) + } + } case 'miscId': { return }