File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed
components/InfoViewer/schemaOverview
containers/Tenant/ObjectSummary Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 1+ import type { TEvDescribeSchemeResult , TCdcStreamDescription } from '../../../types/api/schema' ;
2+
3+ import { InfoViewer , InfoViewerItem } from '..' ;
4+ import { formatCdcStreamItem , formatCommonItem } from '../formatters' ;
5+
6+ const DISPLAYED_FIELDS : Set < keyof TCdcStreamDescription > = new Set ( [
7+ 'Mode' ,
8+ 'Format' ,
9+ ] ) ;
10+
11+ interface CDCStreamOverviewProps {
12+ data ?: TEvDescribeSchemeResult ;
13+ }
14+
15+ export const CDCStreamOverview = ( { data} : CDCStreamOverviewProps ) => {
16+ if ( ! data ) {
17+ return (
18+ < div className = "error" > No CDC Stream data</ div >
19+ ) ;
20+ }
21+
22+ const TableIndex = data . PathDescription ?. CdcStreamDescription ;
23+ const info : Array < InfoViewerItem > = [ ] ;
24+
25+ info . push ( formatCommonItem ( 'PathType' , data . PathDescription ?. Self ?. PathType ) ) ;
26+ info . push ( formatCommonItem ( 'CreateStep' , data . PathDescription ?. Self ?. CreateStep ) ) ;
27+
28+ let key : keyof TCdcStreamDescription ;
29+ for ( key in TableIndex ) {
30+ if ( DISPLAYED_FIELDS . has ( key ) ) {
31+ info . push ( formatCdcStreamItem ( key , TableIndex ?. [ key ] ) ) ;
32+ }
33+ }
34+
35+ return (
36+ < >
37+ { info . length ? (
38+ < InfoViewer info = { info } > </ InfoViewer >
39+ ) : (
40+ < > Empty</ >
41+ ) }
42+ </ >
43+ ) ;
44+ } ;
Original file line number Diff line number Diff line change 1+ export * from './CDCStreamOverview' ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import Acl from '../Acl/Acl';
1414import SchemaViewer from '../Schema/SchemaViewer/SchemaViewer' ;
1515import CopyToClipboard from '../../../components/CopyToClipboard/CopyToClipboard' ;
1616import InfoViewer from '../../../components/InfoViewer/InfoViewer' ;
17+ import { CDCStreamOverview } from '../../../components/InfoViewer/schemaOverview' ;
1718import Icon from '../../../components/Icon/Icon' ;
1819
1920import { EPathSubType , EPathType , TDirEntry } from '../../../types/api/schema' ;
@@ -162,7 +163,7 @@ function ObjectSummary(props: ObjectSummaryProps) {
162163 [ EPathType . EPathTypeExtSubDomain ] : undefined ,
163164 [ EPathType . EPathTypeColumnStore ] : undefined ,
164165 [ EPathType . EPathTypeColumnTable ] : undefined ,
165- [ EPathType . EPathTypeCdcStream ] : ( ) => undefined ,
166+ [ EPathType . EPathTypeCdcStream ] : ( ) => < CDCStreamOverview data = { data [ currentSchemaPath ] } /> ,
166167 } ;
167168
168169 let component = currentSchemaData ?. PathType && pathTypeToComponent [ currentSchemaData . PathType ] ?.( ) ;
You can’t perform that action at this time.
0 commit comments