Enhance ObjectProperty Component with Additional Value Handling
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated ObjectProperty component to improve rendering logic for state and message values, enhancing user feedback. - Reformatted fieldNames for better readability and maintainability in the Tree component.
This commit is contained in:
parent
835c287810
commit
2d881cb152
@ -278,7 +278,11 @@ const ObjectProperty = ({
|
||||
return (
|
||||
<Tree
|
||||
treeData={value}
|
||||
fieldNames={{ title: 'title', key: 'value', children: 'children' }}
|
||||
fieldNames={{
|
||||
title: 'title',
|
||||
key: 'value',
|
||||
children: 'children'
|
||||
}}
|
||||
height={320}
|
||||
virtual
|
||||
defaultExpandAll={false}
|
||||
@ -531,6 +535,8 @@ const ObjectProperty = ({
|
||||
case 'state': {
|
||||
if (value && value?.type) {
|
||||
return <StateDisplay {...rest} state={value} />
|
||||
} else if (value && value?.message) {
|
||||
return <Text {...textParams}>{value.message}</Text>
|
||||
} else {
|
||||
return (
|
||||
<Text type='secondary' {...textParams}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user