diff --git a/kafka-ui-react-app/src/components/Topics/List/List.tsx b/kafka-ui-react-app/src/components/Topics/List/List.tsx index 334ff6a917..362010d1fc 100644 --- a/kafka-ui-react-app/src/components/Topics/List/List.tsx +++ b/kafka-ui-react-app/src/components/Topics/List/List.tsx @@ -6,7 +6,7 @@ import { TopicName, } from 'redux/interfaces'; import { useParams } from 'react-router-dom'; -import { clusterTopicNewPath } from 'lib/paths'; +import { clusterTopicCopyPath, clusterTopicNewPath } from 'lib/paths'; import usePagination from 'lib/hooks/usePagination'; import ClusterContext from 'components/contexts/ClusterContext'; import PageLoader from 'components/common/PageLoader/PageLoader'; @@ -125,6 +125,21 @@ const List: React.FC = ({ } ); + const getSelectedTopic = (): string => { + const name = Array.from(tableState.selectedIds)[0]; + const selectedTopic = + tableState.data.find( + (topic: TopicWithDetailedInfo) => topic.name === name + ) || {}; + + return Object.keys(selectedTopic) + .map((x: string) => { + const value = selectedTopic[x as keyof typeof selectedTopic]; + return value && x !== 'partitions' ? `${x}=${value}` : null; + }) + .join('&'); + }; + const handleSwitch = React.useCallback(() => { setShowInternal(!showInternal); history.push(`${pathname}?page=1&perPage=${perPage || PER_PAGE}`); @@ -295,6 +310,20 @@ const List: React.FC = ({ > Delete selected topics + {tableState.selectedCount === 1 && ( + + )} +