File tree Expand file tree Collapse file tree 5 files changed +15
-16
lines changed
MutateTransferForm/components
components/TransferParams Expand file tree Collapse file tree 5 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 11import React , { memo } from 'react' ;
2- import { ConnectionQueryKey , connectionService } from '@entities/connection' ;
2+ import { ConnectionQueryKey , connectionService , CONNECTION_TYPE_NAMES } from '@entities/connection' ;
33import { ManagedSelect } from '@shared/ui' ;
44import { Form } from 'antd' ;
55import { useTranslation } from 'react-i18next' ;
@@ -27,7 +27,7 @@ export const SourceParams = memo(({ groupId }: SourceParamsProps) => {
2727 queryKey = { [ ConnectionQueryKey . GET_CONNECTIONS , groupId ] }
2828 queryFunction = { ( params ) => connectionService . getConnections ( { group_id : groupId , ...params } ) }
2929 renderOptionValue = { ( connection ) => connection . id }
30- renderOptionLabel = { ( connection ) => connection . name }
30+ renderOptionLabel = { ( connection ) => ` ${ connection . name } ( ${ CONNECTION_TYPE_NAMES [ connection . type ] } )` }
3131 onSelect = { handleSelectConnection }
3232 detailQueryKey = { [ ConnectionQueryKey . GET_CONNECTION ] }
3333 detailQueryFunction = { ( value ) => connectionService . getConnection ( { id : value } ) }
Original file line number Diff line number Diff line change 11import React , { memo } from 'react' ;
2- import { ConnectionQueryKey , connectionService } from '@entities/connection' ;
2+ import { ConnectionQueryKey , connectionService , CONNECTION_TYPE_NAMES } from '@entities/connection' ;
33import { ManagedSelect } from '@shared/ui' ;
44import { Form } from 'antd' ;
55import { useTranslation } from 'react-i18next' ;
@@ -27,7 +27,7 @@ export const TargetParams = memo(({ groupId }: TargetParamsProps) => {
2727 queryKey = { [ ConnectionQueryKey . GET_CONNECTIONS , groupId ] }
2828 queryFunction = { ( params ) => connectionService . getConnections ( { group_id : groupId , ...params } ) }
2929 renderOptionValue = { ( connection ) => connection . id }
30- renderOptionLabel = { ( connection ) => connection . name }
30+ renderOptionLabel = { ( connection ) => ` ${ connection . name } ( ${ CONNECTION_TYPE_NAMES [ connection . type ] } )` }
3131 onSelect = { handleSelectConnection }
3232 detailQueryKey = { [ ConnectionQueryKey . GET_CONNECTION ] }
3333 detailQueryFunction = { ( value ) => connectionService . getConnection ( { id : value } ) }
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { Descriptions } from 'antd' ;
33import { CONNECTION_TYPE_NAMES } from '@entities/connection' ;
4+ import { Link } from 'react-router-dom' ;
45import { useTranslation } from 'react-i18next' ;
56
67import { TransferParamsProps } from './types' ;
78import { getDescriptionItems } from './utils' ;
89
9- export const TransferParams = ( { data, ...props } : TransferParamsProps ) => {
10+ export const TransferParams = ( { data, connection , ...props } : TransferParamsProps ) => {
1011 const { t } = useTranslation ( ) ;
1112
1213 return (
1314 < Descriptions { ...props } >
14- < Descriptions . Item label = { t ( 'type' ) } span = { 3 } >
15- { CONNECTION_TYPE_NAMES [ data . type ] }
15+ < Descriptions . Item label = { t ( 'connection' , { ns : 'connection' } ) } span = { 3 } >
16+ < Link to = { `/connections/${ connection . id } ` } >
17+ { connection . name } ({ CONNECTION_TYPE_NAMES [ data . type ] } )
18+ </ Link >
1619 </ Descriptions . Item >
1720 { getDescriptionItems ( { data, t } ) . map ( ( item , index ) => (
1821 < Descriptions . Item label = { item . label } span = { 3 } key = { index } >
Original file line number Diff line number Diff line change 1+ import { Connection } from '@entities/connection' ;
12import { Transfer } from '@entities/transfer' ;
23import { DescriptionsProps } from 'antd' ;
34
45export interface TransferParamsProps extends DescriptionsProps {
6+ connection : Connection ;
57 data : Transfer [ 'source_params' ] | Transfer [ 'target_params' ] ;
68}
Original file line number Diff line number Diff line change @@ -38,17 +38,11 @@ export const TransferDetailInfo = ({
3838 < Descriptions . Item label = { t ( 'queue' , { ns : 'queue' } ) } span = { 3 } >
3939 < Link to = { `/queues/${ queue . id } ` } > { queue . name } </ Link >
4040 </ Descriptions . Item >
41- < Descriptions . Item label = { t ( 'sourceConnection' , { ns : 'transfer' } ) } span = { 3 } >
42- < Link to = { `/connections/${ connectionSource . id } ` } > { connectionSource . name } </ Link >
43- </ Descriptions . Item >
44- < Descriptions . Item label = { t ( 'targetConnection' , { ns : 'transfer' } ) } span = { 3 } >
45- < Link to = { `/connections/${ connectionTarget . id } ` } > { connectionTarget . name } </ Link >
46- </ Descriptions . Item >
47- < Descriptions . Item className = { classes . subDescription } label = { t ( 'sourceParams' , { ns : 'transfer' } ) } span = { 3 } >
48- < TransferParams data = { transfer . source_params } />
41+ < Descriptions . Item className = { classes . subDescription } label = { t ( 'source' , { ns : 'transfer' } ) } span = { 3 } >
42+ < TransferParams connection = { connectionSource } data = { transfer . source_params } />
4943 </ Descriptions . Item >
5044 < Descriptions . Item className = { classes . subDescription } label = { t ( 'targetParams' , { ns : 'transfer' } ) } span = { 3 } >
51- < TransferParams data = { transfer . target_params } />
45+ < TransferParams connection = { connectionTarget } data = { transfer . target_params } />
5246 </ Descriptions . Item >
5347 < Descriptions . Item className = { classes . subDescription } label = { t ( 'strategyParams' , { ns : 'transfer' } ) } span = { 3 } >
5448 < TransferStrategyParams data = { transfer . strategy_params } />
You can’t perform that action at this time.
0 commit comments