File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ import CopyToClipboard from '../../../components/CopyToClipboard/CopyToClipboard
1616import InfoViewer from '../../../components/InfoViewer/InfoViewer' ;
1717import Icon from '../../../components/Icon/Icon' ;
1818
19- import type { EPathType } from '../../../types/api/schema' ;
20- import { isColumnEntityType , isTableType } from '../utils/schema' ;
19+ import type { EPathSubType , EPathType } from '../../../types/api/schema' ;
20+ import { isColumnEntityType , isIndexTable , isTableType } from '../utils/schema' ;
2121
2222import {
2323 DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED ,
@@ -71,6 +71,7 @@ function prepareOlapTableSchema(tableSchema: any) {
7171
7272interface ObjectSummaryProps {
7373 type ?: EPathType ;
74+ subType ?: EPathSubType ;
7475 onCollapseSummary : VoidFunction ;
7576 onExpandSummary : VoidFunction ;
7677 isCollapsed : boolean ;
@@ -229,10 +230,10 @@ function ObjectSummary(props: ObjectSummaryProps) {
229230 } ;
230231
231232 const renderCommonInfoControls = ( ) => {
232- const isTable = isTableType ( props . type ) ;
233+ const showPreview = isTableType ( props . type ) && ! isIndexTable ( props . subType ) ;
233234 return (
234235 < React . Fragment >
235- { isTable && (
236+ { showPreview && (
236237 < Button view = "flat-secondary" onClick = { onOpenPreview } title = "Show preview" >
237238 < Icon name = "tablePreview" viewBox = { '0 0 16 16' } height = { 16 } width = { 16 } />
238239 </ Button >
Original file line number Diff line number Diff line change @@ -104,7 +104,10 @@ function Tenant(props: TenantProps) {
104104 } ;
105105 } , [ tenantName , dispatch ] ) ;
106106
107- const currentPathType = ( currentItem as TEvDescribeSchemeResult ) . PathDescription ?. Self ?. PathType ;
107+ const {
108+ PathType : currentPathType ,
109+ PathSubType : currentPathSubType ,
110+ } = ( currentItem as TEvDescribeSchemeResult ) . PathDescription ?. Self || { } ;
108111
109112 const onCollapseSummaryHandler = ( ) => {
110113 dispatchSummaryVisibilityAction ( PaneVisibilityActionTypes . triggerCollapse ) ;
@@ -138,6 +141,7 @@ function Tenant(props: TenantProps) {
138141 >
139142 < ObjectSummary
140143 type = { currentPathType }
144+ subType = { currentPathSubType }
141145 onCollapseSummary = { onCollapseSummaryHandler }
142146 onExpandSummary = { onExpandSummaryHandler }
143147 isCollapsed = { summaryVisibilityState . collapsed }
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ export const mapPathTypeToNavigationTreeType = (
3535export const isTableType = ( type ?: EPathType ) =>
3636 mapPathTypeToNavigationTreeType ( type ) === 'table' ;
3737
38+ export const isIndexTable = ( subType ?: EPathSubType ) =>
39+ mapTablePathSubTypeToNavigationTreeType ( subType ) === 'index_table' ;
40+
3841export const isColumnEntityType = ( type ?: EPathType ) =>
3942 type === EPathType . EPathTypeColumnStore ||
4043 type === EPathType . EPathTypeColumnTable ;
You can’t perform that action at this time.
0 commit comments