From 140fd742b6658c92009d0ce9cc0e1b8ee6c4588f Mon Sep 17 00:00:00 2001 From: mufazalov Date: Fri, 24 Jan 2025 11:04:23 +0300 Subject: [PATCH] fix(SchemaTree): expand nodes if ChildrenExist is undefined --- .../Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx b/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx index 988c1f609f..fdc4286da4 100644 --- a/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx +++ b/src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx @@ -10,6 +10,7 @@ import {selectUserInput} from '../../../../store/reducers/query/query'; import {schemaApi} from '../../../../store/reducers/schema/schema'; import {tableSchemaDataApi} from '../../../../store/reducers/tableSchemaData'; import type {EPathType, TEvDescribeSchemeResult} from '../../../../types/api/schema'; +import {valueIsDefined} from '../../../../utils'; import { useQueryExecutionSettings, useTypedDispatch, @@ -78,12 +79,16 @@ export function SchemaTree(props: SchemaTreeProps) { const childItems = Children.map((childData) => { const {Name = '', PathType, PathSubType, ChildrenExist} = childData; + const isChildless = + isChildlessPathType(PathType, PathSubType) || + (valueIsDefined(ChildrenExist) && !ChildrenExist); + return { name: Name, type: mapPathTypeToNavigationTreeType(PathType, PathSubType), // FIXME: should only be explicitly set to true for tables with indexes // at the moment of writing there is no property to determine this, fix later - expandable: !isChildlessPathType(PathType, PathSubType) && ChildrenExist, + expandable: !isChildless, }; });