diff --git a/frontend/src/components/Dashboard/ClusterTableActionsCell.tsx b/frontend/src/components/Dashboard/ClusterTableActionsCell.tsx index 946f8b9dd..e8d44d3f5 100644 --- a/frontend/src/components/Dashboard/ClusterTableActionsCell.tsx +++ b/frontend/src/components/Dashboard/ClusterTableActionsCell.tsx @@ -18,12 +18,17 @@ const ClusterTableActionsCell: React.FC = ({ row }) => { ); }, [data]); + const handleClick = (e: React.MouseEvent) => { + e.stopPropagation(); + }; + return ( Configure diff --git a/frontend/src/components/Dashboard/Dashboard.tsx b/frontend/src/components/Dashboard/Dashboard.tsx index 9d297369a..835070a26 100644 --- a/frontend/src/components/Dashboard/Dashboard.tsx +++ b/frontend/src/components/Dashboard/Dashboard.tsx @@ -5,14 +5,15 @@ import { Tag } from 'components/common/Tag/Tag.styled'; import Switch from 'components/common/Switch/Switch'; import { useClusters } from 'lib/hooks/api/clusters'; import { Cluster, ResourceType, ServerStatus } from 'generated-sources'; -import { ColumnDef } from '@tanstack/react-table'; +import { ColumnDef, Row } from '@tanstack/react-table'; import Table, { SizeCell } from 'components/common/NewTable'; import useBoolean from 'lib/hooks/useBoolean'; -import { clusterNewConfigPath } from 'lib/paths'; +import { clusterBrokersPath, clusterNewConfigPath } from 'lib/paths'; import { GlobalSettingsContext } from 'components/contexts/GlobalSettingsContext'; import { ActionCanButton } from 'components/common/ActionComponent'; import { useGetUserInfo } from 'lib/hooks/api/roles'; import { useLocalStoragePersister } from 'components/common/NewTable/ColumnResizer/lib'; +import { useNavigate } from 'react-router-dom'; import * as S from './Dashboard.styled'; import ClusterName from './ClusterName'; @@ -20,6 +21,7 @@ import ClusterTableActionsCell from './ClusterTableActionsCell'; const Dashboard: React.FC = () => { const { data } = useGetUserInfo(); + const navigate = useNavigate(); const clusters = useClusters(); const { value: showOfflineOnly, toggle } = useBoolean(false); const appInfo = React.useContext(GlobalSettingsContext); @@ -92,6 +94,10 @@ const Dashboard: React.FC = () => { const columnSizingPersister = useLocalStoragePersister('KafkaConnect'); + const onRowClick = (row: Row) => { + navigate(clusterBrokersPath(row.original.name)); + }; + return ( <> @@ -128,6 +134,7 @@ const Dashboard: React.FC = () => { )} { const getKafkaConnect = () => screen.getByTitle('Kafka Connect'); const getCluster = () => screen.getByText(onlineClusterPayload.name); - // Хелпер для клика по шеврону - ищем SVG с шевроном const clickChevron = async () => { const chevronSvg = document.querySelector('svg[viewBox="0 0 10 6"]'); if (chevronSvg) {