From 71a7de8fd97e7afef4e405979f9edf47e9ecb901 Mon Sep 17 00:00:00 2001 From: syam babu Date: Fri, 3 Jan 2025 18:35:47 +0530 Subject: [PATCH 1/3] fix: made data-cy for table cell static. closes #1513 --- src/components/DraggableTree/EditableCell.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DraggableTree/EditableCell.jsx b/src/components/DraggableTree/EditableCell.jsx index 7651c631..53df5a6c 100644 --- a/src/components/DraggableTree/EditableCell.jsx +++ b/src/components/DraggableTree/EditableCell.jsx @@ -74,7 +74,7 @@ const EditableCell = ({ title, editable, children, dataIndex, record, handleSave let dataCy = ``; if (typeof value === 'string') { - dataCy = `taxonomy-concept-cell-${value.replace(/\s+/g, '')}-${recordKey}`; + dataCy = `taxonomy-concept-cell${value.replace(/\s+/g, '')}`; } return ( From 56e40987d114d1e4012010247a6a6a70c0691402 Mon Sep 17 00:00:00 2001 From: syam babu Date: Wed, 8 Jan 2025 17:50:17 +0530 Subject: [PATCH 2/3] fix: removed content language dependency of data-cy selectors. closes #1513 --- src/components/DraggableTree/DraggableTable.jsx | 2 +- src/components/DraggableTree/EditableCell.jsx | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/DraggableTree/DraggableTable.jsx b/src/components/DraggableTree/DraggableTable.jsx index 42eac321..9a44496e 100644 --- a/src/components/DraggableTree/DraggableTable.jsx +++ b/src/components/DraggableTree/DraggableTable.jsx @@ -78,7 +78,7 @@ const DraggableTable = ({ data, setData, fallbackStatus, setFallbackStatus, tran dataIndex: contentLanguageKeyMap[language], key: contentLanguageKeyMap[language], editable: true, - ['data-cy']: `taxonomy-concept-row-more-btn-${language}`, + ['data-cy']: `taxonomy-concept-row-more-btn`, })); const moveRow = useCallback( diff --git a/src/components/DraggableTree/EditableCell.jsx b/src/components/DraggableTree/EditableCell.jsx index 53df5a6c..13cfec74 100644 --- a/src/components/DraggableTree/EditableCell.jsx +++ b/src/components/DraggableTree/EditableCell.jsx @@ -72,13 +72,8 @@ const EditableCell = ({ title, editable, children, dataIndex, record, handleSave ); } - let dataCy = ``; - if (typeof value === 'string') { - dataCy = `taxonomy-concept-cell${value.replace(/\s+/g, '')}`; - } - return ( - + {editing ? (