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
1 change: 1 addition & 0 deletions frontend/src/components/Connect/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const List: React.FC = () => {
navigate(clusterConnectConnectorPath(clusterName, connect, name))
}
emptyMessage="No connectors found"
setRowId={(originalRow) => `${originalRow.name}-${originalRow.connect}`}
/>
);
};
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/common/NewTable/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export interface TableProps<TData> {

onRowHover?: (row: Row<TData>) => void;
onMouseLeave?: () => void;

setRowId?: (originalRow: Row<TData>) => string;
}

type UpdaterFn<T> = (previousState: T) => T;
Expand Down Expand Up @@ -132,6 +134,7 @@ const Table: React.FC<TableProps<any>> = ({
onRowClick,
onRowHover,
onMouseLeave,
setRowId,
}) => {
const [searchParams, setSearchParams] = useSearchParams();
const location = useLocation();
Expand Down Expand Up @@ -164,7 +167,10 @@ const Table: React.FC<TableProps<any>> = ({
rowSelection,
},
getRowId: (originalRow, index) => {
return originalRow.name ? originalRow.name : `${index}`;
return (
setRowId?.(originalRow) ||
(originalRow.name ? originalRow.name : `${index}`)
);
},
onSortingChange: onSortingChange as OnChangeFn<SortingState>,
onPaginationChange: onPaginationChange as OnChangeFn<PaginationState>,
Expand Down