From 7fcd41108934f56561eb381b3dbdde1bf64ca02d Mon Sep 17 00:00:00 2001 From: Amogh Bharadwaj Date: Tue, 12 Dec 2023 01:12:07 +0530 Subject: [PATCH] UI: No index as key (#796) For list of components whose ordering or cardinality can change, using the array index as the key attribute isn't ideal. This PR uses a unique component-based key instead such as row.id or row.name in those cases --- ui/app/mirrors/create/cdc/schemabox.tsx | 11 ++++++----- ui/app/mirrors/create/cdc/tablemapping.tsx | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/app/mirrors/create/cdc/schemabox.tsx b/ui/app/mirrors/create/cdc/schemabox.tsx index e205f33ab5..4195fae83d 100644 --- a/ui/app/mirrors/create/cdc/schemabox.tsx +++ b/ui/app/mirrors/create/cdc/schemabox.tsx @@ -182,10 +182,10 @@ const SchemaBox = ({ row.schema === schema && row.source.toLowerCase().includes(tableQuery.toLowerCase()) ) - .map((row, index) => { + .map((row) => { const columns = getTableColumns(row.source); return ( -
+
{columns ? ( - columns.map((column, index) => { + columns.map((column) => { const columnName = column.split(':')[0]; const columnType = column.split(':')[1]; const isPkey = column.split(':')[2] === 'true'; return ( - {columnName}{' '} + {columnName}

{ return schema.toLowerCase().includes(schemaQuery.toLowerCase()); }) - .map((schema, index) => ( + .map((schema) => (