11import { CONNECTOR_DETAILS_TABS } from '../../constants/constants' ;
22import './ConnectorDetailsPage.css' ;
33import { EditConnectorComponent } from './EditConnectorComponent' ;
4+ import { IncrementalSnapshot } from './incrementalSnapshot/IncrementalSnapshot' ;
5+ import { Services } from '@debezium/ui-services' ;
46import {
57 Stack ,
68 StackItem ,
@@ -17,8 +19,11 @@ import {
1719 TabTitleText ,
1820 Tabs ,
1921} from '@patternfly/react-core' ;
22+ import { ConnectorIcon } from 'components' ;
23+ import { AppLayoutContext } from 'layout' ;
2024import React , { useEffect , useState } from 'react' ;
2125import { useHistory , useLocation } from 'react-router-dom' ;
26+ import { ConnectorTypeId , fetch_retry } from 'shared' ;
2227
2328export const ConnectorDetailsPage = ( ) => {
2429 const { hash, pathname } = useLocation ( ) ;
@@ -28,6 +33,9 @@ export const ConnectorDetailsPage = () => {
2833 const [ activeTabKey , setActiveTabKey ] = useState < string | number > (
2934 getTab ( hash )
3035 ) ;
36+ const [ connectorConfig , setConnectorConfig ] = React . useState <
37+ Map < string , string >
38+ > ( new Map < string , string > ( ) ) ;
3139
3240 /**
3341 * Toggle currently active tab
@@ -46,6 +54,21 @@ export const ConnectorDetailsPage = () => {
4654 setActiveTabKey ( getTab ( hash ) ) ;
4755 } , [ hash ] ) ;
4856
57+ const connectorService = Services . getConnectorService ( ) ;
58+ const appLayoutContext = React . useContext ( AppLayoutContext ) ;
59+ const clusterID = appLayoutContext . clusterId ;
60+
61+ useEffect ( ( ) => {
62+ fetch_retry ( connectorService . getConnectorConfig , connectorService , [
63+ clusterID ,
64+ actionConnectorName ,
65+ ] )
66+ . then ( ( cConnector ) => {
67+ setConnectorConfig ( cConnector ) ;
68+ } )
69+ . catch ( ( err : Error ) => console . error ( 'danger' , err ?. message ) ) ;
70+ } , [ clusterID , actionConnectorName ] ) ;
71+
4972 return (
5073 < Stack >
5174 < StackItem >
@@ -62,7 +85,21 @@ export const ConnectorDetailsPage = () => {
6285 < Level hasGutter = { true } >
6386 < LevelItem >
6487 < TextContent >
88+
6589 < Title headingLevel = "h3" size = { TitleSizes [ '2xl' ] } >
90+ { /* {connectorConfig['connector.id'] && (
91+ <ConnectorIcon
92+ connectorType={
93+ connectorConfig['connector.id'] === 'PostgreSQL'
94+ ? ConnectorTypeId.POSTGRES
95+ : connectorConfig['connector.id']
96+ }
97+ alt={actionConnectorName}
98+ width={30}
99+ height={30}
100+ />
101+ )}
102+ {` ${actionConnectorName}`} */ }
66103 { actionConnectorName }
67104 </ Title >
68105 </ TextContent >
@@ -73,6 +110,7 @@ export const ConnectorDetailsPage = () => {
73110 < StackItem isFilled >
74111 < PageSection
75112 variant = { PageSectionVariants . light }
113+ className = "connector-details-content"
76114 style = { { padding : '5px 5px 0 5px' } }
77115 >
78116 < Tabs activeKey = { activeTabKey } onSelect = { handleTabClick } >
@@ -99,7 +137,12 @@ export const ConnectorDetailsPage = () => {
99137 eventKey = { CONNECTOR_DETAILS_TABS . IncrementalSnapshot }
100138 title = { < TabTitleText > Incremental snapshot</ TabTitleText > }
101139 >
102- Incremental snapshot
140+ { actionConnectorName && connectorConfig [ 'connector.id' ] && (
141+ < IncrementalSnapshot
142+ actionConnectorName = { actionConnectorName }
143+ connectorConfig = { connectorConfig }
144+ />
145+ ) }
103146 </ Tab >
104147 </ Tabs >
105148 </ PageSection >
0 commit comments