Skip to content

Commit cbd525d

Browse files
committed
refactor(ObjectSummary): refine data types
1 parent 4cc773f commit cbd525d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/containers/Tenant/ObjectSummary/ObjectSummary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import CopyToClipboard from '../../../components/CopyToClipboard/CopyToClipboard
1616
import InfoViewer from '../../../components/InfoViewer/InfoViewer';
1717
import Icon from '../../../components/Icon/Icon';
1818

19-
import type {EPathSubType, EPathType} from '../../../types/api/schema';
19+
import type {EPathSubType, EPathType, TDirEntry} from '../../../types/api/schema';
2020
import {isColumnEntityType, isIndexTable, isTableType} from '../utils/schema';
2121

2222
import {
@@ -100,8 +100,8 @@ function ObjectSummary(props: ObjectSummaryProps) {
100100
});
101101

102102
const {name: tenantName, info: infoTab} = queryParams;
103-
const pathData = _.get(data[tenantName as string], 'PathDescription.Self');
104-
const currentSchemaData = _.get(data[currentSchemaPath], 'PathDescription.Self');
103+
const pathData: TDirEntry | undefined = _.get(data[tenantName as string], 'PathDescription.Self');
104+
const currentSchemaData: TDirEntry | undefined = _.get(data[currentSchemaPath], 'PathDescription.Self');
105105

106106
const tableSchema =
107107
currentItem?.PathDescription?.Table || currentItem?.PathDescription?.ColumnTableDescription;
@@ -203,7 +203,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
203203
rootPath={tenantName as string}
204204
// for the root pathData.Name contains the same string as tenantName,
205205
// but without the leading slash
206-
rootName={pathData?.Name || tenantName}
206+
rootName={pathData.Name || String(tenantName)}
207207
rootType={pathData.PathType}
208208
currentPath={currentSchemaPath}
209209
/>

src/containers/Tenant/Schema/SchemaTree/SchemaTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {getActions} from '../../utils/schemaActions';
1414
interface SchemaTreeProps {
1515
rootPath: string;
1616
rootName: string;
17-
rootType: EPathType;
17+
rootType?: EPathType;
1818
currentPath: string;
1919
}
2020

0 commit comments

Comments
 (0)