Skip to content

Commit 908a351

Browse files
committed
fix: preview
1 parent 6d6f786 commit 908a351

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/containers/Tenant/Query/Preview/Preview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {useTopicDataAvailable} from '../../../../store/reducers/capabilities/hooks';
2-
import {EPathType} from '../../../../types/api/schema';
2+
import {EPathSubType, EPathType} from '../../../../types/api/schema';
33
import {isTableType} from '../../utils/schema';
44
import i18n from '../i18n';
55

@@ -15,14 +15,14 @@ export function PreviewContainer(props: PreviewContainerProps) {
1515
const {type, subType} = props;
1616
const isTable = isTableType(type);
1717
const isTopic = type === EPathType.EPathTypePersQueueGroup;
18+
const isCdcTopic = subType === EPathSubType.EPathSubTypeStreamImpl;
1819
const isTopicPreviewAvailable = useTopicDataAvailable();
1920

2021
if (isTable) {
2122
return <TablePreview {...props} />;
2223
}
2324

24-
// preview is not available for topics inside CDC (has subtype)
25-
if (isTopic && !subType && isTopicPreviewAvailable) {
25+
if (isTopic && !isCdcTopic && isTopicPreviewAvailable) {
2626
return <TopicPreview {...props} />;
2727
}
2828

src/containers/Tenant/utils/controls.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {api} from '../../../store/reducers/api';
66
import {setShowPreview} from '../../../store/reducers/schema/schema';
77
import {TENANT_PAGES_IDS, TENANT_QUERY_TABS_ID} from '../../../store/reducers/tenant/constants';
88
import {setQueryTab, setTenantPage} from '../../../store/reducers/tenant/tenant';
9+
import {EPathSubType} from '../../../types/api/schema';
910
import i18n from '../i18n';
1011

1112
import type {YdbNavigationTreeProps} from './types';
@@ -62,6 +63,8 @@ export const getSchemaControls =
6263
const options = bindActions(path, dispatch, additionalEffects);
6364
const openPreview = getPreviewControl(options, size);
6465

66+
const isCdcTopic = meta?.subType === EPathSubType.EPathSubTypeStreamImpl;
67+
6568
const nodeTypeToControls: Record<NavigationTreeNodeType, Controls> = {
6669
async_replication: undefined,
6770
transfer: undefined,
@@ -74,7 +77,7 @@ export const getSchemaControls =
7477
column_table: openPreview,
7578

7679
index_table: undefined,
77-
topic: isTopicPreviewAvailable && !meta?.subType ? openPreview : undefined,
80+
topic: isTopicPreviewAvailable && !isCdcTopic ? openPreview : undefined,
7881
stream: undefined,
7982

8083
index: undefined,

0 commit comments

Comments
 (0)