Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ const ClusterTableActionsCell: React.FC<Props> = ({ row }) => {
);
}, [data]);

const handleClick = (e: React.MouseEvent) => {
e.stopPropagation();
};

return (
<ActionCanButton
buttonType="secondary"
buttonSize="S"
to={clusterConfigPath(name)}
canDoAction={hasPermissions}
onClick={handleClick}
>
Configure
</ActionCanButton>
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ 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';
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);
Expand Down Expand Up @@ -92,6 +94,10 @@ const Dashboard: React.FC = () => {

const columnSizingPersister = useLocalStoragePersister('KafkaConnect');

const onRowClick = (row: Row<Cluster>) => {
navigate(clusterBrokersPath(row.original.name));
};

return (
<>
<PageHeading text="Dashboard" />
Expand Down Expand Up @@ -128,6 +134,7 @@ const Dashboard: React.FC = () => {
)}
</S.Toolbar>
<Table
onRowClick={onRowClick}
columns={columns}
data={config?.list}
enableSorting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('ClusterMenu', () => {
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) {
Expand Down
Loading