console: add missing key to component map in CardedTable

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9712
GitOrigin-RevId: 531e2cfae8568326be4d5486728181c64fa82e31
This commit is contained in:
Matthew Goodwin 2023-07-06 12:05:46 -05:00 committed by hasura-bot
parent 9eb1097957
commit d61d523f77
2 changed files with 10 additions and 6 deletions

View File

@ -261,7 +261,7 @@ export const ReactTableWrapper: React.VFC<ReactTableWrapperProps> = ({
return (
<CardedTable.TableBodyCell
key={i}
key={`${row.id}-${i}`}
data-testid={`@table-cell-${row.id}-${i}`}
style={{ maxWidth: '20ch' }}
>

View File

@ -107,12 +107,16 @@ const Body = ({ data, showActionCell = false }: BodyProps) => {
<TableBody>
{data.map((row, rowIndex) => {
return (
<TableBodyRow>
{row.map((cell, index) => {
if (showActionCell && index + 1 === row.length) {
return <TableBodyActionCell>{cell}</TableBodyActionCell>;
<TableBodyRow key={rowIndex}>
{row.map((cell, cellIndex) => {
if (showActionCell && cellIndex + 1 === row.length) {
return (
<TableBodyActionCell key={cellIndex}>
{cell}
</TableBodyActionCell>
);
}
return <TableBodyCell>{cell}</TableBodyCell>;
return <TableBodyCell key={cellIndex}>{cell}</TableBodyCell>;
})}
</TableBodyRow>
);