Skip to content

Commit

Permalink
Removed data-gridcell-id from EuiDataGrid cells
Browse files Browse the repository at this point in the history
- use separate `data-gridcell-column-id` & `data-gridcell-row-index` attributes instead
  • Loading branch information
cee-chen committed May 4, 2022
1 parent 0b09e59 commit 42434ca
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 38 deletions.
30 changes: 0 additions & 30 deletions src/components/datagrid/__snapshots__/data_grid.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1170,7 +1169,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1202,7 +1200,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1234,7 +1231,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1266,7 +1262,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1298,7 +1293,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1602,7 +1596,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="leading"
data-gridcell-column-index="0"
data-gridcell-id="0,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1653,7 +1646,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="A"
data-gridcell-column-index="1"
data-gridcell-id="1,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1685,7 +1677,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="B"
data-gridcell-column-index="2"
data-gridcell-id="2,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1717,7 +1708,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="trailing"
data-gridcell-column-index="3"
data-gridcell-id="3,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1768,7 +1758,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="leading"
data-gridcell-column-index="0"
data-gridcell-id="0,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1819,7 +1808,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="A"
data-gridcell-column-index="1"
data-gridcell-id="1,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1851,7 +1839,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="B"
data-gridcell-column-index="2"
data-gridcell-id="2,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1883,7 +1870,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="trailing"
data-gridcell-column-index="3"
data-gridcell-id="3,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1934,7 +1920,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="leading"
data-gridcell-column-index="0"
data-gridcell-id="0,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -1985,7 +1970,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="A"
data-gridcell-column-index="1"
data-gridcell-id="1,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2017,7 +2001,6 @@ Array [
class="euiDataGridRowCell"
data-gridcell-column-id="B"
data-gridcell-column-index="2"
data-gridcell-id="2,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2049,7 +2032,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn euiDataGridRowCell--controlColumn"
data-gridcell-column-id="trailing"
data-gridcell-column-index="3"
data-gridcell-id="3,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2333,7 +2315,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2365,7 +2346,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2397,7 +2377,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2429,7 +2408,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2461,7 +2439,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2493,7 +2470,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2756,7 +2732,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2788,7 +2763,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2820,7 +2794,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2852,7 +2825,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,1"
data-gridcell-row-index="1"
data-gridcell-visible-row-index="1"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2884,7 +2856,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--firstColumn"
data-gridcell-column-id="A"
data-gridcell-column-index="0"
data-gridcell-id="0,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -2916,7 +2887,6 @@ Array [
class="euiDataGridRowCell euiDataGridRowCell--lastColumn"
data-gridcell-column-id="B"
data-gridcell-column-index="1"
data-gridcell-id="1,2"
data-gridcell-row-index="2"
data-gridcell-visible-row-index="2"
data-test-subj="dataGridRowCell"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ exports[`EuiDataGridBody renders 1`] = `
class="euiDataGridRowCell euiDataGridRowCell--boolean euiDataGridRowCell--firstColumn"
data-gridcell-column-id="columnA"
data-gridcell-column-index="0"
data-gridcell-id="0,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down Expand Up @@ -138,7 +137,6 @@ exports[`EuiDataGridBody renders 1`] = `
class="euiDataGridRowCell euiDataGridRowCell--string euiDataGridRowCell--lastColumn"
data-gridcell-column-id="columnB"
data-gridcell-column-index="1"
data-gridcell-id="1,0"
data-gridcell-row-index="0"
data-gridcell-visible-row-index="0"
data-test-subj="dataGridRowCell"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ exports[`EuiDataGridCell renders 1`] = `
className="euiDataGridRowCell"
data-gridcell-column-id="someColumn"
data-gridcell-column-index={0}
data-gridcell-id="0,0"
data-gridcell-row-index={0}
data-gridcell-visible-row-index={0}
data-test-subj="dataGridRowCell"
Expand Down
1 change: 0 additions & 1 deletion src/components/datagrid/body/data_grid_cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ export class EuiDataGridCell extends Component<
data-gridcell-column-index={this.props.colIndex} // Affected by column reordering
data-gridcell-row-index={this.props.rowIndex} // Index from data, not affected by sorting or pagination
data-gridcell-visible-row-index={this.props.visibleRowIndex} // Affected by sorting & pagination
data-gridcell-id={`${this.props.colIndex},${this.props.rowIndex}`} // TODO: Deprecate in favor of the above 4 data attrs
onKeyDown={handleCellKeyDown}
onFocus={this.onFocus}
onMouseEnter={() => {
Expand Down
4 changes: 0 additions & 4 deletions src/components/datagrid/data_grid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ describe('EuiDataGrid', () => {
"className": "euiDataGridRowCell euiDataGridRowCell--firstColumn customClass",
"data-gridcell-column-id": "A",
"data-gridcell-column-index": 0,
"data-gridcell-id": "0,0",
"data-gridcell-row-index": 0,
"data-gridcell-visible-row-index": 0,
"data-test-subj": "dataGridRowCell",
Expand All @@ -571,7 +570,6 @@ describe('EuiDataGrid', () => {
"className": "euiDataGridRowCell euiDataGridRowCell--lastColumn customClass",
"data-gridcell-column-id": "B",
"data-gridcell-column-index": 1,
"data-gridcell-id": "1,0",
"data-gridcell-row-index": 0,
"data-gridcell-visible-row-index": 0,
"data-test-subj": "dataGridRowCell",
Expand All @@ -597,7 +595,6 @@ describe('EuiDataGrid', () => {
"className": "euiDataGridRowCell euiDataGridRowCell--firstColumn customClass",
"data-gridcell-column-id": "A",
"data-gridcell-column-index": 0,
"data-gridcell-id": "0,1",
"data-gridcell-row-index": 1,
"data-gridcell-visible-row-index": 1,
"data-test-subj": "dataGridRowCell",
Expand All @@ -623,7 +620,6 @@ describe('EuiDataGrid', () => {
"className": "euiDataGridRowCell euiDataGridRowCell--lastColumn customClass",
"data-gridcell-column-id": "B",
"data-gridcell-column-index": 1,
"data-gridcell-id": "1,1",
"data-gridcell-row-index": 1,
"data-gridcell-visible-row-index": 1,
"data-test-subj": "dataGridRowCell",
Expand Down

0 comments on commit 42434ca

Please sign in to comment.